EDIT: I'm talking about cvBlobs in this answer, sorry I messed it up with cvBlobsLib ...
I also searched for this, but did not come up with any library that uses the new image structure.
But in fact, you can always do this: IplImage iplImg = mat; and just use &iplimg wherever you need IplImage* .
I have used cvBlobs this way successfully in several projects:
#include <cvblob.h> using namespace cvb; // load image cv::Mat mat = cv::imread("image.jpg"); // convert cv::Mat to IplImage IplImage img = mat; // convert to grayscale IplImage *gray = cvCreateImage( cvGetSize(&img), IPL_DEPTH_8U, 1 ); cvCvtColor( &img, gray, CV_BGR2GRAY ); // get binary image cvThreshold( gray, gray, 150, 255, CV_THRESH_BINARY ); // get blobs IplImage *labelImg = cvCreateImage( cvGetSize(gray), IPL_DEPTH_LABEL, 1 ); CvBlobs blobs; unsigned int result = cvLabel( gray, labelImg, blobs ); // render blobs in original image cvRenderBlobs( labelImg, blobs, &img, &img ); // *always* remember freeing unused IplImages cvReleaseImage( labelImg ); cvReleaseImage( gray ); // convert back to cv::Mat cv::Mat output( &img );
source share