MATLAB中的轮廓矩阵

时间:2011-03-26 18:26:31

标签: matlab image-processing

如何在MATLAB中获取二进制图像的轮廓矩阵?

1 个答案:

答案 0 :(得分: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;

等...