阈值分割法:
对图行处理的程序如下:
clc, clear;
a=imread(‘huang.jpg’);%读取原始图像
a=uint8(a);
b=a;
[m,n,d]=size(a);
%ÌáÈ¡ÂÌÉ«·ÖÁ¿
For i=1:m
for j=1:n
if(a(i,j,1)>85 && a(i,j,1)<255)&&(a(i,j,2)>150 && a(i,j,2)<255)&&(a(i,j,3)>0 && a(i,j,3)<50);
b(i,j,1)=a(i,j,1);
b(i,j,2)=a(i,j,2);
b(i,j,3)=a(i,j,3);
else b(i,j,1)=0;
b(i,j,2)=0;
b(i,j,3)=0;
end
end
end
figure(1);
imshow(a);
figure(2);
imshow(b);title('提取黄色分量之后 ');
在Matlab中提取彩图黄色分量
最新推荐文章于 2023-10-12 10:36:26 发布