Ask Your Question
1

Blob detection

asked 2015-05-27 09:19:54 -0600

Malcolmmaya gravatar image

updated 2015-05-27 10:38:49 -0600

Hello all,

I'm trying to detect the blob in the following image (the one on the bottom left) :

image description

I used the cv::SimpleBlobDetector detector to detect blob in other previous image as here (after inverting the color so the square is actually black) :

image description

And it worked fine.

However with the first image, the code doesn't return any keypoints. Here is the said code :

cv::SimpleBlobDetector::Params params;
params.filterByCircularity = false;
params.filterByArea = true;
params.minArea = 1;
cv::SimpleBlobDetector detector(params);
std::vector<cv::KeyPoint> keypoints;
detector.detect( roi, keypoints);

std::cout << "print keypoints" << std::endl;
for(size_t i = 0 ; i < keypoints.size() ; i++){
    std::cout << "keypoint : " << keypoints[i].pt << std::endl;
}
std::cout << std::endl;
return true;

I've seen this page and I know that by default the blob detector is tuned to detect black circular blobs. Could it be the reason for the failing ?

ANSWER :

Sorry I can't post an answer for now because I'm too new :

One need to set those parameters :

cv::SimpleBlobDetector::Params params;
params.filterByConvexity = false;
params.filterByInertia = false;
params.filterByCircularity = false;
params.filterByArea = true;
params.minArea = 1;
edit retag flag offensive close merge delete

Comments

May be you can have a look here.

Becareful your blob in bottom left is small in surface so you need to set minSurfArea to 1 (filterArea 1)

LBerger gravatar imageLBerger ( 2015-05-27 10:16:30 -0600 )edit

I edited the question in regard to your comment

Malcolmmaya gravatar imageMalcolmmaya ( 2015-05-27 10:29:35 -0600 )edit

I have download your image and convert in grayscale I have found your blob at - {pt={x=22.9106522 y=194.774918 } size=12.3448477 angle=-1.00000000 ...} with this parameters

LBerger gravatar imageLBerger ( 2015-05-27 10:57:16 -0600 )edit
1

Is there a way to make it so that it does not have parameter and just detect every blob ?

Malcolmmaya gravatar imageMalcolmmaya ( 2015-05-27 12:39:18 -0600 )edit

That pretty much answer my question thanks a lot :).

Malcolmmaya gravatar imageMalcolmmaya ( 2015-05-28 05:29:14 -0600 )edit

@LBerger i wonder what program is this. is it available?

sturkmen gravatar imagesturkmen ( 2015-07-02 10:11:37 -0600 )edit

That's my own program using opencv wxwidgets openscenegraph and plplot for teaching. I want to create a github folder but I m not ready. If you want a copy now I can send you an exe for windows or if you like compilation I can send you source file.

LBerger gravatar imageLBerger ( 2015-07-02 10:50:20 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-05-27 13:05:06 -0600

LBerger gravatar image

updated 2015-05-27 13:42:21 -0600

I'm not sure to understand. If there is no filter method detect every blob which can be detected by thresholding between minThres and maxThresh (with a step threshold step). It must be stable (exist for different thresh) that is min repeatabilty). You can see a video here

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-27 09:19:54 -0600

Seen: 2,916 times

Last updated: May 27 '15