Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it's kind of unavoidable, that parts of the body will look very similar to the background, and will result in a poor subtraction (you can't command ppl to wear all yellow ;)

but at least, if the majority of the figure is detected, you can exploit that, and use some post-processing.

here's some very simple approach, alternate blurring/thresholding:

blur(ocv,ocv, Size(12,12));
threshold(ocv,ocv,15,255,0); // below 15 will show shadows again.

ugly, but at least it's a single blob.

image description

there's also morphological operations for this, you'll have to derive your own mix, which quite depends on your actual situation.