Go to the documentation of this file.
52 #ifndef __PCL_LocalNormalizationData_h
53 #define __PCL_LocalNormalizationData_h
69 class PCL_CLASS XMLDocument;
70 class PCL_CLASS XMLElement;
181 Parse( filePath, ignoreNormalizationData );
205 Parse( xml, ignoreNormalizationData );
229 Parse( element, ignoreNormalizationData );
248 return m_referenceFilePath;
278 return m_targetFilePath;
324 return m_referenceWidth;
335 return m_referenceHeight;
346 m_referenceWidth = width;
347 m_referenceHeight = height;
357 return m_A.NumberOfChannels();
426 if ( A.Bounds() != B.Bounds() )
427 throw Error(
"LocalNormalizationData::SetLocalNormalizationParameters(): Incompatible matrix dimensions." );
428 if ( A.NumberOfChannels() != B.NumberOfChannels() )
429 throw Error(
"LocalNormalizationData::SetLocalNormalizationParameters(): Incompatible number of normalization matrices." );
434 if ( C.Length() != A.NumberOfChannels() )
435 throw Error(
"LocalNormalizationData::SetLocalNormalizationParameters(): Incompatible bias vector length." );
499 throw Error(
"LocalNormalizationData::SetGlobalNormalizationParameters(): No zero offset coefficient matrix has been defined." );
500 if ( Rc.
Length() != m_B.NumberOfChannels() || Tc.
Length() != m_B.NumberOfChannels() || S.Length() != m_B.NumberOfChannels() )
501 throw Error(
"LocalNormalizationData::SetGlobalNormalizationParameters(): Incompatible vector lengths." );
529 throw Error(
"LocalNormalizationData::SetRelativeScaleFactors(): No zero offset coefficient matrix has been defined." );
530 if ( s.
Length() != m_B.NumberOfChannels() )
531 throw Error(
"LocalNormalizationData::SetRelativeScaleFactors(): Incompatible vector lengths." );
553 void InitInterpolations();
561 return !m_UA.IsEmpty() && !m_UB.IsEmpty();
591 if ( likely( m_S.IsEmpty() ) )
592 return m_UA[c]( sx, sy )*(z - m_C[c]) + m_UB[c]( sx, sy );
593 return (m_UA[c]( sx, sy )*(z - m_C[c]) + m_UB[c]( sx, sy ) - m_Tc[c])*m_S[c] + m_Rc[c];
602 return m_creationTime;
631 void Parse(
const String& filePath,
bool ignoreNormalizationData =
false );
654 void Parse(
const XMLDocument& xml,
bool ignoreNormalizationData =
false );
677 void Parse(
const XMLElement& element,
bool ignoreNormalizationData =
false );
691 return m_compressionEnabled;
701 m_compressionEnabled = enable;
711 EnableCompression( !disable );
777 void SerializeToFile(
const String& path )
const;
781 String m_referenceFilePath;
784 int m_referenceWidth = -1;
785 int m_referenceHeight = -1;
786 normalization_matrices m_A;
787 normalization_matrices m_B;
789 matrix_interpolations m_UA;
790 matrix_interpolations m_UB;
798 bool m_compressionEnabled =
true;
800 bool m_invalid =
false;
802 void ParseNormalizationMatrices( normalization_matrices&,
const XMLElement& )
const;
803 void SerializeNormalizationMatrices(
XMLElement*,
const normalization_matrices& )
const;
810 #endif // __PCL_LocalNormalizationData_h
const Vector & GlobalScalingFactors() const
void SetLocalNormalizationParameters(const normalization_matrices &A, const normalization_matrices &B, const Vector &C=Vector())
const Vector & Bias() const
void SetReferenceDimensions(int width, int height)
const normalization_matrices & Scale() const
XML document parsing and generation
bool IsCompressionEnabled() const
TimePoint CreationTime() const
const normalization_matrices & ZeroOffset() const
bool IsTaggedAsInvalid() const
int ReferenceHeight() const
virtual ~LocalNormalizationData()
void SetGlobalNormalizationParameters(const Vector &Rc, const Vector &Tc, const Vector &S)
Normalization data parser and generator.
typename pixel_traits::sample sample
int NormalizationScale() const
A simple exception with an associated error message.
An instant in any timescale.
void SetReferenceFilePath(const String &filePath)
void SetTargetFilePath(const String &filePath)
void SetNormalizationScale(int scale)
int ReferenceWidth() const
const String & ReferenceFilePath() const
int NumberOfChannels() const
bool HasInterpolations() const
static String FullPath(const String &path)
LocalNormalizationData(const String &filePath, bool ignoreNormalizationData=false)
normalization_matrices::sample normalization_coefficient
void EnableCompression(bool enable=true)
int Length() const noexcept
void SetRelativeScaleFactors(const Vector &s)
void SetVersion(int version)
const String & TargetFilePath() const
const Vector & GlobalTargetLocation() const
LocalNormalizationData(const XMLDocument &xml, bool ignoreNormalizationData=false)
double operator()(double z, int x, int y, int c=0) const
Bicubic B-Spline Interpolation Algorithm.
LocalNormalizationData(const XMLElement &element, bool ignoreNormalizationData=false)
const Vector & GlobalReferenceLocation() const
void DisableCompression(bool disable=true)
Implements a generic, two-dimensional, shared or local image.
const Vector & RelativeScaleFactors() const