IMVBlobCounter2

The IMVBlobCounter2 interface extends the IMVBlobCounter interface.

Methods:

CalculateBlobProperties Calculate blob properties (position, angle, area, ...).
GetAngle Get the angle of the blob.
GetArea Get the contour area.
GetEnclosingCircle Get the enclosing circle (center + radius).
GetFittingEllipse Get the fitting elipse.
GetPerimeter Get the contour perimeter.
GetUprightBoundingRect Get the upright bounding rectangle.
GetXCenterOfMass Get the horizontal center of mass.
GetYCenterOfMass Get the vertical center of mass.
IsConvex Get the convexity flag (blob convex = TRUE, otherwise FALSE).

Header file: IMVBlobCounter.h
Interface definition language file: IMVBlobCounter.idl
Typelib: MVBlobCounter
Interface ID: IID_IMVBlobCounter2


Property IMVBlobCounter2::CalculateBlobProperties

Declaration: Property Get/Put CalculateBlobProperties As Boolean

Calculate blob properties (position, angle, area, ...). TRUE enables the calculation.

C Prototype:

HRESULT put_CalculateBlobProperties(VARIANT_BOOL newVal);
HRESULT get_CalculateBlobProperties(VARIANT_BOOL *pVal);


Method IMVBlobCounter2::GetAngle

Declaration: Function GetAngle(iBlob As Long) As Double

Get the angle of the blob in degrees.

Parameter:

iBlob The index of the blob.
C Prototype:

HRESULT GetAngle(LONG iBlob, DOUBLE* value);


Method IMVBlobCounter2::GetArea

Declaration: Function GetArea(iBlob As Long) As Double

Get the contour area.

Parameter:

iBlob The index of the blob.
C Prototype:

HRESULT GetArea(LONG iBlob, DOUBLE* value);


Method IMVBlobCounter2::GetEnclosingCircle

Declaration: Sub GetEnclosingCircle(iBlob As Long, CenterX As Double, CenterY As Double, Radius As Double)

Get the enclosing circle (center + radius).

Parameter:

iBlob The index of the blob.
CenterX Horizontal center of the circle.
CenterY Vertical center of the circle.
Radius Radius of the circle.
C Prototype:

HRESULT GetEnclosingCircle(LONG iBlob, DOUBLE CenterX, DOUBLE CenterY, DOUBLE Radius);


Method IMVBlobCounter2::GetFittingEllipse

Declaration: Sub GetFittingEllipse(iBlob As Long, CenterX As Double, CenterY As Double, MajorAxis As Double, MinorAxis As Double, Angle As Double)

Get the fitting elipse.

Parameter:

iBlob The index of the blob.
CenterX Horizontal center of the ellipse.
CenterY Vertical center of the ellipse.
MajorAxis Length of the major axis.
MinorAxis Length of the minor axis.
Angle Angle of the ellipse.
C Prototype:

HRESULT GetFittingEllipse(LONG iBlob, DOUBLE CenterX, DOUBLE CenterY, DOUBLE MajorAxis, DOUBLE MinorAxis, DOUBLE Angle);


Method IMVBlobCounter2::GetPerimeter

Declaration: Function GetPerimeter(iBlob As Long) As Double

Get the contour perimeter.

Parameter:

iBlob The index of the blob.
C Prototype:

HRESULT GetPerimeter(LONG iBlob, DOUBLE* value);


Method IMVBlobCounter2::GetUprightBoundingRect

Declaration: Sub GetUprightBoundingRect(iBlob As Long, xOffset As Double, yOffset As Double, Width As Double, Height As Double)

Get the upright bounding rectangle.

Parameter:

iBlob The index of the blob.
xOffset Horizontal offset of the rectangle.
yOffset Vertical offset of the rectangle.
Width Width of the rectangle.
Height Height of the rectangle.
C Prototype:

HRESULT GetUprightBoundingRect(LONG iBlob, DOUBLE xOffset, DOUBLE yOffset, DOUBLE Width, DOUBLE Height);


Method IMVBlobCounter2::GetXCenterOfMass

Declaration: Function GetXCenterOfMass(iBlob As Long) As Double

Get the horizontal center of mass.

Parameter:

iBlob The index of the blob.
C Prototype:

HRESULT GetXCenterOfMass(LONG iBlob, DOUBLE* value);


Method IMVBlobCounter2::GetYCenterOfMass

Declaration: Function GetYCenterOfMass(iBlob As Long) As Double

Get the vertical center of mass.

Parameter:

iBlob The index of the blob.
C Prototype:

HRESULT GetYCenterOfMass(LONG iBlob, DOUBLE* value);


Method IMVBlobCounter2::IsConvex

Declaration: Function IsConvex(iBlob As Long) As Boolean

Get the convexity flag (blob convex = TRUE, otherwise FALSE).

Parameter:

iBlob The index of the blob.
C Prototype:

HRESULT IsConvex(LONG iBlob, VARIANT_BOOL* value);