[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

blob function returning zero blobs

Posted on 2007-08-09
2
Medium Priority
?
1,646 Views
Last Modified: 2013-11-05
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
0
Comment
Question by:Wanderinglazyeye
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 1500 total points
ID: 19663615
What happens if you skip the call to

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

?
0
 

Author Comment

by:Wanderinglazyeye
ID: 19664528
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question