「灰度切割」是一种灰度变换,即将某一灰度级的亮度进行提高
其 Matlab 代码可表示为
close all; img = imread('hofi.bmp'); imshow(img); [m n] = size(img); for i = 1:m for j = 1:n if img(i,j) > 50 && img(i,j) < 100 img(i,j) = 200; end end End figure; imshow(img); 复制
close all; img = imread('hofi.bmp'); imshow(img); [m n] = size(img); for i = 1:m for j = 1:n if img(i,j) > 50 && img(i,j) < 100 img(i,j) = 200; end end End figure; imshow(img);