matlab - 在 MATLAB 中检测目标中心

标签 matlab image-processing detection

谁能建议使用 MATLBAB 检测下图中每个目标中心的替代方法:

Targets

我目前的方法使用 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

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

我正在考虑的另一种目标是:enter image description here 谁能建议一种检测十字准线中心的方法?谢谢

最佳答案

我的修改对您的图像有 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

enter image description here

我添加的功能:

  • rgb2gray 具有一维值!
  • imadjust 自动优化亮度和对比度,
  • bwareaopen 去除小岛,
  • imdilatestrel 扩大区域并连接断开的区域。

关于matlab - 在 MATLAB 中检测目标中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38954662/

相关文章:

Matlab绘制黑色边框

performance - 如何对 Matlab 流程进行基准测试?

java - 终止 Java 程序而不退出 Matlab?

c# - 允许多个线程访问图像

css - 如何检测 Prince PDF 中的分页符?

matlab - 对于 MATLAB 中的大型稀疏矩阵,计算非零条目的各列的累积和?

java - 是否可以使用 apache POI 裁剪/创建缩略图

python - 使用 Python 在非常大的图像中进行高性能变量模糊

silverlight-3.0 - 如何从 Silverlight 应用程序中检测操作系统?

c# - 2D 碰撞检测不起作用