噪声边界的应用

%噪声边界的应用
f=imread('bottle_1.tif');
subplot(2,3,1),imshow(f),title('对像')

b = boundaries(f, 4, 'cw');
b = b{1};
[M, N] = size(B);
xmin = min(b(:, 1));
ymin = min(b(:, 2));
[x, y] = minperpoly(f, 8);%使用函数minperpoly得到最小周长多边形
[M,N]=size(f);
b2 = connectpoly(x, y);
B2 = bound2im(b2, M, N, xmin, ymin);
subplot(2,3,2),imshow(B2),title('最小周长多边形')

[xn, yn] = randvertex(x, y, 5)%每个顶点添加噪声
[xn, yn] = minperpoly(f, 8);%以下程序跟上个相同
[M,N]=size(f);
b2 = connectpoly(xn, yn);
B2 = bound2im(b2, M, N, xmin, ymin);
subplot(2,3,3),imshow(B2),title('噪声边界')

%另外一个对象的相同序列
f=imread('bottle_2.tif');
subplot(2,3,4),imshow(f),title('对像')

b = boundaries(f, 4, 'cw');
b = b{1};
[M, N] = size(B);
xmin = min(b(:, 1));
ymin = min(b(:, 2));
[x, y] = minperpoly(f, 8);
[M,N]=size(f);
b2 = connectpoly(x, y);
B2 = bound2im(b2, M, N, xmin, ymin);
subplot(2,3,5),imshow(B2),title('最小周长多边形')

[xn, yn] = randvertex(x, y, 5)
[xn, yn] = minperpoly(f, 8);
[M,N]=size(f);
b2 = connectpoly(xn, yn);
B2 = bound2im(b2, M, N, xmin, ymin);
subplot(2,3,6),imshow(B2),title('噪声边界")
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值