Demo entry 6356838

1

   

Submitted by 1 on Apr 20, 2017 at 14:31
Language: Matlab. Code size: 273 Bytes.

%提取特定颜色
rgb=im2double(imread('11.png'));
ycbcr=rgb2ycbcr(rgb);
cr=ycbcr(:,:,3);
mask1_r=cr>.65;  %阈值
%缺省拟合部分
%寻找二值图等于0的像素坐标(等于0即为白色,等于1即为黑色)
[x,y]=find(mask1_r==1);
imshow(mask1_r);
B=[x,y];
[y1,I] = max(B(:,2));
x1=B(I,1)
hold on,plot(x1,y1,'*','color','red');

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).