2011-03-26 5 views

ответ

0

Смотрите эту tutorial Люк Флетчер В целом он говорит:

%Load the image into im_rgb with 
im_rgb = imread('tetx.tiff'); 
%convert to type double 
im_rgb = double(im_rgb); 
%convert to grey-scale 
im_grey = (im_rgb(:,:,1)+im_rgb(:,:,2)+im_rgb(:,:,3))/3; 

%or you can use rgb2gray which gives a slightly different result since it converts 
%to a luminance rather than an intensity image, you'll learn about this 
%in the lecture on colour imaging. 
%convert from [0,255] to [0,1] 
im_grey = im_grey/255; 

%to view an image use either imshow(im) or imagesc(im), note the difference. 
%You can use imagesc and then set the axis for an image with 
axis image; 

%Axis labelling can be turned on and off by 
axis on; 
axis off; 

и т.д ...

Смежные вопросы