P
P
pankif2016-12-29 19:30:58
PHP
pankif, 2016-12-29 19:30:58

How to compare two images without noise?

There are two images attached below. These are pictures (with shutter speed) taken from a wide-angle camera. In the second picture, to the right of the center, you can see the trace - this is a satellite flying by.
Such pictures are received once a minute. The task is to automatically find such traces in the pictures.
How is the comparison now:

  1. The last two photographs are taken and cut into pieces 100x100 in size
  2. Pieces are taken in turn from each picture (for example, 1 piece of the first picture and 1 piece of the second picture)
  3. The brightness of each fragment is equalized relative to each other
  4. Comparing two slices using the compareImages function (GD library)

At the output after comparison, we get a number, the higher it is, the more the images differ.
But there is a big drawback of this method - it is noise. In the original photo, it is not visible to the eye, but if you enlarge the two photos and start comparing yourself, you will see that in those places where there are no stars (dark space), the color of the image is not black, but close to black. And in some places there appears noise in the form of pixels close to black.
The appearance of such noise may be due to some factors: a car passes by and lights up part of the picture with its headlights, or when the moon shines, etc.
Hence the question arises. How can I bypass all this noise and focus the algorithm only on important places?
7b950e3f9acb4969a794b407a8e9ae40.jpgd40979b36c204d619a30d5576d7e7e6e.jpg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
PrimalB, 2016-12-29
@PrimalB

Try to see how I compared: https://cloud.mail.ru/public/2aat/8NYJRf15C
But as I understand it, it is necessary more clearly so that there is no noise at all, but only really shows the difference?
I also made two separately: https://cloud.mail.ru/public/DtA1/tUP3zbi8V

D
dom1n1k, 2016-12-29
@dom1n1k

Perhaps apply the Sobel operator (or similar) to the photos, then Threshold and already compare the results?
Although for me personally, the rotation of the sky seems to be a much more difficult problem than the noise in the image.

T
ThunderCat, 2016-12-29
@ThunderCat

First you need to make a white balance, or rather a black balance for this case, + darken the dark level. Xs if there are such functions in gd or imagemagic, I wasn’t interested, it’s easier to display the black level in some kind of Photoshop, and then work with the image. I think it will be enough auto-balance + dimming dark tones a couple of levels.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question