matlab 准线,在MATLAB中检测目标中心

任何人都可以建议使用MATLBAB检测下图中每个目标中心的替代方法:

30052e3ef95c5b69d4a1859be200c5d5.png

我目前的方法使用regionprops和质心检测.

clc, clear all, close all

format long

beep off

rng('default')

I=imread('WP_20160811_13_38_26_Pro.jpg');

BW=im2bw(I);

BW=imcomplement(BW);

s = regionprops(BW, 'area','Centroid');

centroids = cat(1, s.Centroid);

imshow(BW)

hold on

plot(centroids(:,1), centroids(:,2), 'b*')

hold off

是否有更精确的方法来检测中心,因为这种方法似乎对噪声,透视失真等敏感.是否有办法找到两个四分之一圆的每个圆的交点.

我正在考虑的另一类目标是:19b5a08493e513932287cde30d6c516e.png

谁能建议一种检测十字准线中心的方法?谢谢

最佳答案 我的修改对您的图像效率高达100%:

I = imadjust(imcomplement(rgb2gray(imread('WP_20160811_13_38_26_Pro.jpg'))));

filtered_BW = bwareaopen(im2bw(I), 500, 4);

% 500 is the area of ignored objects

final_BW = imdilate(filtered_BW, strel('disk', 5));

s = regionprops(final_BW, 'area','Centroid');

centroids = cat(1, s([s.Area] < 10000).Centroid);

% the condition leaves out the big areas on both sides

figure; imshow(final_BW)

hold on

plot(centroids(:,1), centroids(:,2), 'b*')

hold off

3fc83c2c9973418e3f30c26f7bc13a25.png

我要添加的功能:

> rgb2gray有一个维度值!

> imadjust自动优化亮度和对比度,

> bwareaopen摆脱小岛屿,

> imdilate和strel生长区域并连接不连续的区域.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值