1

I'm developing a software that detects boxers punching motion. At the moment i used color based segmentation using inRange function and set it to detect blue Minimum value and Blue Maximum value. The problem is that the range is quite wide and my cam at times picks out noise 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

// 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.

enter image description here

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

Could someone suggest a solution to this problem or direct me to a source of information where I can look for answers ?

mmgp
  • 18,901
  • 3
  • 53
  • 80
Tomazi
  • 781
  • 9
  • 27
  • 46
  • +1 Interesting project. You may want to do something about the highlight or reflection to reduce the complexity of determining movement. – Thomas Matthews Feb 07 '13 at 21:58
  • Thank you......Ye i have many Image processing functions that deal with the highlights/reflections/noise etc.This Print Scr is taken form a input frame before any processing... eventley the out put Windows displays contours wrapped up in a Bounding Box. Have a look here... [link](http://stackoverflow.com/questions/14733042/opencv-bounding-box). I belief i can achieve greater results if i can scan the image for the color value beforehand and then use this value in inRange. ooo ye Thx for +1 – Tomazi Feb 07 '13 at 22:11
  • I think my Cam is fit for the purpose I may be wrong but its a HD 720p . Also once i can scan image pixels and determine the average pixel value, i could use that value prior to video capturing to determine the exact color of the i.e. Gloves that the boxer is wearing at the given time. – Tomazi Feb 08 '13 at 00:07
  • I understood your comment. I'll think about it again tomorrow. – karlphillip Feb 08 '13 at 02:33
  • Thank you v.much I will have a day of tmr therefore i will also spend some time to research :) – Tomazi Feb 08 '13 at 02:37
  • @Tomazi please include a link to a sample video that you are working with. – mmgp Feb 08 '13 at 20:09

2 Answers2

0

since you are detecting the boxer gloves in motion so first use motion to separate it from other elements in the scene...use frame differentiation or optical flow to separate the glove and other moving areas from non moving areas...now in those moving area try for some colour detection...

rotating_image
  • 3,046
  • 4
  • 28
  • 46
0
  1. Separe luminosity and cromaticity - your fixed range will not work very well in different light conditions. Your range is wide probably because you are trying to see "blue" in dark and on light at the same time. Convert your image to HSV (or La*b*) and discard V (or L), keeping H and S (or a* and b*).

  2. Learn a color distribution instead a simple range - take some samples and compute a 2D color histogram on H and S (a* or b*) for pixels on the glove. This histogram will be a model for the color distribution of your object. Then, use c2.calcBackProjection to detect the pixels of interest in your scene.

  3. Clean the result using morphological close operation

Important: on step 2, play a little with different quantization values (ie, different numbers of bins).

TH.
  • 1,738
  • 1
  • 12
  • 15