0
点赞
收藏
分享

微信扫一扫

图像边缘颜色更改


文章目录


处理图片:


图像边缘颜色更改_开发语言

代码:


clear all
clc

BW = imread("Pic_2.bmp");
BW=im2bw(BW);
imshow(BW,[]);

for j=1:size(BW,2)
if sum(BW(:,j))~=sum(BW(:,1))
corner=BW(:,j);
c=j-1;
break
end
end
r=find(corner==0);
r=r(end);

outline = bwtraceboundary(BW,[r c],'W',8,Inf,'counterclockwise');
hold on;
plot(outline(:,2),outline(:,1),'g','LineWidth',2);


[B,L] = bwboundaries(BW);
hold on
for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'g', 'LineWidth', 2)
end

运行:
图像边缘颜色更改_神经网络_02


举报

相关推荐

0 条评论