Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Kullback-Leibler be applied to compare two images?

I know that KL is not a metric, and cannot be considered one. However, is it possible to use KL to measure how one image varies from another? I am trying to make an intuitive sense out of this. Thanks in advance for all responses.

like image 756
troymyname00 Avatar asked Feb 06 '23 23:02

troymyname00


1 Answers

The KL measures the difference between two probability distributions.

In order to apply it in images you will need to transform the image to a probability distribution.

A simple example will be the take the histogram of the image(in gray scale) and than divide the histogram values by the total number of pixels in the image. This will result in the probability to find a gray value in the image.

Apply this to both images and than use the KL to measure the difference between the images.

This is not a real good way to measure the difference between the images because it doesn't take into consideration the spatial information of the images only the gray values information.

Therefor you will need to find a better transformation that will take into account the spatial distribution of the pixel color values. Look at this to get some ideas https://mathematica.stackexchange.com/questions/91627/how-to-transform-an-image-into-a-probability-density-function

like image 100
Amitay Nachmani Avatar answered May 16 '23 07:05

Amitay Nachmani