# Lloyd-Max Quantizer Problem

Consider the function $z = x^2 + y^2$ , for $0 \leq x \leq 10$ and $0 \leq y \leq 10$. Take a regular discretization with steps $\Delta x = \Delta y = 0.1$ and its histogram as the probability distribution. Then, apply the LLOYD-MAX quantizer to get a 8-bits grey level image.

How I will be able to fix this problem?

The transition, $t_k$, and reconstruction, $r_k$ levels are the fórmulas:

$$t_k = \dfrac{r_k+r_{k-1}}{2}$$ $$r_k = \dfrac{\int_{t_k}^{t_{k+1}}up(u)du}{\int_{t_k}^{t_{k+1}}p(u)du}$$

where $u$ a real scalar random variable with a continuous probability density function $p(u).$

-