Blob (CVCBlob.dll) 14.1
Initialisation

Functions

void * BlobCreate (IMG Image, cvbdim_t lPlane)
 This function creates and initialises a Blob object. More...
 
void BlobDestroy (PBLOB BlobHandle)
 This function frees a Blob object. More...
 
cvbres_t BlobGetBlobSize (PBLOB BlobHandle, cvbval_t BlobNum, intptr_t &lSize)
 This function returns the size (area) of the blob in pixels. More...
 
cvbres_t BlobGetMaxMemory (PBLOB BlobHandle, cvbuint32_t &lNumBlobs, cvbuint32_t &lNumHoles, cvbuint32_t &SwObjects, cvbuint32_t &SwHoles)
 This function reads the size of internal tables. More...
 
cvbres_t BlobGetMaxMemoryEx (PBLOB BlobHandle, cvbuint32_t &dwNumObjects, cvbuint32_t &dwNumStreaks)
 This function reads the size of internal tables. More...
 
cvbres_t BlobGetMaxNumBlobs (PBLOB BlobHandle, cvbval_t &NumBlobs, cvbval_t &NumHoles, cvbval_t &SwObjects, cvbval_t &SwHoles)
 This function reads the size of internal tables. More...
 
cvbres_t BlobGetNumFeret (PBLOB BlobHandle, cvbval_t &NumFeret)
 This function reads the number of points on the convex projection. More...
 
cvbres_t BlobGetNumFeretEx (PBLOB BlobHandle, cvbval_t &NumFeret)
 This function reads the number of points on the convex projection (where BlobGetNumFeret reads the number of points of a convex projection). More...
 
cvbres_t BlobGetSize (PBLOB BlobHandle, cvbval_t BlobNum, intptr_t &lSize)
 This function returns the size of a found blob in pixels. More...
 
cvbbool_t BlobIsBlob (PBLOB BlobHandle)
 This function checks whether a blob handle is a valid handle for a blob object. More...
 
cvbres_t BlobReset (PBLOB BlobHandle)
 This function has to be used to reset the Blob object if a memory overflow occurs. More...
 
cvbres_t BlobSetArea (PBLOB BlobHandle, cvbval_t lPlane, cvbdim_t Left, cvbdim_t Top, cvbdim_t Right, cvbdim_t Bottom)
 This function defines an area of interest for the Blob object. More...
 
cvbres_t BlobSetExtractionMode (void *BlobHandle, cvbdim_t lValue)
 This function sets the extraction mode. More...
 
cvbres_t BlobSetImage (void *BlobHandle, IMG Image, cvbdim_t lPlane)
 This function passes a new image to a Blob object without the internal tables in the blob object having to be rebuilt. More...
 
cvbres_t BlobSetMaxMemory (void *BlobHandle, cvbval_t lNumBlobs, cvbval_t lNumHoles, cvbval_t SwObjects, cvbval_t SwHoles)
 Each blob tool has to create internal tables to store the data. If the default table size is inadequate you can use this function to allocate more memory. More...
 
cvbres_t BlobSetMaxMemoryEx (void *BlobHandle, cvbval_t lNumObjects, cvbval_t lNumStreaks)
 This function sets the size of internal tables. More...
 
cvbres_t BlobSetNumBlobs (void *BlobHandle, cvbval_t llastentry)
 This function defines the number of blobs to be found. More...
 
cvbres_t BlobSetNumFeret (void *BlobHandle, cvbdim_t lValue)
 This function defines the number of convex projections. More...
 
cvbres_t BlobSetObjectFeature (void *BlobHandle, cvbval_t lThreshold, cvbval_t lFeature)
 This function defines a threshold that is used for transformation to a binary image (also see BlobSetObjectFeatureRange). More...
 
cvbres_t BlobSetObjectFeatureRange (void *BlobHandle, cvbval_t lFeatureMin, cvbval_t lFeatureMax)
 This function defines the grey value range that is used for binarizing. More...
 
cvbres_t BlobSetSortMode (void *BlobHandle, cvbval_t lMode, cvbdim_t lx, cvbdim_t ly, cvbdim_t lLastEntry, cvbdim_t lSortOrder)
 This function specifies how objects can be sorted using various criteria after extraction. More...
 
cvbres_t BlobSetSortParameter (void *BlobHandle, cvbval_t lMode, cvbdim_t lx, cvbdim_t ly, cvbval_t lSortOrder)
 This function sets the parameters for sorting the blobs. More...
 

Detailed Description

Function Documentation

◆ BlobCreate()

void * BlobCreate ( IMG  Image,
cvbdim_t  lPlane 
)

This function creates and initialises a Blob object.

Attention
For every object that has been created with BlobCreate it is necessary to call the BlobDestroy function at the end.
Parameters
[in]ImageHandle to the source image.
[in]lPlaneNumber of plane to be used.
Returns
Handle to the Blob object created, if the function is successful. If the function fails, the return value is a NULL pointer.
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Blob Detection Example
Visual Basic - VB Blob Detection Example
Visual C++ - VC Blob Example

◆ BlobDestroy()

void BlobDestroy ( PBLOB  BlobHandle)

This function frees a Blob object.

Attention
This function has to be called for every object that has been created with BlobCreate.
Parameters
[in]BlobHandleHandle to the Blob object.
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Blob Detection Example
Visual Basic - VB Blob Detection Example
Visual C++ - VC Blob Example

◆ BlobGetBlobSize()

cvbres_t BlobGetBlobSize ( PBLOB  BlobHandle,
cvbval_t  BlobNum,
intptr_t &  lSize 
)

This function returns the size (area) of the blob in pixels.

Attention
This function is deprecated since Blob 2.0. Use instead the function BlobGetSize.
Parameters
[in]BlobHandleHandle to the Blob object.
[in]BlobNumNumber of the object.
[out]lSizeArea (number of pixels) of the blob in pixels.
Returns
CVC_E_OK on success, otherwise if an error occurs this function returns either CVC_E_PARAMETER or CVC_BLOB_E_INVALID_DATA.
Supported platforms:
Win32
Win64
Examples:
Visual C++ - VC Blob Example

◆ BlobGetMaxMemory()

cvbres_t BlobGetMaxMemory ( PBLOB  BlobHandle,
cvbuint32_t &  lNumBlobs,
cvbuint32_t &  lNumHoles,
cvbuint32_t &  SwObjects,
cvbuint32_t &  SwHoles 
)

This function reads the size of internal tables.

Attention
The corresponding function in CVC Blob 1.0 was named BlobGetMaxNumBlobs.
Parameters
[in]BlobHandleHandle to the Blob object.
[out]lNumBlobsMaximum number of objects in the image, respectively, AOI.
[out]lNumHolesMaximum number of holes in the image.
[out]SwObjectsMaximum number of streaks in a row.
[out]SwHolesMaximum number of holes in an object.
Returns
>= 0 on success,
< 0 if an error occurs.
Supported platforms:
Win32
Win64

◆ BlobGetMaxMemoryEx()

cvbres_t BlobGetMaxMemoryEx ( PBLOB  BlobHandle,
cvbuint32_t &  dwNumObjects,
cvbuint32_t &  dwNumStreaks 
)

This function reads the size of internal tables.

Attention
The corresponding function in CVC Blob 3.0 was named BlobGetMaxMemory.
Parameters
[in]BlobHandleHandle to the Blob object.
[out]dwNumObjectsMaximum number of objects (Blobs AND Holes) in the image, respectively, AOI.
[out]dwNumStreaksMaximum number of streaks stored during execution. See BlobSetExtractionMode with the option CVC_BLOB_EXTRACT_PIXDATA.
Returns
>= 0 on success,
< 0 if an error occurs.
Supported platforms:
Win32
Win64

◆ BlobGetMaxNumBlobs()

cvbres_t BlobGetMaxNumBlobs ( PBLOB  BlobHandle,
cvbval_t &  NumBlobs,
cvbval_t &  NumHoles,
cvbval_t &  SwObjects,
cvbval_t &  SwHoles 
)

This function reads the size of internal tables.

Attention
This function is obsolete since Blob 2.0. See BlobGetMaxMemory.
Parameters
[in]BlobHandleHandle to the Blob object.
[out]NumBlobsMaximum number of objects in the image, respectively, AOI.
[out]NumHolesMaximum number of holes in the image.
[out]SwObjectsMaximum number of streaks in a row.
[out]SwHolesMaximum number of holes in an object.
Returns
CVC_E_OK on success, otherwise CVC_E_PARAMETER for invalid function parameters.
Supported platforms:
Win32

◆ BlobGetNumFeret()

cvbres_t BlobGetNumFeret ( PBLOB  BlobHandle,
cvbval_t &  NumFeret 
)

This function reads the number of points on the convex projection.

Parameters
[in]BlobHandleHandle to the Blob object.
[out]NumFeretNumber of points calculated for the convex perimeter (see convex shape and convex perimeter). When the BlobGetConvexPoints function is called, arrays of sufficient size must be available. This size depends directly on the BlobSetNumFeret function. BlobSetNumFeret specifies the number of projections, and BlobGetNumFeret returns the number of points on the perimeter.
Returns
CVC_E_OK on success, otherwise if an error occurs the function returns either CVC_E_PARAMETER or CVC_BLOB_E_INVALID_DATA.
Supported platforms:
Win32
Win64
Examples:
Visual C++ - VC Blob Example

◆ BlobGetNumFeretEx()

cvbres_t BlobGetNumFeretEx ( PBLOB  BlobHandle,
cvbval_t &  NumFeret 
)

This function reads the number of points on the convex projection (where BlobGetNumFeret reads the number of points of a convex projection).

This number is further on needed to access the information of the projections (see BlobGetFeretDiam..... functions).

Attention
This function is new since Blob 4.0.
Parameters
[in]BlobHandleHandle to the Blob object.
[out]NumFeretNumber of convex projections (see convex shape and convex perimeter).
Returns
CVC_E_OK on success, otherwise if an error occurs the function returns either CVC_E_PARAMETER or CVC_BLOB_E_INVALID_DATA.
Supported platforms:
Win32
Win64
Examples:
Visual C++ - VC Blob Example

◆ BlobGetSize()

cvbres_t BlobGetSize ( PBLOB  BlobHandle,
cvbval_t  BlobNum,
intptr_t &  lSize 
)

This function returns the size of a found blob in pixels.

This function replaces the #BlobGetBlobSize function from version 1.0.
Parameters
[in]BlobHandleHandle to the Blob object.
[in]BlobNumNumber of the blob.
[out]lSizeSize of the blob in pixels.
Returns
>= 0 on success,
< 0 if an error occurs.
Supported platforms:
Win32
Win64
Related Topics:
Area of a Blob.

◆ BlobIsBlob()

cvbbool_t BlobIsBlob ( PBLOB  BlobHandle)

This function checks whether a blob handle is a valid handle for a blob object.

Parameters
[in]BlobHandleHandle to the Blob object.
Returns
TRUE on success, FALSE otherwise.
Supported platforms:
Win32
Win64
Examples:
Visual C++ - VC Blob Example

◆ BlobReset()

cvbres_t BlobReset ( PBLOB  BlobHandle)

This function has to be used to reset the Blob object if a memory overflow occurs.

In normal circumstances this function will only be called internally.
Parameters
[in]BlobHandleHandle to the Blob object.
Returns
CVC_E_OK on success, otherwise if an error occurs this function returns either CVC_E_PARAMETER or CVC_E_MEMORY_ALLOCATION.
Supported platforms:
Win32
Win64

◆ BlobSetArea()

cvbres_t BlobSetArea ( PBLOB  BlobHandle,
cvbval_t  lPlane,
cvbdim_t  Left,
cvbdim_t  Top,
cvbdim_t  Right,
cvbdim_t  Bottom 
)

This function defines an area of interest for the Blob object.

Attention
The AOI is displayed (after using BlobBinariseImage) in the binarized result image at the image origin 0,0.
Parameters
[in]BlobHandleHandle to the Blob object.
[in]lPlanePlane index to be processed.
[in]LeftLeft coordinate (first column) of the area of interest.
[in]TopTop coordinate (first row) of the area of interest.
[in]RightRight coordinate (last column)of the area of interest.
[in]BottomBottom coordinate (last row)of the area of interest.
Returns
CVC_E_OK on success, otherwise if an error occurs this function returns CVC_E_PARAMETER.
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Blob Detection Example
Visual Basic - VB Blob Detection Example
Visual C++ - VC Blob Example

◆ BlobSetExtractionMode()

cvbres_t BlobSetExtractionMode ( void *  BlobHandle,
cvbdim_t  lValue 
)

This function sets the extraction mode.

For reasons of speed, it is possible to set different extraction modes so that unnecessary parameters are not calculated. 
Parameters
[in]BlobHandleHandle to the Blob object.
[in]lValueExtraction mode. Following extraction modes are possible:
CVC_BLOB_EXTRACT_SIZE,
CVC_BLOB_EXTRACT_PERIMETER,
CVC_BLOB_EXTRACT_PIXDATA,
CVC_BLOB_EXTRACT_CONVEX,
CVC_BLOB_EXTRACT_CENTER,
CVC_BLOB_EXTRACT_MOMENTS,
CVC_BLOB_EXTRACT_BBOX,
CVC_BLOB_EXTRACT_MEASUREMENT,
CVC_BLOB_EXTRACT_ALL,
CVC_BLOB_EXTRACT_NONE
Returns
CVC_E_OK on success, otherwise if an error occurs this function returns CVC_E_PARAMETER.
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Blob Detection Example
Visual Basic - VB Blob Detection Example
Visual C++ - VC Blob Example

◆ BlobSetImage()

cvbres_t BlobSetImage ( void *  BlobHandle,
IMG  Image,
cvbdim_t  lPlane 
)

This function passes a new image to a Blob object without the internal tables in the blob object having to be rebuilt.

Attention
From Blob version 4.0 on are also 8+ bit images (10,12 or 16 bit) images supported.
Parameters
[in]BlobHandleHandle to the Blob object.
[in]ImageHandle to the new source image.
[in]lPlanePlane index to be processed.
Returns
>= 0 on success,
< 0 if an error occurs.
Supported platforms:
Win32
Win64
Examples:
Visual Basic - VB Blob Detection Example
Visual C++ - VC Blob Example

◆ BlobSetMaxMemory()

cvbres_t BlobSetMaxMemory ( void *  BlobHandle,
cvbval_t  lNumBlobs,
cvbval_t  lNumHoles,
cvbval_t  SwObjects,
cvbval_t  SwHoles 
)

Each blob tool has to create internal tables to store the data. If the default table size is inadequate you can use this function to allocate more memory.

Attention
This function is deprecated in Blob 4.0. See new function BlobSetMaxMemoryEx.
Parameters
[in]BlobHandleHandle to the Blob object.
[in]lNumBlobsMaximum number of objects in the image, respectively, AOI. Default = 500.
[in]lNumHolesMaximum number of holes in the image. Default = 500.
[in]SwObjectsMaximum number of streaks in a row (max = (dx /2)+1). Default = 3000.
[in]SwHolesMaximum number of holes in an object (m = (dx/2+1)*(dy/2+1)). Default = 3000.
Returns
>= 0 on success,
< 0 if an error occurs.
Supported platforms:
Win32
Win64

◆ BlobSetMaxMemoryEx()

cvbres_t BlobSetMaxMemoryEx ( void *  BlobHandle,
cvbval_t  lNumObjects,
cvbval_t  lNumStreaks 
)

This function sets the size of internal tables.

Attention
The corresponding function in Blob 3.0 was named BlobSetMaxMemory.
Parameters
[in]BlobHandleHandle to the Blob object.
[in]lNumObjectsMaximum number of objects (blobs and holes) in the image, respectively, AOI.
[in]lNumStreaksMaximum number of streaks stored during an execution. This Parameter is only relevant for the mode in which the streaks are stored with the objects. See BlobSetExtractionMode with CVC_BLOB_EXTRACT_PIXDATA. Otherwise the Parameter is ignored an set to zero.
Returns
>= 0 on success,
< 0 if an error occurs.
Supported platforms:
Win32
Win64

◆ BlobSetNumBlobs()

cvbres_t BlobSetNumBlobs ( void *  BlobHandle,
cvbval_t  llastentry 
)

This function defines the number of blobs to be found.

Parameters
[in]BlobHandleHandle to the Blob object.
[in]llastentryNumber of blobs to be found.
Returns
>= 0 on success,
< 0 if an error occurs.
Supported platforms:
Win32
Win64

◆ BlobSetNumFeret()

cvbres_t BlobSetNumFeret ( void *  BlobHandle,
cvbdim_t  lValue 
)

This function defines the number of convex projections.

Projections are applied to the object from the sides defined by \a lValue (see <i>convex shape and convex perimeter</i>). 
The more projections, the more precise the approximation to the perimeter. The four basic projections (0 degrees, 45 degrees, 
90 degrees, 135 degrees) are the default values. See also #BlobGetNumFeret.
Parameters
[in]BlobHandleHandle to the Blob object.
[in]lValueNumber of projections to calculate the convex perimeter.
BlobSetNumFeret specifies the number of projections, and BlobGetNumFeret returns the number of points on the perimeter. For example lValue is 4 returns 12 points on the convex perimeter shape.
Returns
CVC_E_OK on success, otherwise CVC_E_PARAMETER for invalid function parameters.
Supported platforms:
Win32
Win64

◆ BlobSetObjectFeature()

cvbres_t BlobSetObjectFeature ( void *  BlobHandle,
cvbval_t  lThreshold,
cvbval_t  lFeature 
)

This function defines a threshold that is used for transformation to a binary image (also see BlobSetObjectFeatureRange).

Parameters
[in]BlobHandleHandle to the Blob object.
[in]lThresholdThreshold for conversion to a binary image.
[in]lFeatureRange to be recognized as an object (blob). Possible values are:
CVC_BLOB_BLACK_TO_FEATURE or
CVC_BLOB_WHITE_TO_FEATURE
Returns
CVC_E_OK on success, otherwise CVC_E_PARAMETER for invalid function parameters.
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Blob Detection Example
Visual Basic - VB Blob Detection Example
Visual C++ - VC Blob Example

◆ BlobSetObjectFeatureRange()

cvbres_t BlobSetObjectFeatureRange ( void *  BlobHandle,
cvbval_t  lFeatureMin,
cvbval_t  lFeatureMax 
)

This function defines the grey value range that is used for binarizing.

Parameters
[in]BlobHandleHandle to the Blob object.
[in]lFeatureMinMinimum grey value belonging to the object. Default = 128.
[in]lFeatureMaxMaximum grey value belonging to the object. Default = 255.
Returns
CVC_E_OK on success, otherwise CVC_E_PARAMETER for invalid function parameters.
Supported platforms:
Win32
Win64
Related Topics:
BlobSetObjectFeature and BlobGetObjectFeatureRange
Examples:
Visual Basic - VB Blob Detection Example
Visual C++ - VC Blob Example

◆ BlobSetSortMode()

cvbres_t BlobSetSortMode ( void *  BlobHandle,
cvbval_t  lMode,
cvbdim_t  lx,
cvbdim_t  ly,
cvbdim_t  lLastEntry,
cvbdim_t  lSortOrder 
)

This function specifies how objects can be sorted using various criteria after extraction.

Even if the blobs are not sorted, the Blob tool returns up to as many blobs as are specified with \a lLastEntry .
Parameters
[in]BlobHandleHandle to the Blob object.
[in]lModeSort mode to be used. Following sort modes are possible:
CVC_BLOB_SORT_UNSORTED,
CVC_BLOB_SORT_SIZE,
CVC_BLOB_SORT_POSX,
CVC_BLOB_SORT_POSY,
CVC_BLOB_SORT_DISTANCE
[in]lxIf CVC_BLOB_SORT_DISTANCE is selected, this value defines the x coordinate for which the distance is calculated.
[in]lyIf CVC_BLOB_SORT_DISTANCE is selected, this value defines the y coordinate for which the distance is calculated.
[in]lLastEntryNumber of blobs to be sorted.
[in]lSortOrderSort order. Possible values are possible:
CVC_BLOB_SORT_RISING: descending order,
CVC_BLOB_SORT_FALLING: ascending order

Attention: The Sort-order constants are wrong. Due to compatibility reasons we did not change it.
Returns
CVC_E_OK on success, otherwise CVC_E_PARAMETER for invalid function parameters.
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Blob Detection Example
Visual Basic - VB Blob Detection Example

◆ BlobSetSortParameter()

cvbres_t BlobSetSortParameter ( void *  BlobHandle,
cvbval_t  lMode,
cvbdim_t  lx,
cvbdim_t  ly,
cvbval_t  lSortOrder 
)

This function sets the parameters for sorting the blobs.

Parameters
[in]BlobHandleHandle to the Blob object.
[in]lModeSort mode to be used. Following sort modes are possible:
CVC_BLOB_SORT_UNSORTED,
CVC_BLOB_SORT_SIZE,
CVC_BLOB_SORT_POSX,
CVC_BLOB_SORT_POSY,
CVC_BLOB_SORT_DISTANCE
[in]lxIf CVC_BLOB_SORT_DISTANCE is selected, this value defines the x coordinate for which the distance is calculated.
[in]lyIf CVC_BLOB_SORT_DISTANCE is selected, this value defines the y coordinate for which the distance is calculated.
[in]lSortOrderSort order. Possible values are possible:
CVC_BLOB_SORT_RISING: descending order,
CVC_BLOB_SORT_FALLING: ascending order

Attention: The Sort-order constants are wrong. Due to compatibility reasons we did not change it.
Returns
>= 0 on success,
< 0 if an error occurs.
Supported platforms:
Win32
Win64