int sod_image_find_blobs(sod_img input, sod_box **paBox, int *pnBox, int(*xFilter)(int width, int height));
Perform connected component labeling on an input binary image which is useful for finding blobs (i.e. bloc of texts). The target image must be binary (i.e. images whose pixels have only two possible intensity value mostly black or white). You can obtain a binary image via sod_canny_edge_image(), sod_otsu_binarize_image(), sod_binarize_image() or sod_threshold_image(). When done, you can draw the blob regions via sod_image_draw_bbox() and you must release the sod_box array returned by this call via sod_image_blob_boxes_release() to avoid memory leaks. A typical input image after processing should look like the following:
Binarized via sod_threshold_image() and dilated via sod_dilate_image()
OUT: A sod_box array holding the coordinates for each detected blob region is copied into an instance of this pointer on success. if something goes wrong during processing, NULL is copied instead. Once done, you must release the memory allocated to this array via sod_image_blob_boxes_release() to avoid memory leaks.
OUT: Total number of detected blob regions.
int (*xFilter)(int width, int height)
Optional/IN: Filter callback if any to discard blobs not in the expected size. You should rely on the width & height parameters and return a value different from 0 to allow this blob (i.e. record its coordinates). Otherwise it is discarded. Pass NULL in case you want to record everything instead.
SOD_OK is returned on success and the sod_box array is filled accordingly. Any other error code indicates failure.