I calculate similarity percent between two images. Another image is the same with changed brightness. I've already tried comparing by pixel (euclidean distance for grayscale and 0/1 values), comparing by HSV. I've tried also normalisation (pixel brightness-mean brightness). The results were quite good (80-90%), but the similarity rate with changed image was lower than similarity between images with compeletely different tables, for example. Is there any simple approach to solve this problem? Or should I use neural networks?
-
1$\begingroup$ If changing the brightness means multiplying all intensities by the same factor, then you can normalise properly by rescaling all intensities in both images to the same minimum and maximum values using linear interpolation. $\endgroup$– j_random_hackerMar 7, 2021 at 14:00
-
1$\begingroup$ You can try to pass the images through an edge detection convolution before checking similarities. $\endgroup$– Pål GDMar 7, 2021 at 14:05
-
$\begingroup$ I am currently dealing with image similiarities of two images after some time(colorfastness to bright). How did you deal with this problem?? $\endgroup$– LeeJan 4, 2022 at 7:11
-
$\begingroup$ @PålGD: convolutions are linear, so they can not cancel the effect of a change in brightness. $\endgroup$– user16034Jun 4, 2022 at 13:23
2 Answers
You can try multiplicative normalization (pixel brightness / mean brightness), or subtractive normalization after transforming with a logarithmic LUT.
Have a look at the h.264 spec. It’s for encoding movies, so it does a lot of comparing similar images.
The model is that image2 = image1, translated, with some linear transformation of the pixels.