Objective: Track and classify person, dog, vehicle utilizing the Java bindings
Approach: BackgroundSubtraction -> FindContours -> downselect to encompassing smaller rect sent to classifier/etc
Problem: I've tried BackgroundSubtractorMOG and MOG2 with varying parameters (may not have tried the right combinations) along with erode/dilate and findContours(). The contours rarely completely enclose the subject, consisting instead of a number of contours that usually partially map to the subject. On top of that, there are sometime multiple objects (eg., person with dog) moving through the video stream. I am not able to reliable draw a rect around the full object in order to detect features (or classifier, HOG, etc)
My approach is leaning towards grouping contours that have some measure of nearness, though for people, the vertical elongation can be a complication for nearness calculations.
Are there approaches to solving this problem? Below are images that illustrate the issue under consideration;