3

After spending on a while on this, I finally managed to detect the hands through thresholding. The only problem is that VERY FEW pixels in the background remain, which will mess up the next step. Any suggestions on how to get rid of the few background pixels? Because I don't want to go through the whole background subtraction thing for just a few pixels. Background Subtraction is not an option for the program, so please don't suggest it

Thanks

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
fdh
  • 5,256
  • 13
  • 58
  • 101
  • I think you'll need to share more of the algorithm and maybe some sample images to get a good answer. – Carl F. Sep 28 '11 at 01:37

1 Answers1

1

It's hard to be sure without a more detailed description of your hand detection algorithm. If you have a few background pixels that are isolated from the hands you have detected, I would suggest morphological operation like opening to eliminate single pixel detections in your binary mask. In openCV, I think you need to erode and then dilate

Carl F.
  • 6,718
  • 3
  • 28
  • 41
  • i already tried opening, closing eroding and dilating- they take away most of the pixels, but still keep a few I need a completely clean background Thanks for your help – fdh Sep 28 '11 at 01:35
  • Oh and for a better description I am not allowed to share code but my algorithm is relatively simple i take two cvScalar values, and just use CvInRangeS() on them i then Gaussian, open the image twice Any other suggestions? – fdh Sep 28 '11 at 02:18