clear all;
I=imread('1.tif');
subplot(1,3,1);imshow(I);
title('原始图像');
subplot(1,3,2);
y=rgb2gray(I);
imshow(y);
title('灰度图');
subplot(1,3,3);
imhist(y);
title('灰度图像直方图');
```);
你好,同学
不知道可不可以这么做
clear all;
figure(1);clf
I=imread('a.tif');
subplot(1,3,1);imshow(I);
title('原始图像');
subplot(1,3,2);
y=rgb2gray(I);
imshow(y);
title('灰度图');
subplot(1,3,3);
imhist(y);
title('灰度图像直方图');
figure(2);clf
subplot(1,2,1);
I1 = ~(y<140 & y>70) | y<20;
imshow( I1 )
title('柚子皮');
subplot(1,2,2);
I2 = y<20|y>70;
imshow(I2)
title('柚子瓤')