How to assign Pixel values to the entire images?
4 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have set of images and then i need to make those images into 32*32. I did this by using imresize. Now i have 32*32 pixel image, then i need to image pixel value between 0 and 1. I know that i can use rand(32, 32) to have values between 0 and 1. how i can give it to the image?
1 件のコメント
採用された回答
その他の回答 (1 件)
Jurgen
2013 年 1 月 16 日
Not 100% sure what format your images are, but try this:
If A is your 32x32 image, then
A = mat2gray(A)
will scale it to 0-1. Alternatively, if you want to keep relative intensities: use
A = im2double(A).
If your image contains real values in a larger range (that contains the 0-1 subrange), and you only want to show the pixels in that 0-1 range: (and clip others at black or white)
A = mat2gray(A,[0 1])
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!