卡尼萨三角_找到边缘卡尼和索贝尔探测器第1部分

本文介绍了卡尼萨三角的概念,它是图像处理中用于边缘检测的一种方法。内容涉及卡尼和索贝尔检测器的基础知识,探讨了在Python中实现边缘检测的技术。
摘要由CSDN通过智能技术生成

卡尼萨三角

While working on a project for Real-Time Road Lane Detection, I sat down to learn about various edge detection techniques. I came across some rather fascinating algorithms called “Canny Edge Detection and Sobel Edge Operator”. In the spirit of reinforcing my understanding by explaining, I decided to cover the topic: What are Canny and Sobel Edge Detectors, and how do they work?

在从事实时行车道检测项目时,我坐下来学习各种边缘检测技术。 我遇到了一些非常有趣的算法,称为“ Canny Edge Detection和Sobel Edge Operator”。 本着通过解释来加强理解的精神,我决定涵盖以下主题:什么是Canny和Sobel Edge Detector,它们如何工作?

The Canny Edge Detector is an edge detection operator that is used to detect a wide range of edges in images. It uses a multi-stage algorithm to do so.

Canny Edge Detector是一种边缘检测运算符,用于检测图像中的各种边缘。 它使用多阶段算法来执行此操作。

Image for post
https://en.wikipedia.org/wiki/Canny_edge_detector -https://en.wikipedia.org/wiki/Canny_edge_detector

The Sobel operator is used in image processing and computer vision, particularly within edge detection algorithms where it creates an image emphasising edges.

Sobel运算符用于图像处理和计算机视觉,尤其是在边缘检测算法中,在其中创建强调边缘的图像。

Image for post
https://en.wikipedia.org/wiki/Sobel_operator : //en.wikipedia.org/wiki/Sobel_operator

Edge detection is simply the case of finding regions in an image, where we have a sharp change in intensity. These changes happen between the boundaries of an object in the image, what we’d refer to as an “edge” in 3d space, and so the terminology carries over to an image as well.

边缘检测只是在图像中找到区域的情况,在这些区域中我们的强度发生了急剧变化。 这些变化发生在图像中对象的边界之间,我们称之为3d空间中的“边缘”,因此术语也适用于图像。

The process of edge detection is carried out in three simple steps i.e image smoothening, edge point detection and edge localisation. We will see these steps applied to the canny as well as the sobel edge detector as we move on with this article.

边缘检测的过程通过三个简单的步骤进行,即图像平滑,边缘点检测和边缘定位。 随着本文的继续,我们将看到这些步骤适用于Canny以及sobel边缘检测器。

The Canny Edge Detector was published in 1986 by John F.Canny. It is a technique that is used to extract the structural information from various vision objects and reduce significantly the amount of data that is to be processed. It has been widely used in computer vision systems.

坎尼边缘检测器由约翰·范尼(John F.Canny)于1986年出版。 它是一种用于从各种视觉对象中提取结构信息并显着减少要处理的数据量的技术。 它已被广泛用于计算机视觉系统。

The Sobel Edge Operator is named after Irwin Sobel and Gary Feldman, who presented the idea of an “Isotropic 3x3 Image Gradient Operator” at a talk at SAIL(Stanford Artificial Intelligence Laboratory) in 1968. This method calculates the approximate gradient of the image intensity at each point of an image by convolution with an integer value filter.

Sobel Edge Operator以Irwin Sobel和Gary Feldman的名字命名,他们在1968年在SAIL(斯坦福人工智能实验室)的一次演讲中提出了“各向同性3x3图像梯度算子”的概念。这种方法计算出图像强度的近似梯度。在图像的每个点上通过与整数过滤器进行卷积来实现。

There are many other edge detection operators such as Sobel, Prewitt, Laplacian, etc. Out of these algorithms, efficiency of Canny and Sobel edge detection algorithms is higher than other algorithms.

还有许多其他边缘检测运算符,例如Sobel,Prewitt,Laplacian等。在这些算法中,Canny和Sobel边缘检测算法的效率高于其他算法。

Canny Edge Operator handily produces an orientation at every point which can be very useful for the post-processing of the image. The Canny edge detector takes the Sobel edge operator and makes it just a step better. What I mean by that is, we can get rid of the edges which we aren’t interested in and keep only the ones that are useful to us. Canny works by taking the output image of the Sobel Operator and thinning the edges so that they are just 1 pixel wide.

Canny Edge Operator可以在每个点方便地生成方向,这对于图像的后处理非常有用。 Canny边缘检测器采用了Sobel边缘算子,使其变得更好了。 我的意思是,我们可以摆脱不感兴趣的边缘,而只保留对我们有用的边缘。 Canny的工作方式是拍摄Sobel算子的输出图像并细化边缘,使其仅1像素宽。

So let me first start by briefing you about the Sobel Edge Operator.

因此,首先让我向您简要介绍Sobel Edge Operator。

In the Sobel Edge Detector, the image is processed in both the X and Y directions. This forms a new image which would be the sum of X and Y edges of the image. Keep in mind that these can be processed separately as well.

Sobel Edge Detector中,图像在X和Y方向上都得到处理。 这形成一个新图像,该图像将是图像的X和Y边缘的总和。 请记住,这些也可以分别处理。

We start off by converting the image from an RGB scale to a Grayscale image. Then from there, we shall use what is called kernel convolution. There are various pairs of Sobel operators such as 3×3, 5x5 convolution.

我们首先将图像从RGB比例转换为灰度图像。 然后从那里开始,我们将使用所谓的内核卷积。 有各种Sobel算子对,例如3×3、5x5卷积。

In this case, I shall refer to a kernel (3x3) matrix, consisting of differently weighted indexes. This will represent the filter that we will be implementing for edge detection.

在这种情况下,我将参考由不同加权索引组成的内核(3x3)矩阵。 这将代表我们将为边缘检测实现的过滤器。

When we want to scan across the X direction of an image, for example, we will want to use the following X Direction Kernel to scan for large changes in the gradient and vice versa.

例如,当我们想在图像的X方向上进行扫描时,我们将要使用以下X方向内核来扫描梯度的大变化,反之亦然。

Image for post
https://www.projectrhea.org/rhea/index.php/An_Implementation_of_Sobel_Edge_Detection : //www.projectrhea.org/rhea/index.php/An_Implementation_of_Sobel_Edge_Detection

The kernels applied to the input image, produce separate gradient component measurements in each orientation (Gx and Gy). The magnitude of the gradient at every pixel and the direction of the gradient is computed by combining Gx and Gy together.

应用于输入图像的核在每个方向(Gx和Gy)上产生单独的梯度分量测量值。 通过将Gx和Gy组合在一起,可以计算每个像素处的梯度大小和方向。

Image for post
https://file.scirp.org/Html/5-9301774_42100.htm ://file.scirp.org/Html/5-9301774_42100.htm

A pictorial representation below will explain what i stated above wrt X and Y direction.

下面的图片表示将解释我在X和Y方向上所讲的内容。

Image for post
https://www.projectrhea.org/rhea/index.php/An_Implementation_of_Sobel_Edge_Detection : //www.projectrhea.org/rhea/index.php/An_Implementation_of_Sobel_Edge_Detection

The image below is when the two filter results are added together to create an accurate representation of all of the edges (X and Y Direction) in the image.

下图是将两个滤镜结果加在一起以创建图像中所有边缘(X和Y方向)的精确表示时的图像。

Image for post
https://www.projectrhea.org/rhea/index.php/An_Implementation_of_Sobel_Edge_Detection : //www.projectrhea.org/rhea/index.php/An_Implementation_of_Sobel_Edge_Detection
Image for post

There is tons more to discuss, but it’ll be a bit too much for a single article, so I have decided to make it a two part series. We’ll be getting into the comparisons of the two filters, a little more of the math behind it, and finally the code for it. Stay tuned for part two!

还有很多要讨论的内容,但是对于一篇文章来说,这太多了,所以我决定将其分为两部分。 我们将进行两个过滤器的比较,它背后的一些数学运算以及最后的代码。 请继续关注第二部分!

翻译自: https://medium.com/srm-mic/finding-the-edge-canny-and-sobel-detectors-part-1-65a59b7ef62a

卡尼萨三角

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值