matlab dither函数问题


clc;clear;close all;
f=imread('gbiaosu.tif');
subplot(1,2,1);
imshow(f);
title('原图');
bw=dither(f);
subplot(1,2,2);
imshow(bw);
title('将灰度图像抖动为二值图像');

为什么老是提醒我这个?灰度图像不就是二维数组吗?

img

img

可能是恰巧三个通道完全一样的三维数组,改成:
bw=dither(f(:,:,1));试试?