MATLAB中的轮廓矩阵

MATLAB中的轮廓矩阵,matlab,image-processing,Matlab,Image Processing,如何在MATLAB中获得二值图像的轮廓矩阵?请参见此Luke Fletcher 一般来说,它说: %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; %

如何在MATLAB中获得二值图像的轮廓矩阵?

请参见此Luke Fletcher 一般来说,它说:

%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;
等等