This interface holds single blob and provide functionalities of blob calculation, conversion and drawing. More...
Public Member Functions | |
void | AttachImage (ILImage *image) |
int | CountContour () |
int | CountHole () |
void | Draw (HDC hdc, LPVBlobDrawFlags drawFlags, double zoomX, double zoomY, double panX, double panY) |
ILBlob * | Expand (int delta) |
void | ExpandTo (int delta) |
void | FromRegion (ILRegion *region, ILImage *image) |
double | GetAngle (BOOL alwaysUp) |
ILPoint * | GetCenter () |
ILPolygon * | GetContour (int index) |
double | GetContrast (LPVAggregation aggType, double percentage) |
ILPolygon * | GetConvexHull () |
double | GetFeature (LPVBlobFeatures feature) |
ILPolygon * | GetHole (int index) |
double | GetLuminance (LPVAggregation aggType, double percentage) |
ILRect * | GetRect () |
ILRect * | GetRotRect () |
ILBlob * | Intersect (ILBlob *other) |
void | IntersectTo (ILBlob *other) |
ILBlob * | Shrink (int delta) |
void | ShrinkTo (int delta) |
ILBlob * | Subtract (ILBlob *other) |
void | SubtractTo (ILBlob *other) |
ILMaskRegion * | ToRegion () |
ILBlob * | Union (ILBlob *other) |
void | UnionTo (ILBlob *other) |
ILBlob * | XOR (ILBlob *other) |
void | XORTo (ILBlob *other) |
Public Member Functions inherited from ILObject | |
ILObject * | Copy () |
LPVErrorCode | Load (LString filename) |
void | Reset () |
LPVErrorCode | Save (LString filename) |
BOOL | Valid () |
Additional Inherited Members | |
Properties inherited from ILObject | |
LString | Name [get, set] |
Name of the object. By default, the object has no name. In most cases, LPV classes don't make use of the names. The name is drawn on canvas around the object if ILDrawable::SetDrawName() is enabled. More... | |
This interface holds single blob and provide functionalities of blob calculation, conversion and drawing.
Usually you get the LBlob object from the ILBlobResults::Item() function. You can then use this interface to calculate the interested features, access to the detailed blob informations and draw the result on graphics windows.
void AttachImage | ( | ILImage * | image | ) |
Attach the input image to the blob, used for image-related feature calculation, such as luminance, contrast, sharpness, etc..
[in] | image | The input image |
int CountContour | ( | ) |
Get count of the external contours of the blob
int CountHole | ( | ) |
Get count of the external contours of the blob
void Draw | ( | HDC | hdc, |
LPVBlobDrawFlags | drawFlags, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw the blob onto provide device context.
[in] | drawFlags | Flags to control the blob drawing behavior, see LPVBlobDrawFlags for usage. |
ILBlob* Expand | ( | int | delta | ) |
Offset the blob to the outer to create a inflated new blob.
[in] | delta | The offset pixels |
newBlob | Return a new result blob. |
void ExpandTo | ( | int | delta | ) |
Offset the current blob to the outer to be inflated.
[in] | delta | The offset pixels |
Construct the blob object from a region object.
[in] | region | The input region object. |
[in] | image | The input image to be attached to the blob. It is used for image-related feature calculation, such as luminance, contrast, sharpness, etc.. Pass in null if you don't want do that. |
double GetAngle | ( | BOOL | alwaysUp | ) |
Get the angle of the blob. It's the same direction as the blob's rotate bounding rectangle's longer axis, in range of (-90, 90).
[in] | alwaysUp | If it's on, return the angle of the up axis, it could either the longer axis or the shorter axis. It is useful when the difference between axes is not notable, for example, it's a square object, but the rotation is slight. An always-up angle is in range of (-135, -45). |
val | Return the angle |
ILPoint* GetCenter | ( | ) |
Get the center of gravity of the blob.
ILPolygon* GetContour | ( | int | index | ) |
Fetch one external contour of the blob with given index.
[in] | index | The input index, it should be a 0-based number smaller than total count. |
val | Return the external contour as polygon |
double GetContrast | ( | LPVAggregation | aggType, |
double | percentage | ||
) |
Calculate the aggregated contrast feature of the blob, only available when an image is attached to the blob.
[in] | aggType | Aggregation type, see LPVAggregation for usage. |
[in] | percentage | Specify the top/bottom percentage of pixels used in aggregation. A positive value indicates the top X% pixels sorted by their contrast value descendingly, a negative value use the bottom X%. Pass in 0 to use all pixels. |
val | Return the aggregated contrast feature result. |
ILPolygon* GetConvexHull | ( | ) |
Get the bounding convex hull of the blob
double GetFeature | ( | LPVBlobFeatures | feature | ) |
Calculate the specified numeric feature of the blob.
[in] | feature | Specify the required feature, see LPVBlobFeatures. |
val | Return the feature result. |
ILPolygon* GetHole | ( | int | index | ) |
Fetch one hole of the blob with given index.
[in] | index | The input index, it should be a 0-based number smaller than total count. |
val | Return the hole contour as polygon |
double GetLuminance | ( | LPVAggregation | aggType, |
double | percentage | ||
) |
Calculate the aggregated luminance feature of the blob, only available when an image is attached to the blob.
[in] | aggType | Aggregation type, see LPVAggregation for usage. |
[in] | percentage | Specify the top/bottom percentage of pixels used in aggregation. A positive value indicates the top X% pixels sorted by their luminance value descendingly, a negative value use the bottom X%. Pass in 0 to use all pixels. |
val | Return the aggregated luminance feature result. |
ILRect* GetRect | ( | ) |
Get the bounding rectangle of the blob
ILRect* GetRotRect | ( | ) |
Get the rotated bounding rectangle of the blob
Intersect the current and provided blob, output a new one, \( P' = P \cap other \) .
Parts in both blobs are included. An empty blob intersects with any others result in an empty blob.
[in] | other | The blob to be intersected. |
newBlob | Return a new result blob. |
void IntersectTo | ( | ILBlob * | other | ) |
Intersect the current and provided blob, \( P = P \cap other \) .
Only the parts in both blobs are included. An empty blob intersects with any others result in an empty blob.
[in] | other | The blob to be intersected. |
ILBlob* Shrink | ( | int | delta | ) |
Offset the blob to the inner to create a deflated new blob.
[in] | delta | The offset pixels |
newBlob | Return a new result blob. |
void ShrinkTo | ( | int | delta | ) |
Offset the current blob to the inner to be deflated.
[in] | delta | The offset pixels |
Subtract the provided blob from the current blob, output a new one, \( P' = P - other \).
A blob subtract an empty blob results a copy of itself, an empty blob subtract a blob results the inversion of the later.
[in] | other | The blob to subtracted. |
newBlob | Return a new result blob. |
void SubtractTo | ( | ILBlob * | other | ) |
Subtract the provided blob from the current blob, \( P = P - other \).
A blob subtract an empty blob does nothing, an empty blob subtract a blob results the inversion of the later.
[in] | other | The blob to subtracted. |
ILMaskRegion* ToRegion | ( | ) |
Convert the blob object to a mask region object.
region | Return the result region object. |
Union the current and provided blob, output a new one, \( P' = P \cup other \) .
Parts in either blobs are all included. A blob unions an empty blob results a copy of itself.
[in] | other | The blob to be union-ed |
newBlob | Return a new result blob. |
void UnionTo | ( | ILBlob * | other | ) |
Union the provided blob to the current, \( P = P \cup other \) .
Same as AddTo(), parts in either blobs are all included. A blob unions an empty blob does nothing.
[in] | other | The blob to be union-ed |
Calculate the symmetric difference of the current and provided blob, output a new one, \( P' = P \oplus other \) .
The parts in and only in one of blobs are included. An empty blob XOR with any others result in an empty blob.
[in] | other | The blob to perform the XOR operation. |
newBlob | Return a new result blob. |
void XORTo | ( | ILBlob * | other | ) |
Calculate the symmetric difference of the current and provided blob, store the result in current blob object, \( P = P \oplus other \) .
The parts in and only in one of blobs are included. An empty blob XOR with any others result in an empty blob.
[in] | other | The blob to perform the XOR operation. |