Ask Your Question

Revision history [back]

And when i want to "convert" the values between 0 - 1 i use "normalize". But this function don't work as expected. I tested the function with a grayscale image (values in the image 10,100,200) (8bit).When i use :

cv::normalize(img, img, 0, 1,cv::NORM_MINMAX);

When i get the min max values, i get 0 and 1. But i expected ~0.003 and ~0.78 ( because 200 is ~78% of 255) The value 255 has to be 1 after the normalize function and the value 0 = 0. When i calculate beta as = (1. /255.) * 200 i get also 0 and 1 for the min/max values.

What I mean is. Actually the container from 0 - 255 should be put into a "container" between 0 and 1. But in the same ratio. Example: If the maximum value in my 8bit is 200, it should not be 1. 255 should be 1 and 200 should be ~0.78. Do you understand what I mean?