SB SDK 1.11
Blob

Blob analysis. More...

Collaboration diagram for Blob:

Data Structures

struct  sb_t_blob_par
 Defines the parameters for blob analysis. More...
 
struct  sb_t_blobs_info
 Defines the information about the blob analysis. More...
 
struct  sb_t_blob
 Defines a blob. More...
 
struct  sb_t_blobs
 Defines a blobs list. More...
 

Enumerations

enum  sb_t_pixel_connection { SB_PIXEL_CONNECTION_4 = 0 , SB_PIXEL_CONNECTION_8 }
 Defines the pixel connection. More...
 
enum  sb_t_blob_deleted { SB_BLOB_OK = 0 , SB_BLOB_DELETED_BEFORE_MERGE , SB_BLOB_DELETED_AFTER_MERGE , SB_BLOB_DELETED_CIRCULAR }
 Defines the deleted blob. More...
 

Functions

sb_t_err sb_blobs_create (sb_t_blobs **const blobs)
 Creates the blobs structure. More...
 
sb_t_err sb_blob_init_par (sb_t_blob_par *const par)
 Initializes the fields of the structure. More...
 
sb_t_err sb_blob_format_par (const sb_t_blob_par *const par, char *const str, int str_size)
 Formats the blob analysis parameters structure. More...
 
sb_t_err sb_blobs_detection (sb_t_blobs **const blobs, const sb_t_image *const image, const sb_t_roi *const roi, const sb_t_blob_par *const par)
 Blob analysis. More...
 
sb_t_err sb_blob_intersect (const sb_t_blob *const blob1, const sb_t_blob *const blob2, int extract_blob_seg, sb_t_blob **const res)
 Blob intersection. More...
 
sb_t_err sb_blobs_plot_roi (const sb_t_blobs *const blobs, sb_t_roi *const roi, unsigned char gl)
 Prints the blobs on the roi. More...
 
sb_t_err sb_blob_plot_roi (const sb_t_blob *const blob, sb_t_roi *const roi, unsigned char gl)
 Prints the blob on the roi. More...
 
sb_t_err sb_blobs_clone (sb_t_blobs **const dst, const sb_t_blobs *const src)
 Blobs structure clone. More...
 
sb_t_err sb_blobs_destroy (sb_t_blobs **const blobs)
 Destroys the blobs structure. More...
 
sb_t_err sb_blob_destroy (sb_t_blob *const blob)
 Destroys the blob. More...
 
sb_t_err sb_blob_copy (sb_t_blob *const dst, const sb_t_blob *const src)
 Blob copy. More...
 

Detailed Description

Blob analysis.

Enumeration Type Documentation

◆ sb_t_blob_deleted

Defines the deleted blob.

The values are 32 bits both for 32 and 64 bits library version.

Enumerator
SB_BLOB_OK 

Blob is not deleted.

SB_BLOB_DELETED_BEFORE_MERGE 

Blob is deleted before merge.

SB_BLOB_DELETED_AFTER_MERGE 

Blob is deleted after merge.

SB_BLOB_DELETED_CIRCULAR 

Blob is deleted because of circular images.

Definition at line 7915 of file sb.h.

◆ sb_t_pixel_connection

Defines the pixel connection.

The values are 32 bits both for 32 and 64 bits library version.

Enumerator
SB_PIXEL_CONNECTION_4 

4 connection.

4-connected pixels are neighbors to every pixel that touches one of their edges. These pixels are connected horizontally and vertically. In terms of pixel coordinates, every pixel that has the coordinates (x+1,y), (x-1,y), (x,y+1), (x,y-1) is connected to the pixel at (x,y).

SB_PIXEL_CONNECTION_8 

8 connection. 8-connected pixels are neighbors to every pixel that touches one of their edges or corners. These pixels are connected horizontally, vertically, and diagonally. In addition to 4-connected pixels, each pixel with coordinates (x+1,y), (x+1,y+1), (x,y+1), (x-1,y+1) (x-1,y), (x-1,y-1), (x,y-1), (x+1,y-1) is connected to the pixel at (x,y).

Definition at line 7822 of file sb.h.

Function Documentation

◆ sb_blob_copy()

sb_t_err sb_blob_copy ( sb_t_blob *const  dst,
const sb_t_blob *const  src 
)

Blob copy.

The function creates a copy of the blob src into the blob dst.

Parameters
[out]dstDestination blob.
[in]srcSource blob.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.

◆ sb_blob_destroy()

sb_t_err sb_blob_destroy ( sb_t_blob *const  blob)

Destroys the blob.

The function resets the structure.

Parameters
blob[in,out] pointer to the blob
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.*

◆ sb_blob_format_par()

sb_t_err sb_blob_format_par ( const sb_t_blob_par *const  par,
char *const  str,
int  str_size 
)

Formats the blob analysis parameters structure.

Interprets the contents of par and converts it to a C-string containing a human-readable version of the corresponding structure.

Parameters
[in]parPointer to the blob analysis parameters structure.
[out]strPointer to the string.
On successful return, this parameter will be filled with a human-readable version of the blob analysis parameters structure.
[in]str_sizeNumber of bytes of the string str.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.

◆ sb_blob_init_par()

sb_t_err sb_blob_init_par ( sb_t_blob_par *const  par)

Initializes the fields of the structure.

Parameters
[out]parPointer to the blob analysis parameters structure.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.

◆ sb_blob_intersect()

sb_t_err sb_blob_intersect ( const sb_t_blob *const  blob1,
const sb_t_blob *const  blob2,
int  extract_blob_seg,
sb_t_blob **const  res 
)

Blob intersection.

The function extract the blob that represents the intersection of the input blobs.

Parameters
[in]blob1First blob.
[in]blob2Second blob.
[in]extract_blob_segEnables the extraction of the rle.
[out]resPointer to the result blob (null if no intersection is found).
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.

◆ sb_blob_plot_roi()

sb_t_err sb_blob_plot_roi ( const sb_t_blob *const  blob,
sb_t_roi *const  roi,
unsigned char  gl 
)

Prints the blob on the roi.

The function print the blob on the provided roi.
The function updates the sb_t_roi::bounding_box parameter of the roi.

Parameters
[in]blobPointer of the blob.
[in]roiPointer to the ROI.
[in]glGray level to be set.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.

◆ sb_blobs_clone()

sb_t_err sb_blobs_clone ( sb_t_blobs **const  dst,
const sb_t_blobs *const  src 
)

Blobs structure clone.

The function creates a copy of the blobs src into the blobs dst.

Parameters
[out]dstDestination blobs.
[in]srcSource blobs.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.

◆ sb_blobs_create()

sb_t_err sb_blobs_create ( sb_t_blobs **const  blobs)

Creates the blobs structure.

Parameters
[out]blobsPointer to the blob structure. On successful return, this parameter will be updated with the pointer of the blobs structure.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.

◆ sb_blobs_destroy()

sb_t_err sb_blobs_destroy ( sb_t_blobs **const  blobs)

Destroys the blobs structure.

Parameters
[in,out]blobspointer to the blobs structure. It is set to NULL.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
sb_blobs_detection

◆ sb_blobs_detection()

sb_t_err sb_blobs_detection ( sb_t_blobs **const  blobs,
const sb_t_image *const  image,
const sb_t_roi *const  roi,
const sb_t_blob_par *const  par 
)

Blob analysis.

The function search for the blobs according to the values in the parameters structure.

Parameters
[out]blobsList of the blobs ordered by area descending.
On successful return, this parameter will be updated with the pointer of the blobs structure.
[in]imageImage on which to find the blobs. The format must be SB_IMAGE_FORMAT_BW.
[in]roiROI of the image where to search the blobs. The ROi may be both compress and uncompress. In case it is uncompress the bounding box must be defined.
[in]parPointer to the structure of the blob analysis parameters.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.
See also
sb_blobs_destroy;

◆ sb_blobs_plot_roi()

sb_t_err sb_blobs_plot_roi ( const sb_t_blobs *const  blobs,
sb_t_roi *const  roi,
unsigned char  gl 
)

Prints the blobs on the roi.

The function print the blobs on the provided roi.
The function updates the sb_t_roi::bounding_box parameter of the roi.

Parameters
[in]blobsPointer of the blobs.
[in]roiPointer to the ROI.
[in]glGray level to be set.
Returns
If successful, returns SB_ERR_NONE. Otherwise, it returns an error code sb_t_err.