Hi everyone,
Please explain and give more examples related to this topic?
i already rad the books.
i can understand the book's explanation.
Thank you.
1 Replies - 1986 Views - Last Post: 17 March 2010 - 08:12 PM
#1 Guest_sarmilla*
how to scale the intensity value of the image to [0, 255]
Posted 11 March 2010 - 12:54 AM
Replies To: how to scale the intensity value of the image to [0, 255]
#2
Re: how to scale the intensity value of the image to [0, 255]
Posted 17 March 2010 - 08:12 PM
sarmilla, on 10 March 2010 - 11:54 PM, said:
Hi everyone,
Please explain and give more examples related to this topic?
i already rad the books.
i can understand the book's explanation.
Thank you.
Please explain and give more examples related to this topic?
i already rad the books.
i can understand the book's explanation.
Thank you.
Please always use spell checker and re-read your post after posting.
Let's say if you want to view an image but you know that image has intensity values out of the range [0 255]
then you could use the following command:
im = imread('someImage.tif'); % read in the image
imshow(im, []); % output the image which automatically scales it to the range 0 to 255
but let's say if you want to scale it down to the range [0 255] and then perform some other operation then
im = imread('somePicture.tif'); % read in an image
im = im .* 3; % some intensity values could be > 255
maxPixelValue = max(max(im)); % find the maximum
minPixelValue = min(min(im)); % find the minimum
% make it to the range between 0 to 1 and then multiply by 255.
im = ((im + minPixelValue)/maxPixelValue)*255;
Try these code on matlab.
If you find any mistakes then try to correct it.
Goodluck.
Page 1 of 1
|
|

New Topic/Question
Reply
MultiQuote







|