blob function returning zero blobs

Hi folks, I have implemented an opencv blob finding function, to find blobs in an image. When I try  to find blobs in a binarized image, the function GetNumBlobs returns a zero as it isn't finding any blobs. I have confirmed this with showing the image that would contain them as well (there are none). But I when I view the binarized image, there are clearly well demarcated white blobs in a black and white image.

Here is the library link: http://opencvlibrary.sourceforge.net/cvBlobsLib

code snippet.:(configured the function wrong?).
        //threshold the image
        cvThreshold( HImageHueExtracted, HueExtracted_Binary, 1, 255, CV_THRESH_BINARY );
        //find & filter blobs
             CBlobResult blobs, filteredBlobs;
             blobs = CBlobResult( HueExtracted_Binary, NULL, 100, true );
             blobs.Filter( blobs, B_INCLUDE, CBlobGetArea(), B_GREATER, 1);
             BlobImageResult = cvCloneImage( HueExtracted_Binary );
             cvSetZero( BlobImageResult );

            for(i = 0; i < filteredBlobs.GetNumBlobs();i++)
             {
             filteredBlobs.GetBlob(i)->FillBlob( BlobImageResult, CV_RGB( 255, 0, 0), 0 , 0 );
              }

Any thoughts on why its not picking up the blobs?
Thanks in advance,
WLE
WanderinglazyeyeAsked:
Who is Participating?
 
jkrCommented:
What happens if you skip the call to

        cvThreshold( HImageHueExtracted, HueExtracted_Binary, 1, 255, CV_THRESH_BINARY );

?
0
 
WanderinglazyeyeAuthor Commented:
Nothing; but looking at it that way led me to question other assumptions,and I fixed the line:

for(i = 0; i < blobs.GetNumBlobs();i++)
                {
                blobs.GetBlob(i)->FillBlob( BlobImageResult, CV_RGB( 255, 0, 0), 0 , 0 );
                }

And now its returning blobs.

Thx jkr
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.