надо написать в матлабе следущее:
(есть такая готовая функция но мне надо написать свою, что то в готовой не могу разобраться, сильно накрученная она)
HistEqual(X, Y)
Histogram equalization. After running this function, the histogram of X should be
as similar to the histogram of Y as possible, without changing the histogram of Y.
Return the new image after histogram equalization.
алгоритм следующий:
Equalize :For every original gray level k
1. Calculate the image histogram
2. Find the accumulative sum of the histogram values - yk (in Matlab – cumsum(vec))
3. Normalize the values of the histogram accumulative sum by dividing in the total number
of pixels
4. Multiple the normalized vector in the maximal gray level value (K-1)
and round (shift back to the original gray level range)
5. Map the gray levels values to the result of step (3)
6. Stretch the values back to the range 1,..K
(improve contrast in the end of this process)
вроде все ясно
но вот как сделать в матлабе пятый пункт не понимаю
помогите плиз
заранее спасибо