Ask Your Question
0

Scanning and Detecting Object Color in Image

asked 2013-02-07 14:38:09 -0600

Tomazi gravatar image

Hello everybody

Am developing a software that detects boxers punching motion. At the moment i used color based segmentation using inRange function ans set it to detect blue Minimum value and Blue Maximum value. The problem is that the range is quiet wide and my cam at times picks out noize and segments objects of no interest. To improve the software i though of scanning image of a boxing glove and establishing exact Blue color Value before further processing.

It would make sens to me to store that value in a Vector and call it in inRange fiction

//This is my current function which takes the Minimum and Maximum values of Blue Color

 Mat range_out;
        inRange(blur_out, Scalar(100, 100, 100), Scalar(120, 255, 255), range_out);

So i would image the vector to go somewhere here.

image description

  1. Scan this above image compute the Blue value
  2. Store this value in an array
  3. recall the array in a inRange function

If anybody could suggest a solution to this problem or direct me to a source of information where i can look for answers.

Thanks for your attention

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-02-08 01:51:39 -0600

You can convert your image to HSV color space and make segmentation by H component. Your pipeline we be like this: color conversion -> threshold by H value -> morphology operations if needed -> find contours -> filtering contours, i.e. by size.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-02-07 14:38:09 -0600

Seen: 416 times

Last updated: Feb 08 '13