write normalized image file
Show older comments
I am normalizing an image and then writing to file so that i can use the normalized image but when i write into file i need to convert to uint8 otherwise the file is all blank. However when i do that the value of outimage4 and x is not same and not sure how to solve the problem. Can anyone help.
I4= (imread('x2.png')); I4= double(I4); I4 = I4 - min(min(I4)); outputImage4 =I4 ./ sqrt(sum(sum(I4.^2))); figure(1) imagesc(outputImage4); colormap('gray');
test1= ((outputImage4)./(max(max(outputImage4)))).*256; x= uint8(test1); imwrite(x,'norm1.png', 'png');
Accepted Answer
More Answers (1)
Image Analyst
on 15 Nov 2013
0 votes
Simply save the data (image array) as a mat file. It will maintain the precision.
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!