Reputation: 11
I need to compute mutual information of two image patches. I know how to compute it if the two patches are the same size. But if the size is different, how can I compute the mutual information(or joint histogram between the two patches)?
Upvotes: 0
Views: 667
Reputation: 4940
This is really a question about algorithms, more than programming.
The answer depends on the definition of mutual information. If it's a histogram representing the occurrance of (some property) per pixel, then it makes sense to normalize your features. In particular, scale your features.
For example, if you have two inputs X1 (image 100x100px) and X2 (image 200x200px) and you want to look at the number of red pixels in them (red: R component > G+B components together). Then your feature (# red pixels) scales linearly with the number of pixels in the image. In this example, I would recommend rewriting the number of red pixels to the fraction of red pixels. For X1 that means dividing by 10000, for X2 it's a dividion by 40000. After that scaling, both features _red_X1_ and _red_X2_ are in the 0 ... 1 range and can be compared.
Upvotes: 1