Creating compact blobs using BG-Subtraction

Hello there,

I’m working on a project where I’m using motion tracking. The camera is placed on the ceiling, tracking the movement of the visitors.

I’ve used “background subtraction” in order to avoid confusion with the other objects in the space and the variation of light. I fed the output of that in the “contour” Plugin in order to extract coordinates, area, etc. It works but the problem I face is the following:

The image from the BG-subtraction most of the times is not one compact white image (eg separates the head from the arm), causing the contour node to tract two or more contours of a single person.

My Questions are:
Is there a way to make more uniform the image from the BG-subtraction, like compact blobs?
It there a way to combine bigger areas of pixels with the same characteristics, like pixel average to create solid blobs.
Is there another tracking technique or combination you would suggest? (Keep in mind I’ve tried the “Detect object” and “Cam Shift Tracker” but they are not very precise).

Any help would be well appreciated.

Panos

BGSubContEmail01.JPG (24.9 kB)