Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Image subtraction weird effect

Hi,

I have a problem subtracting background of the scene (image file taken from a video) from the next frames of the video. I provide code snippet:

    cv::absdiff(currentFrame, background, foregrounds);
    cv::threshold(foreground, foreground, 25, 255, cv::THRESH_BINARY);

I tried adjusting some parameters but the result is always something like this:

image description

How error like this could be possibly fixed?

Image subtraction weird effect

Hi,

I have a problem subtracting background of the scene (image file taken from a video) from the next frames of the video. I provide code snippet:

    cv::absdiff(currentFrame, background, foregrounds);
    cv::threshold(foreground, foreground, 25, 255, cv::THRESH_BINARY);

I tried adjusting some parameters but the result is always something like this:

image description

How error like this could possibly be possibly fixed?

Image subtraction weird effect

Hi,

I have a problem subtracting background of the scene (image file taken from a video) from the next frames of the video. I provide code snippet:

    cv::absdiff(currentFrame, background, foregrounds);
    cv::threshold(foreground, foreground, 25, 255, cv::THRESH_BINARY);

I tried adjusting some parameters but the result is always something like this:

image description

===================== UPDATE =====================

Here are currentFrame and background:

image description

image description

How error like this could possibly be fixed?

Image subtraction weird effect

Hi,

I have a problem subtracting background of the scene (image file taken from a video) from the next frames of the video. I provide code snippet:

    cv::absdiff(currentFrame, background, foregrounds);
foreground);
    cv::threshold(foreground, foreground, 25, 255, cv::THRESH_BINARY);

I tried adjusting some parameters but the result is always something like this:

image description

===================== UPDATE =====================

Here are currentFrame and background:

image description

image description

How error like this could possibly be fixed?