3

I want to extract the white area of my binary image. Everywhere I check on the internet, I see stuff about cvBlob and cvBlobLib. I don't really know what these are since I am just working with openCV and C++. Do I need to install those extra things to extract the white area from my binary image. The white area is a person walking.

jilles de wit
  • 7,060
  • 3
  • 26
  • 50
sue-ling
  • 399
  • 2
  • 11
  • 21

4 Answers4

5

Cvblob would be better choice over others with its power on blob detecting and tracking, but there isn't enough documentation and tutorials.

Horizon1710
  • 792
  • 10
  • 28
3

cvBlob is an "add-on" to OpenCV. If you want to extract contigous white area of your binary (thresholded) image, please have a look at the contours2.cpp example wich is provided with OpenCV. You can find it in OpenCV-2.3.1/samples/cpp/contours2.cpp

This file will show you how to find "blobs" in a thresholded image thanks to the OpenCV built in function cvFindContour.

I never try cvBlob, may be this library works better than cvFindContour, but it is very easy to try cvFindContour thanks to the sample "contours2.cpp"

Adrien BARRAL
  • 3,474
  • 1
  • 25
  • 37
  • thanks a lot. I'll try it and see because I'm a bit uncertain as to using cvBlobs. http://stackoverflow.com/questions/9372687/masking-a-blob-from-a-binary-image this is the question for which i was asking about the cvBlobs. can you take a look and see if cvFindContour will work as well? please do, I need help urgently – sue-ling Feb 21 '12 at 09:22
  • 1
    Yes I think cvFindContour will help you to extract the human contour. Some times it is necessary to do a little morphological dilatation of the thresholded image to get the full contour. – Adrien BARRAL Feb 21 '12 at 09:38
1

I have try to use cvBlob but seems it's not working for me. then, i choose cvBlobsLib instead. This link http://opencv.willowgarage.com/wiki/cvBlobsLib might help you. If you want to find the white pixel area, use CCL analysis. It will search for all the white blobs in the image. Use some criteria to eliminate the blobs that you might not want.

Mzk
  • 1,102
  • 3
  • 17
  • 40
0

cvblob is much better than cvFindContour(hard) or cvBlobLib(outdated).

plan9assembler
  • 2,862
  • 1
  • 24
  • 13
  • But, I would have to install a whole new library, whereas I already have the OpenCV on my machine. Would region of interest be suitable to obtain the largest white area of my image? – sue-ling Feb 25 '12 at 15:51