FLImaging 6.5.16.1
FLImagingCLR::ImageProcessing::CMoment Class Reference

Class to find the moment for an image. More...

#include <Moment.h>

Inheritance diagram for FLImagingCLR::ImageProcessing::CMoment:
FLImagingCLR::ImageProcessing::CAlgorithmFeature_SR FLImagingCLR::Foundation::CAlgorithmFeatureBase FLImagingCLR::Foundation::CAlgorithmBase FLImagingCLR::Base::CFLBase

Classes

struct  SCentralMoment
 central moment structure More...
 
struct  SCentroid
 centroid moment structure More...
 
struct  SGeometricMoment
 geometric moment structure More...
 
struct  SHuMoment
 invariant moment structure More...
 
struct  SMoment
 moment structure More...
 
struct  SNormalizedCentralMoment
 normalized central moment structure More...
 
struct  SZernike
 

Public Member Functions

 CMoment ()
 
 CMoment (CMoment^ pMoment)
 
virtual ~CMoment ()
 
virtual CResultAssign (CMoment^ pAib)
 
virtual CResultEnableBinaryImage (bool bBinaryImage)
 
virtual bool IsBinaryImageEnabled ()
 
virtual CResultExecute () override
 
virtual CResultClear () override
 
virtual CResultEnableGeometricMoment (bool bCalc)
 
virtual bool IsGeometricMomentEnabled ()
 
virtual CResultEnableCentroidMoment (bool bCalc)
 
virtual bool IsCentroidMomentEnabled ()
 
virtual CResultEnableCentralMoment (bool bCalc)
 
virtual bool IsCentralMomentEnabled ()
 
virtual CResultEnableNormalizedCentralMoment (bool bCalc)
 
virtual bool IsNormalizedCentralMomentEnabled ()
 
virtual CResultEnableHuMoment (bool bCalc)
 
virtual bool IsHuMomentEnabled ()
 
virtual CResultClearZernike ()
 
virtual CResultAddZernike (int32_t i32N, int32_t i32M)
 
virtual CResultAddZernike (int32_t i32N, int32_t i32M, uint64_t u64ZernikeRadius, bool bInscribedCircle)
 
virtual CResultGetMoment (CLR_OUT CMoment::SMoment^% pMoments, int64_t i64Channel)
 
virtual CResultGetMoment (CLR_OUT CMoment::SMoment^% pMoments)
 
virtual int64_t GetZernikeCount ()
 
virtual CResultGetZernike (CLR_OUT CMoment::SZernike^% pZernike, int64_t i64Index, int64_t i64Channel)
 
virtual CResultGetZernike (CLR_OUT CMoment::SZernike^% pZernike, int64_t i64Index)
 
virtual CResultReportToCSV (Foundation::CReportDescriptor^ pWrd) override
 The execution result of the algorithm is recorded in a file according to the options recorded in the ReportDescriptor object. Not all algorithms support this function. If not supported, return EResult.DidNotImplement.
 
virtual CResultReportToCSV (ImageProcessing::CReportDescriptorForMoment^ pWrd)
 
- Public Member Functions inherited from FLImagingCLR::ImageProcessing::CAlgorithmFeature_SR
virtual CResultAssign (CAlgorithmFeature_SR^ pAib)
 
virtual CResultSetSourceROI (Foundation::CFLFigure^ pFlfSourceROI)
 
virtual Foundation::CFLFigureGetSourceROI ()
 
- Public Member Functions inherited from FLImagingCLR::Foundation::CAlgorithmFeatureBase
virtual ~CAlgorithmFeatureBase ()
 
virtual CResultSetSourceImage (Base::CFLImage^% pFliSource)
 
virtual Base::CFLImageGetSourceImage ()
 
virtual void SetROIUtilities (CROIUtilities^ pROIUtilities)
 
virtual void SetROIUtilities (CAlgorithmFeatureBase^ pAlgorithmFeatureBase)
 
virtual CROIUtilitiesGetROIUtilities ()
 
virtual CResultAssign (CAlgorithmFeatureBase^ pAlgorithmFeatureBase)
 
virtual double GetLastExecutionTimeInMilliSecond ()
 
virtual double GetLastExecutionTimeInMicroSecond ()
 
virtual CResultEnableThreadSynchronization (bool bEnable)
 
virtual bool IsThreadSynchronizationEnabled ()
 
virtual CResultEnableImageFigureTransformation (bool bEnable)
 
virtual bool IsImageFigureTransformationEnabled ()
 
virtual int64_t GetRequiredGPUMemory () override
 
virtual bool IsLicenseAvailable ()
 Returns whether the license is available.
 
- Public Member Functions inherited from FLImagingCLR::Foundation::CAlgorithmBase
virtual ~CAlgorithmBase ()
 
virtual CResultAssign (CAlgorithmBase^ pPufb)
 
virtual EProcessingUnitFeatures GetOptimalProcessingUnit ()
 
virtual int32_t GetOptimalThreadCount ()
 
- Public Member Functions inherited from FLImagingCLR::Base::CFLBase
virtual ~CFLBase ()
 Destructor.
 
 !CFLBase ()
 Destructor.
 
virtual CProcessingUnitBaseGetProcessingUnit ()
 Returns the set ProcessingUnit.
 
virtual CResultSetProcessingUnit (CProcessingUnitBase^ pPub)
 set the ProcessingUnit
 
virtual void ResetProcessingUnit ()
 Rest the ProcessingUnit.
 
virtual bool IsValid ()
 Validate the object.
 
virtual void OnReceiveBroadcast (CBroadcastMessage^ pMessage)
 Callback function. A function that receives a BroadcastMessage.
 
void Lock ()
 Set a lock on an object.
 
bool TryLock ()
 Try to lock the object.
 
void Unlock ()
 Unlock the object.
 
virtual CFLBaseDuplicateObject ()
 Duplicate an object identical to itself.
 
virtual CFLBaseCreateNewObject ()
 Creating an object of the same type as oneself.
 

Static Public Member Functions

static CResultGetContoursMatchL1 (CMoment::SHuMoment^ pSHuMoment1, CMoment::SHuMoment^ pSHuMoment2, CLR_OUT double% f64Result)
 
static CResultGetContoursMatchL2 (CMoment::SHuMoment^ pSHuMoment1, CMoment::SHuMoment^ pSHuMoment2, CLR_OUT double% f64Result)
 
static CResultGetContoursMatchL3 (CMoment::SHuMoment^ pSHuMoment1, CMoment::SHuMoment^ pSHuMoment2, CLR_OUT double% f64Result)
 

Detailed Description

Class to find the moment for an image.

The algorithm can represent unique properties of objects, such as geometric features or specific weighted averages of the intensities of pixels in the source image.
There are six image moments supported: geometric moment, centroid moment, central moment, normalized central moment, invariant moment (or Hu moment), and Zernike moment.
In addition, it supports three contour matching values, L1, L2, and L3, which are numbers that can identify the shape relationship between two objects using invariant moments.
If you want to extract a geometrical feature of an object to obtain a moment value for a shape rather than a pixel value, set the binary property. there is.
The result can be obtained by executing the algorithm by setting the moments the user wants to find, and if there is a moment that must be calculated to obtain the set moment, it is calculated and returned.

Constructor & Destructor Documentation

◆ CMoment() [1/2]

FLImagingCLR::ImageProcessing::CMoment::CMoment ( )

Default constructor

◆ CMoment() [2/2]

FLImagingCLR::ImageProcessing::CMoment::CMoment ( CMoment^ pMoment)

Copy constructor by pointer

◆ ~CMoment()

virtual FLImagingCLR::ImageProcessing::CMoment::~CMoment ( )
virtual

Destructor

Member Function Documentation

◆ AddZernike() [1/2]

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::AddZernike ( int32_t i32N,
int32_t i32M )
virtual

Set the parameters of the Zernike Moment you want to calculate.

Parameters
[in]i32NZernike N
[in]i32MZernike M
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SZernike

If you want to get multiple Zernike Moments, they are added the AddZernike function is executed.

◆ AddZernike() [2/2]

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::AddZernike ( int32_t i32N,
int32_t i32M,
uint64_t u64ZernikeRadius,
bool bInscribedCircle )
virtual

Set the parameters of the Zernike Moment you want to calculate.

Parameters
[in]i32NZernike N
[in]i32MZernike M
[in]u64ZernikeRadiusZernike Radius
[in]bInscribedCircleWhether or not to use inscribed and circumscribed circles
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SZernike

If you want to get multiple Zernike Moments, they are added the AddZernike function is executed.

◆ Assign()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::Assign ( CMoment^ pAib)
virtual

Assign another CMoment object.

Parameters
[in]pAibPointer of CMoment
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult

◆ Clear()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::Clear ( )
overridevirtual

Initialize algorithm parameters.

Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult

Reimplemented from FLImagingCLR::ImageProcessing::CAlgorithmFeature_SR.

◆ ClearZernike()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::ClearZernike ( )
virtual

Clear the parameters of the set Zernike Moment.

Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult

◆ EnableBinaryImage()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::EnableBinaryImage ( bool bBinaryImage)
virtual

Set whether the source image is binarized.

Parameters
[in]bBinaryImageWhether the source image is binarized
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult

bBinaryImage = true : If the pixel value of the image is 0, it is regarded as 0, and if the pixel value of the image is not 0, the pixel value is regarded as 1.
bBinaryImage = false : The pixel values of the image are used as they are.

◆ EnableCentralMoment()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::EnableCentralMoment ( bool bCalc)
virtual

Set whether or not to calculate central moment.

Parameters
[in]bCalcwhether or not to calculate central moment
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult

◆ EnableCentroidMoment()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::EnableCentroidMoment ( bool bCalc)
virtual

Set whether or not to calculate centroid moment.

Parameters
[in]bCalcwhether or not to calculate centroid moment
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult

◆ EnableGeometricMoment()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::EnableGeometricMoment ( bool bCalc)
virtual

Set whether or not to calculate geometric moment.

Parameters
[in]bCalcwhether or not to calculate geometric moment
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult

◆ EnableHuMoment()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::EnableHuMoment ( bool bCalc)
virtual

Set whether to calculate the invariant moment.

Parameters
[in]bCalcwhether to calculate the invariant moment
Return values
FLImagingCLR::CResultInformation about execution results
See also
FLImagingCLR::CResult

◆ EnableNormalizedCentralMoment()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::EnableNormalizedCentralMoment ( bool bCalc)
virtual

Set whether or not to calculate the normalized central moment.

Parameters
[in]bCalcwhether or not to calculate the normalized central moment
Return values
FLImagingCLR::CResultInformation about execution results
See also
FLImagingCLR::CResult

◆ Execute()

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::Execute ( )
overridevirtual

Execute the Algorithm.

Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult

Reimplemented from FLImagingCLR::Foundation::CAlgorithmFeatureBase.

◆ GetContoursMatchL1()

static CResult ^ FLImagingCLR::ImageProcessing::CMoment::GetContoursMatchL1 ( CMoment::SHuMoment^ pSHuMoment1,
CMoment::SHuMoment^ pSHuMoment2,
CLR_OUT double% f64Result )
static

Get the L1 contour matching value using invariant moment.

Parameters
[in]pSHuMoment1precomputed constant moment
[in]pSHuMoment2precomputed constant moment
[out]f64ResultL1 value
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SHuMoment

◆ GetContoursMatchL2()

static CResult ^ FLImagingCLR::ImageProcessing::CMoment::GetContoursMatchL2 ( CMoment::SHuMoment^ pSHuMoment1,
CMoment::SHuMoment^ pSHuMoment2,
CLR_OUT double% f64Result )
static

Get the L2 contour matching value using invariant moment.

Parameters
[in]pSHuMoment1precomputed constant moment
[in]pSHuMoment2precomputed constant moment
[out]f64ResultL2 value
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SHuMoment

◆ GetContoursMatchL3()

static CResult ^ FLImagingCLR::ImageProcessing::CMoment::GetContoursMatchL3 ( CMoment::SHuMoment^ pSHuMoment1,
CMoment::SHuMoment^ pSHuMoment2,
CLR_OUT double% f64Result )
static

Get the L3 contour matching value using invariant moment.

Parameters
[in]pSHuMoment1precomputed constant moment
[in]pSHuMoment2precomputed constant moment
[out]f64ResultL3 value
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SHuMoment

◆ GetMoment() [1/2]

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::GetMoment ( CLR_OUT CMoment::SMoment^% pMoments)
virtual

Get the calculated moments.

Parameters
[out]pMomentscalculated moment
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SMoment

◆ GetMoment() [2/2]

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::GetMoment ( CLR_OUT CMoment::SMoment^% pMoments,
int64_t i64Channel )
virtual

Get the calculated moments.

Parameters
[out]pMomentscalculated moment
[in]i64Channelchannel
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SMoment

◆ GetZernike() [1/2]

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::GetZernike ( CLR_OUT CMoment::SZernike^% pZernike,
int64_t i64Index )
virtual

Get the calculated zernike moments.

Parameters
[out]pZernikecalculated zernike moments
[in]i64Indexindex
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SZernike

◆ GetZernike() [2/2]

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::GetZernike ( CLR_OUT CMoment::SZernike^% pZernike,
int64_t i64Index,
int64_t i64Channel )
virtual

Get the calculated zernike moments.

Parameters
[out]pZernikecalculated zernike moments
[in]i64Indexindex
[in]i64Channelchannel
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CMoment::SZernike

◆ GetZernikeCount()

virtual int64_t FLImagingCLR::ImageProcessing::CMoment::GetZernikeCount ( )
virtual

Get the total number of calculated zernike moments.

Return values
int64_tTotal number of calculated zernike moments
See also
FLImagingCLR::ImageProcessing::CMoment::SZernike

◆ IsBinaryImageEnabled()

virtual bool FLImagingCLR::ImageProcessing::CMoment::IsBinaryImageEnabled ( )
virtual

Get whether the source image is binarized.

Return values
boolWhether the source image is binarized

◆ IsCentralMomentEnabled()

virtual bool FLImagingCLR::ImageProcessing::CMoment::IsCentralMomentEnabled ( )
virtual

Get whether or not to calculate central moment.

Return values
boolwhether or not to calculate central moment

◆ IsCentroidMomentEnabled()

virtual bool FLImagingCLR::ImageProcessing::CMoment::IsCentroidMomentEnabled ( )
virtual

Get whether or not to calculate centroid moment.

Return values
boolwhether or not to calculate centroid moment

◆ IsGeometricMomentEnabled()

virtual bool FLImagingCLR::ImageProcessing::CMoment::IsGeometricMomentEnabled ( )
virtual

Get whether or not to calculate geometric moment.

Return values
boolwhether or not to calculate geometric moment

◆ IsHuMomentEnabled()

virtual bool FLImagingCLR::ImageProcessing::CMoment::IsHuMomentEnabled ( )
virtual

Get whether to calculate the invariant moment.

Return values
boolwhether to calculate the invariant moment

◆ IsNormalizedCentralMomentEnabled()

virtual bool FLImagingCLR::ImageProcessing::CMoment::IsNormalizedCentralMomentEnabled ( )
virtual

Get whether or not to calculate the normalized central moment.

Return values
boolwhether or not to calculate the normalized central moment

◆ ReportToCSV() [1/2]

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::ReportToCSV ( Foundation::CReportDescriptor^ pWrd)
overridevirtual

The execution result of the algorithm is recorded in a file according to the options recorded in the ReportDescriptor object. Not all algorithms support this function. If not supported, return EResult.DidNotImplement.

Parameters
[in]pWrdReportDescriptor object
Return values
FLImagingCLR::CResult^Information about execution results
See also
FLImagingCLR::CResult
FLImagingCLR::Foundation::CReportDescriptor

Reimplemented from FLImagingCLR::Foundation::CAlgorithmFeatureBase.

◆ ReportToCSV() [2/2]

virtual CResult ^ FLImagingCLR::ImageProcessing::CMoment::ReportToCSV ( ImageProcessing::CReportDescriptorForMoment^ pWrd)
virtual

The execution result of the algorithm is written to a file according to the options recorded in the CReportDescriptorForMoment object. Not all algorithms support this function. If not supported, return EResult.DidNotImplement.

Parameters
[in]pWrdReportDescriptor object
Return values
FLImagingCLR::CResult^Function execution result (return EResult.OK on success)
See also
FLImagingCLR::CResult
FLImagingCLR::ImageProcessing::CReportDescriptorForMoment