利用matlab求图片的灰度并利用灰度值绘图

一、求图片的灰度值:

I=imread(‘sample.jpg’); !读取图片的RGB值

J=rgb2gray(I);!转换为灰度值

二、利用灰度值绘制图片:

imshow(J)

三、绘制等高线

contour(J)

contourf(J) 颜色填充

This entry was posted in Others. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *