【问题标题】:Find the intersections of a series of curves of an image: Matlab查找图像的一系列曲线的交点:Matlab
【发布时间】:2017-05-07 22:41:00
【问题描述】:

我有一个带有一系列线条的图像,如下所示:

我想知道是否有一些方法可以找到所有线的交点。

我正在查看另一篇帖子,他们提供了一种找到交叉点的方法,但是一旦图像被分割,我想它有噪音或类似的东西......我将从一个简单的图像开始来找到每个交叉点。

我的主要想法是解决“方程组”,但我认为对于具有许多交叉点的图像来说太难了,我不知道是否有任何方法可以找到所有交叉点。

【问题讨论】:

  • 你有线条的方程,还是在分析图像?
  • 我正在分析图像,但我从简单的示例开始,让我了解如何使用不受控制的图像进行分析

标签: matlab image-processing intersection curves


【解决方案1】:

我假设你没有直线方程。我使用骨架化和过滤来检测有不止一条线穿过的小区域。我不确定对于嘈杂的图像是否会如此简单,但值得尝试:

im = im2double(rgb2gray(imread('lines.png')));
% binarize black lines
bw = im == 0;
% skelatonize lines
sk = bwmorph(bw,'skel',inf);
% filter skeleton with 3X3 ones filter
A = imfilter(double(sk),ones(3));
% find blobs greater than 4 - more than one line crossing the filter
B = A > 4;
% get centroids of detected blobs
C = regionprops(B,'Centroid');
Cent = reshape([C.Centroid],2,[]).';
% plot
imshow(im)
hold on;
plot(Cent(:,1),Cent(:,2),'gx','LineWidth',2)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多