52 #ifndef __PCL_LocalNormalizationData_h
53 #define __PCL_LocalNormalizationData_h
69 class PCL_CLASS XMLDocument;
70 class PCL_CLASS XMLElement;
191 Parse( filePath, ignoreNormalizationData );
215 Parse( xml, ignoreNormalizationData );
239 Parse( element, ignoreNormalizationData );
258 return m_referenceFilePath;
288 return m_targetFilePath;
334 return m_referenceWidth;
345 return m_referenceHeight;
356 m_referenceWidth = width;
357 m_referenceHeight = height;
367 return m_A.NumberOfChannels();
436 if ( A.Bounds() != B.Bounds() )
437 throw Error(
"LocalNormalizationData::SetLocalNormalizationParameters(): Incompatible matrix dimensions." );
438 if ( A.NumberOfChannels() != B.NumberOfChannels() )
439 throw Error(
"LocalNormalizationData::SetLocalNormalizationParameters(): Incompatible number of normalization matrices." );
444 if ( C.Length() != A.NumberOfChannels() )
445 throw Error(
"LocalNormalizationData::SetLocalNormalizationParameters(): Incompatible bias vector length." );
509 throw Error(
"LocalNormalizationData::SetGlobalNormalizationParameters(): No zero offset coefficient matrix has been defined." );
510 if ( Rc.
Length() != m_B.NumberOfChannels() || Tc.
Length() != m_B.NumberOfChannels() || S.Length() != m_B.NumberOfChannels() )
511 throw Error(
"LocalNormalizationData::SetGlobalNormalizationParameters(): Incompatible vector lengths." );
539 throw Error(
"LocalNormalizationData::SetRelativeScaleFactors(): No zero offset coefficient matrix has been defined." );
540 if ( s.
Length() != m_B.NumberOfChannels() )
541 throw Error(
"LocalNormalizationData::SetRelativeScaleFactors(): Incompatible vector lengths." );
571 return !m_UA.IsEmpty() && !m_UB.IsEmpty();
601 if ( likely( m_S.IsEmpty() ) )
602 return m_UA[c]( sx, sy )*(z - m_C[c]) + m_UB[c]( sx, sy );
603 return (m_UA[c]( sx, sy )*(z - m_C[c]) + m_UB[c]( sx, sy ) - m_Tc[c])*m_S[c] + m_Rc[c];
612 return m_creationTime;
641 void Parse(
const String& filePath,
bool ignoreNormalizationData =
false );
701 return m_compressionEnabled;
711 m_compressionEnabled = enable;
721 EnableCompression( !disable );
791 String m_referenceFilePath;
794 int m_referenceWidth = -1;
795 int m_referenceHeight = -1;
808 bool m_compressionEnabled =
true;
810 bool m_invalid =
false;
Bicubic B-Spline Interpolation Algorithm.
A simple exception with an associated error message.
static String FullPath(const String &path)
Implements a generic, two-dimensional, shared or local image.
typename pixel_traits::sample sample
Generic vector of arbitrary length.
int Length() const noexcept
Normalization data parser and generator.
int ReferenceWidth() const
LocalNormalizationData(const LocalNormalizationData &)=default
void SetReferenceDimensions(int width, int height)
const normalization_matrices & ZeroOffset() const
void SetRelativeScaleFactors(const Vector &s)
void EnableCompression(bool enable=true)
void SetGlobalNormalizationParameters(const Vector &Rc, const Vector &Tc, const Vector &S)
XMLDocument * Serialize() const
void SetReferenceFilePath(const String &filePath)
int NormalizationScale() const
LocalNormalizationData(const XMLElement &element, bool ignoreNormalizationData=false)
const Vector & RelativeScaleFactors() const
void SetNormalizationScale(int scale)
int NumberOfChannels() const
void SetTargetFilePath(const String &filePath)
LocalNormalizationData()=default
void DisableCompression(bool disable=true)
const Vector & GlobalTargetLocation() const
void Parse(const XMLDocument &xml, bool ignoreNormalizationData=false)
void Parse(const XMLElement &element, bool ignoreNormalizationData=false)
void SetLocalNormalizationParameters(const normalization_matrices &A, const normalization_matrices &B, const Vector &C=Vector())
void InitInterpolations()
void SetVersion(int version)
const String & ReferenceFilePath() const
const normalization_matrices & Scale() const
const String & TargetFilePath() const
virtual ~LocalNormalizationData()
const Vector & GlobalScalingFactors() const
LocalNormalizationData(const String &filePath, bool ignoreNormalizationData=false)
void Parse(const String &filePath, bool ignoreNormalizationData=false)
LocalNormalizationData(LocalNormalizationData &&)=default
bool IsTaggedAsInvalid() const
TimePoint CreationTime() const
const Vector & Bias() const
double operator()(double z, int x, int y, int c=0) const
bool IsCompressionEnabled() const
normalization_matrices::sample normalization_coefficient
const Vector & GlobalReferenceLocation() const
LocalNormalizationData(const XMLDocument &xml, bool ignoreNormalizationData=false)
void SerializeToFile(const String &path) const
int ReferenceHeight() const
bool HasInterpolations() const
An instant in any timescale.
XML document parsing and generation