www.gusucode.com > images 案例代码 matlab源码程序 > images/CreateContourPlotOfImageDataExample.m

    %% Create Contour Plot of Image Data
% This example shows how to create a contour plot of an image.
%%
% Read grayscale image and display it. The example uses an example image of
% grains of rice.

% Copyright 2015 The MathWorks, Inc.

I = imread('rice.png');
imshow(I)
%%
% Create a contour plot of the image using |imcontour| .
figure;
imcontour(I,3)