Question

I have an image find- and "blur-compare"-task. I could not figure out which methods I should use.

The setup is this: A, say, 100x100 box either is mostly filled by an object or not. To the human eye this object is always almost the same, but might change by blur, slight rescaling, tilting 3-dimensionally, moving to the side or up/down by a or two pixel or other very small graphical changes.

What is a simple quick robust and reliable way to check if the transformed object is there or not? Points to python packages as well as code would be nice.

Was it helpful?

Solution

Not sure I entirely understand your question, but I'll give it a shot..

Assuming:

  1. we just want to know if there is some object in a box.
  2. the empty box is always the same
  3. perfect box alignment etc.

You can do this:

  1. subtract the query image from your empty box image.
  2. sum all pixels
  3. if the value is zero the images are identical, therefore no change, so no object.

Obviously there actually is some difference between the box parts of the two images, but the key thing is that the non-object part of the images are as similar as possible for both pictures, if this is the case, then we can use the above method but with a threshold test as the 3rd step. Provided the threshold is set reasonably, it should give a decent prediction of whether the box is empty or not..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top