Saturday, April 9, 2011

Normalize Image pixel values of 0 to 255 into values of 0 to 1 in OpenCV

I found this code it to be useful in Normalizing an gray image with values 0 to 255 into values of 0 to 1.

I found the following in a blog I'm not sure why the blog is down right now or has been deleted. Had to get the following from google search cache. Thought of sharing with everyone.

If you are looking to energy Normalize an Image, click here.

I think Matlab function im2double does the same. This is likely to be the equivalent of im2double in OpenCV.

We cannot directly normalize the image as it takes only 8 bit unsigned integers as values. So we convert the scale and normalize it to values from 0 to 1 (from 0 to 255).

No comments:

Post a Comment