Ask Your Question

Revision history [back]

Glitches in processed images depending on size of original image

Hello CV'ers. I'm tearing my hair out with an issue and hoping for some help.

I'm doing some simple background subtraction and am getting garbage data in my processed images. The garbage data is present or absent depending on the dimensions of my original image. Some image dimensions work fine, others are very glitchy. Generally, it seems like the issue appears as one of the sides of the image approaches 100px.

I'm adding two screen shots. Both contain a sequence of four images. The images are created with the following processes (left to right):

  1. Raw image
  2. Running Average of raw input images (cv.RunningAvg in python)
  3. difference of raw image and running average
  4. binarized difference image

This is image is big (300px wide or so)

image description

This image is small (100px or so wide)

image description

I'm seeing the issue on my mac, and on a raspberry pi.

So, the short version of the question is: why am I getting crazy glitches with certain image dimensions, but not others. And how can I use small images without getting these glitches?