清除边缘检测算法中的噪声(cleaning up noise in an edge detection algorithm)

编程入门 行业动态 更新时间:2024-10-28 01:14:18
清除边缘检测算法中的噪声(cleaning up noise in an edge detection algorithm)

我最近写了一个极其基本的边缘检测算法,它可以在一系列字符上运行。 该程序旨在检测数组上单个特定值的blob的边缘,并通过简单地在数组元素上向左,向右,向上和向下查看并检查其中一个值是否与它的值不同来工作。目前正在看。 目标不是产生数学线,而是产生一组有序的点,这些点代表了一个descritized闭环边。

该算法工作得很好,除了我的数据包含一点噪声,因此会随机产生没有边缘的边缘。 这反过来对我的其他一些程序造成了严重破坏。

数据包含两种类型的噪声。 第一种类型相当稀疏,有些随机。 第二种类型是x = y轴上的半连续直线。 我知道第一类噪声的来源,它是数据的一个特征,我无能为力。 至于第二种类型,我知道这是我的程序导致它的错误...虽然我没有一个热门线索究竟是什么导致它。

我的问题是:我该如何完全消除噪音?

我知道正确的数据具有彼此相邻的点并且非常紧凑和有序(没有间隙)并且是闭环或多个循环。 第一种类型的噪声通常是稀疏和随机的,通过检查下一个噪声点是否也被计为边缘,可以很容易地处理。 如果没有,那么这一点最具挑衅性,应予以删除。

然而,第二种类型的噪声,其中我们有一个关于x = y的半连续线造成更多的问题。 该线有时是连续的随机长度(最长的是它在我的整个阵列的一半未经破坏)。 它甚至可以与实际边缘相交。

关于如何做到这一点的任何想法?

I recently wrote an extremely basic edge detection algorithm that works on an array of chars. The program was meant to detect the edges of blobs of a single particular value on the array and worked by simply looking left, right, up and down on the array element and checking if one of those values is not the same as the value it was currently looking at. The goal was not to produce a mathematical line but rather a set of ordered points that represented a descritized closed loop edge.

The algorithm works perfectly fine, except that my data contained a bit of noise hence would randomly produce edges where there should be no edges. This in turn wreaked havoc on some of my other programs down the line.

There is two types of noise that the data contains. The first type is fairly sparse and somewhat random. The second type is a semi continuous straight line on the x=y axis. I know the source of the first type of noise, its a feature of the data and there is nothing i can do about it. As for the second type, i know it's my program's fault for causing it...though i haven't a hot clue exactly what is causing it.

My question is: How should I go about removing the noise completely?

I know that the correct data has points that are always beside each other and is very compact and ordered (with no gaps) and is a closed loop or multiple loops. The first type of noise is usually sparse and random, that could be easily taken care of by checking if any edges is next that noise point is also counted as an edge. If not, then the point is most defiantly noise and should be removed.

However, the second type of noise, where we have a semi continuous line about x=y poses more of a problem. The line is sometimes continuous for random lengths (the longest was it went half way across my entire array unbroken). It is even possible for it to intersect the actual edge.

Any ideas on how to do this?

最满意答案

通常在图像处理中使用中值滤波器。

你也常常做一个扩张(使线条更大)而不是腐蚀(使线条更细)来封闭线条中的任何间隙

Normally in image processing a median filter.

You also often do a dilate (make lines bigger) than an erode (make lines thinner) to close up any gaps in the lines

更多推荐

本文发布于:2023-07-18 10:01:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1158549.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:噪声   算法   边缘   cleaning   algorithm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!