Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Java BackgroundSubtractionMOG2: can I set fTau or nShadowDetection?

Is there a trick to setting fTau or nShadowDetection values in the Java version of BackgroundSubtractionMOG2? The default values are not giving good results (all too often the shadow gives much better contours in findContours() than does the person themselves).

Java BackgroundSubtractionMOG2: can I set fTau or nShadowDetection?

Is there a trick to setting fTau or nShadowDetection values in the Java version of BackgroundSubtractionMOG2? The default values are not giving good results (all too often the shadow gives much better contours in findContours() than does the person themselves).

Update: Added images to provide greater clarity of the problem

Original image image description

Silhouette http://i.imgur.com/TX8Qwfw.jpg

Contours (from findContours()) http://i.imgur.com/CaR7Ve4.jpg

Java BackgroundSubtractionMOG2: can I set fTau or nShadowDetection?

Is there a trick to setting fTau or nShadowDetection values in the Java version of BackgroundSubtractionMOG2? The default values are not giving good results (all too often the shadow gives much better contours in findContours() than does the person themselves).

Update: Added images to provide greater clarity of the problem

Contours (from findContours()) http://i.imgur.com/CaR7Ve4.jpg

Original image image description

Silhouette http://i.imgur.com/TX8Qwfw.jpg

Contours (from findContours()) http://i.imgur.com/CaR7Ve4.jpg

Java BackgroundSubtractionMOG2: can I set fTau or nShadowDetection?

Is there a trick to setting fTau or nShadowDetection values in the Java version of BackgroundSubtractionMOG2? The default values are not giving good results (all too often the shadow gives much better contours in findContours() than does the person themselves).

Current settings; new BackgroundSubtractorMOG2(2, 40, true);// I've tried lower values, such as (1, 16, true) BSMOG2.apply(frameToExamine, fore, 0.5) // also tried 0.1 findContours(fore, contours, hierarchyMat, 1, 3) I also erode and dilate before findContours.

Update: Added images to provide greater clarity of the problem

Contours (from findContours()) http://i.imgur.com/CaR7Ve4.jpgimage description

Original image image

image description

Silhouette http://i.imgur.com/TX8Qwfw.jpgSilhouette

image description

Java BackgroundSubtractionMOG2: can I set fTau or nShadowDetection?

Is there a trick to setting fTau or nShadowDetection values in the Java version of BackgroundSubtractionMOG2? The default values are not giving good results (all too often the shadow gives much better contours in findContours() than does the person themselves).

Current settings; new BackgroundSubtractorMOG2(2, 40, true);// I've tried lower values, such as (1, 16, true) true)

BSMOG2.apply(frameToExamine, fore, 0.5) // also tried 0.1 0.1

findContours(fore, contours, hierarchyMat, 1, 3) 3)

I also erode and dilate before findContours.

Update: Added images to provide greater clarity of the problem

Contours (from findContours()) image description

Original image

image description

Silhouette

image description

Java BackgroundSubtractionMOG2: can I set fTau or nShadowDetection?

Is there a trick to setting fTau or nShadowDetection values in the Java version of BackgroundSubtractionMOG2? The default values are not giving good results (all too often the shadow gives much better contours in findContours() than does the person themselves).

Current settings; new BackgroundSubtractorMOG2(2, 40, true);// I've tried lower values, such as (1, 16, true)

BSMOG2.apply(frameToExamine, fore, 0.5) // also tried 0.1

findContours(fore, contours, hierarchyMat, 1, 3)

I also erode and dilate before findContours.

Update: Added images to provide greater clarity of the problem

Contours (from findContours()) image description

Original image

image description

Silhouette

image description

Java BackgroundSubtractionMOG2: can I set fTau or nShadowDetection?

Is there a trick to setting fTau or nShadowDetection values in the Java version of BackgroundSubtractionMOG2? The default values are not giving good results (all too often the shadow gives much better contours in findContours() than does the person themselves).

Current settings; new BackgroundSubtractorMOG2(2, 40, true);// I've tried lower values, such as (1, 16, true)

BSMOG2.apply(frameToExamine, fore, 0.5) // also tried 0.1

findContours(fore, contours, hierarchyMat, 1, 3)

I also erode and dilate before findContours.

Update: Added images to provide greater clarity of the problem

Contours (from findContours()) image description

Original image

image description

Silhouette

image description

Java BackgroundSubtractionMOG2: can I set fTau or nShadowDetection?

Is there a trick to setting fTau or nShadowDetection values in the Java version of BackgroundSubtractionMOG2? The default values are not giving good results (all too often the shadow gives much better contours in findContours() than does the person themselves).

Update: If there is no current means to access fTau or nShadowDetection via the Java binding, is it something I can add manually to the next version via pull request?

Current settings; new BackgroundSubtractorMOG2(2, 40, true);// I've tried lower values, such as (1, 16, true)

BSMOG2.apply(frameToExamine, fore, 0.5) // also tried 0.1

findContours(fore, contours, hierarchyMat, 1, 3)

I also erode and dilate before findContours.

Update: Added images to provide greater clarity of the problem

Contours (from findContours()) image description

Original image

image description

Silhouette

image description