Histogram matching
Histogram matching principle Given images A and B, we will generate an image C from A such that ℎ 𝐶 𝑙 ~ ℎ 𝐵 𝑙 𝑙={0,1,2,,…,255} More generally, given an image A and a histogram ℎ 𝐵 𝑙 (or sample probability mass function 𝑝 𝐵 𝑙 , we would like to generate an image C such that: ℎ 𝐶 𝑙 ~ ℎ 𝐵 𝑙 𝑙={0,1,2,,…,255} Histogram matching/specification enables us to “match” the grayscale distribution in one image to the grayscale distribution in another image.
Key idea For a continuous random variable 𝑌 ∈ 0,1 which has the uniform probability density function, 𝛾= 𝐹 𝛾 −1 𝑌 has the probability density [distribution] function 𝑓 𝛾 𝑥 [ 𝐹 𝛾 𝑥 ]. 𝛾 𝐹 𝛾 𝑥 ⇒ Y = 𝐹 𝛾 𝑥 [uniform] Y [uniform] ⇒𝛾= 𝐹 𝛾 −1 𝑌 [ 𝐹 𝛾 𝑥 ] Now, assume we have a continuous random variable Z with strictly increasing and continuous 𝐹 𝑍 𝑧 . Then: Y (uniform) ⇒𝑊= 𝐹 𝑍 −1 𝑌 [ 𝐹 𝑍 𝑤 ] but we can generate the required uniform random variable Y from 𝛾 via Y = 𝐹 𝛾 𝛾 which means W can be generated from 𝛾 via: W = 𝐹 𝑍 −1 𝑌 = 𝐹 𝑍 −1 𝐹 𝛾 𝛾
Key Point Given a continuous random variable 𝜸 with strictly increasing and continuous 𝐹 𝛾 𝑥 , let 𝐹 𝑍 𝑧 be the specified distribution ( 𝐹 𝑍 𝑧 ) strictly increasing and continuous Then, 𝑊= 𝐹 𝑍 −1 𝐹 𝛾 𝛾 is a random variable that is a function of 𝛾 with 𝐹 𝑊 𝑤 = 𝐹 𝑍 𝑤 For discrete amplitude random variables this derivation does not workexactly in general. However, similar to the histogram equalization, we will generate a function that operates on an image A to “match” its histogram to that of image B.