Blobs with OpenCV. Which library is best? [closed]
Asked Answered
B

2

7

I plan to start experimenting with blobs as a C++ user, with some experience at cv::Mat's from the OpenCV.

Now the question is, which blobs library should I use if at all?

I have seen these alternatives so far:

  1. cvBlobs (on google code) -- that is a c library really, working with IplImage so it needs serious adaptation to c++.
  2. CvBlobsLib (on willowgarage opencv webpage) -- that looks like a c++ library but has quite bad docs with plenty of stuff left unexplained and barely any code example.
  3. I have seen cv::findContours, cv::moments and cv::drawContours in the OpenCV 2.4.3 library.

What do you suggest as an expert? My pressing issue: what will the new OpenCV not cover of cvBlobs on google code?


Here is the link for the follow-up question on this subject, where I ask about SimpleBlobDetector. You might be interested.

Benniebenning answered 23/11, 2012 at 13:24 Comment(0)
H
5

You should use the SimpleBlobDetector class in OpenCV 2.4. You pretty much create an object of type SimpleBlobDetector and then call the detect(cv::Mat input, vector<cv::KeyPoint> keypoints, cv::Mat mask) function with a cv::Mat image as input, an empty vector for keypoints, and another cv::Mat as an optional mask for a specific area of the image to look for keypoints in.

Note that the cv::Mat object has taken over image and matrix storage duty for all of the formerly separate image and matrix classes in the earlier releases of OpenCV.

Higa answered 23/11, 2012 at 18:16 Comment(6)
OK, this answer looks exciting! I am just not sure I can make it work. I have the following concerns: this one only returns center of the blob, I can't have an entire, labelled Mat, can I? Also, how can I access the features of the detected blobs like area, convexity, color and so on? Should I pose it as a separate question and you promise me to have a look? :)Benniebenning
It looks now rather like a tutorial class for me with a not so mature concept, it is not very extendable either. :( Maybe I'll implement my wrapper over CBlob and I put it up opensource somewhere.Benniebenning
The linkKeypoint class (i.e. the output of the detect function) contains the size as a diameter in addition to the center of each blob detected. Also, in the constructor of the SimpleBlobDetector, you can specify desired colors, circularity, area, convexity, and inertia. You just put these into the constructor as so: SimpleBlobDetector myBlobDetector(bool filterByArea=true, float minArea=10, float maxArea = 100);Higa
hang on, man, I think it is time to pop up a new question, I'll link it here so you can find it :)Benniebenning
I screwed up the constructor anyways. It should be something like: cv::SimpleBlobDetector::Params params; params.minDistBetweenBlobs = 10.0; params.filterByArea = true; params.minArea = 20.0; params.maxArea = 500.0; SimpleBlobDetector myBlobDetector(params);Higa
hold your horses :) and please read my updated question, you can find this new question in a link, and post your answer there. (It scores more for you anyway, for me it will be easier to read back.) This is a Q&A site where every page contains only a single, specific Q and A's to that with very brief discussions in comment.Benniebenning
H
2

You should take a look at the new opencvblobslib. It has great features like multi core support.

Hyrup answered 12/11, 2013 at 8:17 Comment(1)
thx, +1 (and some more characters as required by SO :) )Benniebenning

© 2022 - 2024 — McMap. All rights reserved.