3

I have two image processing problems that I'm handling using Open-CV.

  1. Identifying similar objects with different colors apart from each other.
  2. Identifying similar colored objects with different sizes apart from each other.

Example images for scenarios 1 and 2;

1

Different colored

2

Different sized

Both the images have three types of objects of interest. (Either three colors or sizes)

The techniques I've come across include thresholding and then using erosion with pixel counting, color segmentation using RGB values.

What is a good work-chain and what is a good place to start?

1
  • IF the objects you are interested at are circles, I would look into this, this and this. Commented Jun 13, 2012 at 14:17

3 Answers 3

8

For color segmentation you should stay away from RGB as similar colors aren't linearly related.

As an example 2 similar colors (with identical hue) may have very different RGB values:

Same Hue and Very Different RGB values

It's better to work with color spaces like LUV or HSV which have separated color from luminance. For example you may try a clustering algorithm on U,V components of LUV.

Sign up to request clarification or add additional context in comments.

Comments

3
  1. Obviously working with RGB value is probably the best way to start here. Use the function cvSplit, which will give you the three separated plans B, G and R (BGR order with OpenCV, not RGB). In each one of them, you should see only the circles of the corresponding color.

  2. I would recommend here to first perform a edge detection with Canny algorithm, implemented in OpenCV by the function cvCanny, and then do a circle detection with Hough algorithm, also implemented in OpenCV. If I remember well, the OpenCV function for Hough circles returns the circle properties (radius...), which will allow you to identify your circles upon their sizes. Another option for 2. is Hit&Miss algorithm, that uses morphology. I never used morphology with OpenCV though, only with Matlab.

Have fun

4 Comments

If, like in your sample images, you know that all the objects will be circles, you can forgo the Hough circles, and simply count pixels, since the area is directly proportional to the radius in a known manner.
That's right, if you're sure there will only be circles in your images. Soryy I'm used to far less controlled computer vision problems ^^
It's going to be a pellet-like object, which is not necessarily a proper circle. Is there anyway in OpenCV that I can count pixels of irregular blobs to figure out their sizes?
The detected blobs from the cvBlob Library have methods to get their area and centroids.
2

Have a look at cvBlob which works very well and can handle complex shapes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.