Saturday, November 26, 2005

MATLAB: after 'imread', interger to double, scale,

a = imread('lena.jpg'); % this is unit8 values 0-255
b = im2double(a); % this is double values 0-1
a = im2uint8(b); % back to uint8 values 0-255
g = mat2gray(a, [0 1]) % suppose g is random values, scale it to 0-1
===========================
axis([x1,x2, y1, y2])
xlim([xmin xmax]) % set the number on x-axis
set(gca, 'xtick', 1:0.5:10) % set the distance mark on x-axis
===========================
imagesc(a); % scale the data and show the image, or imagesc(a, [0 1])?
colormap(gray); % usually come with this one

No comments:

Post a Comment