This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Contour Plot of Image Data

A contour is a path in an image along which the image intensity values are equal to a constant. You can create a contour plot of the data in a grayscale image using imcontour. This function is similar to the contour function in MATLAB®, but it automatically sets up the axes so their orientation and aspect ratio match the image. To label the levels of the contours, use the clabel function.

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.

I = imread('rice.png');
imshow(I)

Create a contour plot of the image using imcontour .

figure;
imcontour(I,3)