Identify the differences between two almost identical photographs

This is a fairly broad question; What tools / libraries exist to take two photos that are not identical but very similar, and identify specific differences between them?

An example would be shooting my couch on Friday after my girlfriend finishes cleaning and before the long weekend because you have friends, drinks and playing in a rock band. Two days later I take a second photograph of the sofa; the lighting is identical, the couch did not move the millimeter, and I use a tripod in a fixed place.

What tools could I use to create image differences, or a third image of a heat map of differences? Are there any tools for .NET?

+6
comparison diff image image-processing
source share
7 answers

Check out Andrew Kirillov's article on CodeProject. He wrote a C # application using the AForge.NET computer library for motion detection. AForge.NET has a discussion of two frame differences for motion detection.

+1
source share

It largely depends on the image format and compression. But in the end, you probably take two rasters and compare them pixel by pixel.

Take a look at the perceptual image comparison utility .

+5
source share

The most obvious way to see every tiny, usually almost imperceptible difference is XOR pixel data. If the lighting is even a little different, it could be too much. The difference (subtraction) of the pixel data may be larger than what you are looking for, depending on how subtle the differences are.

+2
source share

One place to start is with a rich image processing library such as IM . You can interact with your operators interactively using the IMlab tool, call it directly from C or C ++, or use its really decent Lua binding to drive from Lua. It supports a wide range of operations on raster images, as well as an expandable library of file formats.

Even if you didnโ€™t intentionally move anything, you can use an algorithm such as SIFT to get good quality subpixel alignment between frames. If you do not want to treat the camera as fixed and detect the movement of the sofa.

+2
source share

I wrote this free .NET application using the tools my company (DotImage) makes. It has a very simple algorithm, but the code is open source, if you want to play with it, you can adapt the algorithm to .NET Image classes if you do not want to buy a copy of DotImage.

http://www.atalasoft.com/cs/blogs/31appsin31days/archive/2008/05/13/image-difference-utility.aspx

+2
source share

This is an interesting question. I cannot reference any specific libraries, but the process you are asking for is basically a minimal case of motion compensation. It is so that MPEG (MP4, DIVX, independently) video allows you to compress video so well; you can look in MPEG for some information on how motion compensation algorithms are implemented.

Another thing to keep in mind; JPEG compression is block-based compression; most of the benefits that MPEG brings out of things is actually making a comparison block. If most of your image (say, the background) is the same from one image to another, these blocks will be unchanged. This is a quick way to reduce the amount of data that needs to be compared.

+1
source share

just use the .net image classes, create a new raster () x 2 and look at the values โ€‹โ€‹of R and G and B of each pixel, you can also look at the values โ€‹โ€‹of A (alpha / transparency) if you want to determine the difference.

also note, using the getPixel (y, x) method can be significantly slower, there is another way to get the whole image (less elegant) and for each of them through it, if I remember that it was called getBitmap or something similar, look in image / raster image classes and read some theta that they really are all you need and that are not so difficult to use, do not send a third party if you do not need.

0
source share

All Articles