# Histogram equalization - Contrast (gray value) distribution using transforming function

I am looking for some guidance and explanation to be able to solve this exercise.

I understand that I have to come up with a function T(x) such that h(x) becomes H(x) and then with a U(x) which transforms back H(x) to h(x), but I am not sure on how to tackle this problem.

Exercise

• Can you elaborate, especially on T, h, H, U etc. ? At the moment it's hard to help. – Imago Dec 3 '18 at 21:25
• @Imago Please check the image added under Exercise hyperlink. – Tristan Dec 3 '18 at 21:27
• Still Looking for an answer. – Tristan Dec 3 '18 at 23:01

I think this is more probability theory question. The trick is, if $$x \sim F(x)$$ ($$F(x)$$ is the cumulative distribution function or CDF in abbreviation form) then the transformation $$u = F(x)$$ produces the uniform random variable $$u$$ with uniform distribution on interval $$[0,1]$$. you can see link below for proof:

Show Y has a uniform distribution if Y=F(X) where F(x)=P[X $$\le$$ x] is continuous in x.

Also to construct an arbitrary distribution $$x \sim F(x)$$ from a uniform random variable $$u \sim U([0,1])$$, it's enough to form the random variable $$x = F^{-1}(u)$$ (again $$F(x)$$ is the CDF of $$x$$). This one is the result of previous one if you change u with x. Therefore hre you need to apply the transformations to get the desired function:

So we have $$h(x) = 6x^5 \Rightarrow F_x(x) = x^6 , x\in [0,1]$$.

Then $$y = x^6$$ has the uniform distribution according to above lemmas.

To get a random variable with distribution $$H(X) = 1.8X+0.1 \Rightarrow F_X(X) = 0.9X^2 + 0.1X$$ you need to calculate the inverse of $$F(X)$$ which is $$\frac{-0.1+\sqrt{0.81+4X}}{1.8}$$ and then introduce the random variable $$z = \frac{-0.1+\sqrt{0.81+4X}}{1.8}$$ on the uniform random variable obtained from previous step. combining these two gives the transformation $$t = \frac{-0.1+\sqrt{0.81+4x^6}}{1.8}$$.

Therefore if $$x$$ is distributed as $$6x^5$$, then $$t$$, defined as $$t = \frac{-0.1+\sqrt{0.81+4x^6}}{1.8}$$ is distributed as $$1.8t+0.1$$.

• Thanks for the response @K.K.McDonald, I have found your answer quite confusing though. I am looking for two functions. T(x) = ? which will transform h(x) to become H(x) and U(x) = ? which will transform H(x) to become h(x) – Tristan Dec 3 '18 at 22:58
• To achieve $H(x)$ from $h(x)$, first you apply a transform that gets you from $h(x)$ to a uniform distribution $u(x)$. then you apply the second transform $z$ to get to $H(x)$. The uniform transformation is indeed an interface between these two. for further explanationsyou can see the srochastic process book by Papoulis: amazon.com/Probability-Random-Variables-Stochastic-Processes/dp/…. page 140, equation 5-43 and three other equations before this equation. – K.K.McDonald Dec 4 '18 at 11:01
• Thank you for the reply. @K.K.McDonald So what could T(x) and U(x) be in this specific exercise? To be able to validate your thought process I will try to check if those answers are correct and let you know. In this online exercise I have to input those two functions, then we can see if what you said is correct. – Tristan Dec 4 '18 at 15:59
• okay, wish you success. if that worked right, don't forget to accept my question, you know, reputation thingee. although I've already ran it in MATLAB before and checked it. – K.K.McDonald Dec 7 '18 at 14:31