• 回答数

    4

  • 浏览数

    303

Yun云2870
首页 > 期刊论文 > canny边缘检测论文

4个回答 默认排序
  • 默认排序
  • 按时间排序

queenielove多儿

已采纳

Canny边缘检测是一种使用多种边缘检测算法检测边缘的方法。由John 于1986年提出,并在论文中有详尽的描述。 1)去噪。噪声会影响边缘检测的准确度。通常采用高斯滤波去除图像中的噪声。滤波器的核越大,边缘信息对噪声的敏感度就越低。不过,核越大,边缘检测的定位错误也会随之增加。通常一个5 X 5的核能满足大多数情况。 2)计算梯度的幅度与方向。梯度的方向与边缘的方向是垂直的,通常就取近似值为·水平、垂直、对角线等八个不同的方向。 3)非极大值抑制,即适当地让边缘变瘦。在获得了梯度的幅度和方向后,遍历图像中的像素点,去除所有非边缘的点。具体实现上,判断当前像素点是否是周围像素点中具有相同梯度方向的最大值,如果是,则保留该点;如果不是则抑制(归零)。 4)确定边缘。用双阈值算法确定最终的边缘信息。完成之前三步骤后,图像的强边缘已经在当前获取的边缘图像内。但一些虚边缘可能也在边缘图像内,这些虚边缘可能是真实的图像产生的,也可能是由于噪声产生的(必须将其剔除)。         设置两个阈值,其中一个为高阈值maxVal,另一个为低阈值minVal。根据当前边缘像素的梯度值与这两个阈值之间的关系,判断边缘的属性。如果当前边缘像素的梯度值不小于maxVal,则将当前边缘像素标记为强边缘;如果介于maxVal与minVal之间,则标记为弱边缘(先保留);如果小于minVal,则抑制当前边缘像素。之后再判断虚边缘是否与强边缘有连接,有连接,则处理为边缘;无连接则抑制。 OpenCV提供了()来实现边缘检测:dst : 为计算得到的边缘图像 image: 为8位输入图像 threshold1: 表示处理过程中的的第一个阈值 threshold2: 表示处理过程中的的第二个阈值 apertureSize: 表示Sobel算子的孔径大小。 L2gradient: 为计算图像梯度幅度的标识。其默认值是False。如果为True,则使用更精确的L2范数进行计算,否则使用L1范数。 例如:

82 评论

風雨飘零

目标检测(object detection)是计算机视觉中非常重要的一个领域。在卷积神经网络出现之前,都利用一些传统方法手动提取图像特征进行目标检测及定位,这些方法不仅耗时而且性能较低。而在卷积神经网络出现之后,目标检测领域发生了翻天覆地的变化。最著名的目标检测系统有RCNN系列、YOLO和SSD,本文将介绍RCNN系列的开篇作RCNN。 RCNN系列的技术演进过程可参见 基于深度学习的目标检测技术演进:R-CNN、Fast R-CNN、Faster R-CNN 。 目标检测分为两步:第一步是对图像进行分类,即图像中的内容是什么;第二步则是对图像进行定位,找出图像中物体的具体位置。简单来说就是图像里面有什么,位置在哪。 然而,由于不同图片中物体出现的大小可能不同(多尺度),位置也可能不同,而且摆放角度,姿态等都可以不同,同时一张图片中还可以出现多个类别。这使得目标检测任务异常艰难。上面任务用专业的说法就是:图像识别+定位两个不同的分支分别完成不同的功能,分类和定位。回归(regression)分支与分类分支(classification)共享网络卷积部分的参数值。 还是刚才的分类识别+回归定位思路。只是现在我们提前先取好不同位置的框,然后将这个框输入到网络中而不是像思路一将原始图像直接输入到网络中。然后计算出这个框的得分,取得分最高的框。 如上,对于同一个图像中猫的识别定位。分别取了四个角四个框进行分类和回归。其得分分别为,因此右下角得分最高,选择右下角的黑框作为目标位置的预测(这里即完成了定位任务)。 这里还有一个问题——检测位置时的框要怎么取,取多大?在上面我们是在257x257的图像中取了221x221的4个角。以不同大小的窗口从左上角到右下角依次扫描的话,数据量会非常大。而且,如果考虑多尺度问题的话,还需要在将图像放缩到不同水平的大小来进行计算,这样又大大增加了计算量。如何取框这个问题可以说是目标检测的核心问题之一了,RCNN,fast RCNN以及faster RCNN对于这个问题的解决办法不断地进行优化,这个到了后面再讲。 总结一下思路: 对于一张图片,用各种大小的框将图片截取出来,输入到CNN,然后CNN会输出这个框的类别以及其位置得分。 对于检测框的选取,一般是采用某种方法先找出可能含有物体的框(也就是候选框,比如1000个候选框),这些框是可以互相重叠互相包含的,这样我们就可以避免暴力枚举所有框了。讲完了思路,我们下面具体仔细来看看RCNN系列的实现,本篇先介绍RCNN的方法。 R-CNN相比于之前的各种目标检测算法,不仅在准确率上有了很大的提升,在运行效率上同样提升很大。R-CNN的过程分为4个阶段: 在前面我们已经简单介绍了selective search方法,通过这个方法我们筛选出了2k左右的候选框。然而搜索出的矩形框大小是不同的。而在AlexNet中由于最后全连接层的存在,对于图像尺寸有固定的要求,因此在将候选框输入之前,作者对这些候选框的大小进行了统一处理——放缩到了统一大小。文章中作者使用的处理方法有两种: (1)各向异性缩放因为图片扭曲可能会对后续CNN模型训练产生影响,于是作者也测试了各向同性缩放的方法。有两种方法: 此外,作者对于bounding box还尝试了padding处理,上面的示意图中第1、3行就是结合了padding=0,第2、4行结果采用padding=16的结果。经过最后的试验,作者发现采用各向异性缩放、padding=16的精度最高。 卷积神经网络训练分为两步:(1)预训练;(2)fine-tune。 先在一个大的数据集上面训练模型(R-CNN中的卷机模型使用的是AlexNet),然后利用这个训练好的模型进行fine-tune(或称为迁移学习),即使用这个预训练好的模型参数初始化模型参数,然后在目标数据集上面进行训练。 此外,在训练时,作者还尝试采用不同层数的全连接层,发现一个全连接层比两个全连接层效果要好,这可能是因为使用两个全连接层后过拟合导致的。 另一个比较有意思的地方是:对于CNN模型,卷积层学到的特征其实就是基础的共享特征提取层,类似于传统的图像特征提取算法。而最后的全连接层学到的则是针对特定任务的特征。譬如对于人脸性别识别来说,一个CNN模型前面的卷积层所学习到的特征就类似于学习人脸共性特征,然后全连接层所学习的特征就是针对性别分类的特征了。 最后,利用训练好的模型对候选框提取特征。 关于正负样本的问题:由于选取的bounding box不可能与人工label的完全相同,因此在CNN训练阶段需要设置IOU阈值来为bounding box打标签。在文章中作者将阈值设置为,即如果候选框bounding box与人工label的区域重叠面积大于,则将其标注为物体类别(正样本),否则我们就把他当做背景类别(负样本)。 作者针对每一个类别都训练了一个二分类的SVM。这里定义正负样本的方法与上面卷积网络训练的定义方法又不相同。作者在文章中尝试了多种IoU阈值()。最后通过训练发现,IoU阈值为的时候效果最好(选择为0精度下降了4个百分点,选择精度下降了5个百分点)。即当IoU小于的时候我们将其视为负样本,否则为正样本。 目标检测问题的衡量标准是重叠面积:许多看似准确的检测结果,往往因为候选框不够准确,重叠面积很小。故需要一个位置精修步骤。在实现边界回归的过程中发现了两个微妙的问题。第一是正则化是重要的:我们基于验证集,设置λ=1000。第二个问题是,选择使用哪些训练对(P,G)时必须小心。直观地说,如果P远离所有的检测框真值,那么将P转换为检测框真值G的任务就没有意义。使用像P这样的例子会导致一个无望的学习问题。因此,只有当提案P至少在一个检测框真值附近时,我们才执行学习任务。“附近”即,将P分配给具有最大IoU的检测框真值G(在重叠多于一个的情况下),并且仅当重叠大于阈值(基于验证集,我们使用的阈值为)。所有未分配的提案都被丢弃。我们为每个目标类别执行一次,以便学习一组特定于类别的检测框回归器。 在测试时,我们对每个提案进行评分,并预测其新的检测框一次。原则上,我们可以迭代这个过程(即重新评估新预测的检测框,然后从它预测一个新的检测框,等等)。但是,我们发现迭代不会改进结果。 使用selective search的方法在测试图片上提取2000个region propasals ,将每个region proposals归一化到227x227,然后再CNN中正向传播,将最后一层得到的特征提取出来。然后对于每一个类别,使用为这一类训练的SVM分类器对提取的特征向量进行打分,得到测试图片中对于所有region proposals的对于这一类的分数,再使用贪心的非极大值抑制(NMS)去除相交的多余的框。再对这些框进行canny边缘检测,就可以得到bounding-box(then B-BoxRegression)。 参考: Rich feature hierarchies for accurate object detection and semantic segmentation. RCNN-将CNN引入目标检测的开山之作-晓雷的文章 基于深度学习的目标检测技术演进:R-CNN、Fast R-CNN、Faster R-CNN R-CNN 论文翻译

245 评论

我是五叶神

边缘检测是图像处理的重要基础算法。它是许多高阶的图像算法(例如轮廓检测,目标检测)的基础。Canny边缘检测算法是OpenCV中使用的边缘检测算法,由John F. Canny在1986年提出。由于它出色的检测和容错能力,至今一直被广泛使用。Canny边缘检测具有以下特点: 那么Canny边缘检测为什么会有出色的性能?这和它的实现有着很大关系,Canny边缘检测主要分为以下几个步骤: 因为边缘检测容易受到图像中的噪点影响,所以在边缘检测之前通常需要对图像进行降噪处理。这里我们使用高斯滤波进行降噪。关于高斯滤波可以参考 这里 。 如何确定图像的边缘?图像的边缘像素的灰度值通常会有剧烈变化。而梯度可以用来衡量灰度值变化的大小和方向。图像在x, y方向的梯度值可以通过点乘下面的Sobel算子得到: 在得到x, y方向的梯度值以后,通过以下公式计算出方向梯度值: 高斯滤波在降噪的同时,边缘也有可能被放大。引入非最大值抑制就是为了解决这个问题,使得检测出的边缘更细(窄)。 即:如果一个像素点属于边缘,那么这个像素点在梯度方向上的梯度值是必须是最大的。 如下图所示,A是在图像的边缘上的点,计算出的梯度方向垂直于边缘。B和C在梯度方向上,这时我们比较A和B,C的灰度值,如果A比B和C都大,则选取A作为结果。如果A比B或者C小,则将A的值设为0。 为了确定最终的边缘,我们需要设定一个阈值来挑选出足够“像”边缘的点,即它的梯度值要足够大。但如果设定单一阈值,最终的检测精度就非常依赖于阈值设定,过大或者过小的阈值都会让结果偏离预期。而Canny边缘检测算法设置两个阀值,分别为maxVal和minVal。其中大于maxVal的都被检测为边缘,而低于minval的都被检测为非边缘。对于中间的像素点,如果与确定为边缘的像素点邻接,则判定为边缘;否则为非边缘。这样有效地提高了检测精度。 OpenCV中提供了Canny边缘检测的实现。我们直接调用 Canny() 函数即可

328 评论

猫猫的习惯

Canny边缘检测教程 Author: Bill Green (2002) 作者:比尔绿色( 2002 ) HOME EMAIL 主页 电子邮件 This tutorial assumes the reader: 本教程假定读者: (1) Knows how to develop source code to read raster data ( 1 )知道如何发展的源代码阅读栅格数据 (2) Has already read my Sobel edge detection tutorial ( 2 )已经阅读我Sobel边缘检测教程 This tutorial will teach you how to:本教程将教你如何: (1) Implement the Canny edge detection algorithm. ( 1 )实施Canny边缘检测算法。 INTRODUCTION 导言 Edges characterize boundaries and are therefore a problem of fundamental importance in image processing.边的特点,因此,边界问题,根本的重要性在图像处理中。 Edges in images are areas with strong intensity contrasts – a jump in intensity from one pixel to the next.在图像的边缘地区,强度强的反差-一个跳转的强度从一个像素的下一个。 Edge detecting an image significantly reduces the amount of data and filters out useless information, while preserving the important structural properties in an image. This was also stated in my Sobel and Laplace edge detection tutorial, but I just wanted reemphasize the point of why you would want to detect edges.边缘检测的图像大大减少了大量的数据,并过滤掉无用的信息,同时保持重要的结构性能的形象。这也是我在索贝尔和拉普拉斯边缘检测教程,但我只是想再次强调这一点的,为什么你会要检测的边缘。 The Canny edge detection algorithm is known to many as the optimal edge detector. Canny's intentions were to enhance the many edge detectors already out at the time he started his work.的Canny边缘检测算法是众所周知的许多人视为最佳边缘检测。坎尼的意图是要加强许多先进的探测器已经在的时候,他开始他的工作。 He was very successful in achieving his goal and his ideas and methods can be found in his paper, " A Computational Approach to Edge Detection ".他很成功地实现他的目标和他的思想和方法中可以找到他的论文“ 计算方法的边缘检测 ” 。 In his paper, he followed a list of criteria to improve current methods of edge detection.在他的文件中,他遵循的标准清单,以改善目前的边缘检测方法。 The first and most obvious is low error rate.第一个也是最明显的错误率低。 It is important that edges occuring in images should not be missed and that there be NO responses to non-edges.重要的是,发生在图像边缘不应错过的,没有任何反应,非边缘。 The second criterion is that the edge points be well localized. In other words, the distance between the edge pixels as found by the detector and the actual edge is to be at a minimum.第二个标准是,边缘点很好地本地化。换言之,之间的距离边缘像素作为探测器发现和实际边缘要在最低限度。 A third criterion is to have only one response to a single edge.第三个标准是,只有一个回应单一优势。 This was implemented because the first 2 were not substantial enough to completely eliminate the possibility of multiple responses to an edge.这是第一次实施,因为并没有实质性的2足以完全消除的可能性,多反应的优势。 Based on these criteria, the canny edge detector first smoothes the image to eliminate and noise.根据这些标准, Canny边缘检测器的第一个平滑的图像,以消除和噪音。 It then finds the image gradient to highlight regions with high spatial derivatives.然后认定的形象,以突出地区梯度高空间衍生物。 The algorithm then tracks along these regions and suppresses any pixel that is not at the maximum (nonmaximum suppression).该算法然后轨道沿着这些地区和抑制任何像素这不是在最高( nonmaximum制止) 。 The gradient array is now further reduced by hysteresis.梯度阵列现在进一步减少滞后。 Hysteresis is used to track along the remaining pixels that have not been suppressed.磁滞用来追踪沿其余像素,但没有压制。 Hysteresis uses two thresholds and if the magnitude is below the first threshold, it is set to zero (made a nonedge).磁滞使用两个阈值,如果规模低于第一道门槛,这是设置为零(发了nonedge ) 。 If the magnitude is above the high threshold, it is made an edge.如果是规模以上的高门槛,这是一个优势。 And if the magnitude is between the 2 thresholds, then it is set to zero unless there is a path from this pixel to a pixel with a gradient above T2.如果震级之间的2阈值,那么它设置为零,除非有一条从这个像素一个像素的梯度上述时刻。 Step 1 第1步 In order to implement the canny edge detector algorithm, a series of steps must be followed.为了落实Canny边缘检测算法,一系列步骤必须遵循。 The first step is to filter out any noise in the original image before trying to locate and detect any edges.第一步是筛选出任何噪音的原始图像在寻找和发现任何边缘。 And because the Gaussian filter can be computed using a simple mask, it is used exclusively in the Canny algorithm.而且因为高斯滤波器可以用一个简单的计算面具,它是专门用于在Canny算法。 Once a suitable mask has been calculated, the Gaussian smoothing can be performed using standard convolution methods.一旦合适的面罩已计算,高斯平滑可以用标准的卷积方法。 A convolution mask is usually much smaller than the actual image.阿卷积掩模通常远远小于实际的形象。 As a result, the mask is slid over the image, manipulating a square of pixels at a time. The larger the width of the Gaussian mask, the lower is the detector's sensitivity to noise .因此,该面具是下跌的形象,操纵一个正方形的像素上。 较大的宽度高斯面具,较低的是探测器的敏感性噪音 。 The localization error in the detected edges also increases slightly as the Gaussian width is increased.定位误差检测边缘也略有增加的高斯宽度增加。 The Gaussian mask used in my implementation is shown below.高斯遮罩使用我在执行下面显示。 Step 2 第2步 After smoothing the image and eliminating the noise, the next step is to find the edge strength by taking the gradient of the image.经过平滑的形象,消除噪音,下一步就是要找到优势兵力,采取梯度的形象。 The Sobel operator performs a 2-D spatial gradient measurement on an image.的Sobel算子进行二维空间梯度测量的形象。 Then, the approximate absolute gradient magnitude (edge strength) at each point can be found.然后,大约绝对梯度幅度(边缘强度)各点可以找到。 The Sobel operator uses a pair of 3x3 convolution masks, one estimating the gradient in the x-direction (columns) and the other estimating the gradient in the y-direction (rows). Sobel算子的使用对3x3卷积口罩,一个梯度估计在X方向(栏)和其他的梯度估计的Y方向(行) 。 They are shown below:它们如下所示: The magnitude, or EDGE STRENGTH, of the gradient is then approximated using the formula:的规模,或EDGE强度,梯度近似然后使用公式: |G| = |Gx| + |Gy| | G | = | GX的| + |戈瑞| Step 3 第3步 Finding the edge direction is trivial once the gradient in the x and y directions are known.寻找边缘方向是小事,一旦梯度在X和Y方向是众所周知的。 However, you will generate an error whenever sumX is equal to zero.然而,你会产生错误时sumX等于零。 So in the code there has to be a restriction set whenever this takes place.因此,在代码中必须有一个限制规定只要发生。 Whenever the gradient in the x direction is equal to zero, the edge direction has to be equal to 90 degrees or 0 degrees, depending on what the value of the gradient in the y-direction is equal to.每当梯度在x方向等于零,边缘的方向,必须等于90度或0度,取决于什么的价值梯度的Y方向等于。 If GY has a value of zero, the edge direction will equal 0 degrees.如果青的值为零,边缘方向将等于0度。 Otherwise the edge direction will equal 90 degrees.否则边缘方向将等于90度。 The formula for finding the edge direction is just:公式为寻找边缘方向是: theta = invtan (Gy / Gx)论旨= invtan (戈瑞/ GX的) Step 4 第4步 Once the edge direction is known, the next step is to relate the edge direction to a direction that can be traced in an image.一旦边缘方向众所周知,下一步是与边缘方向为方向,可以追溯到在一个图像。 So if the pixels of a 5x5 image are aligned as follows:因此,如果一个5x5像素图像对齐如下: x x x x x x x x x x x x x x x x x x x x x x a x x x x 1 x x x x x x x x x x x x x x x x x x x x x x Then, it can be seen by looking at pixel " a ", there are only four possible directions when describing the surrounding pixels - 0 degrees (in the horizontal direction), 45 degrees (along the positive diagonal), 90 degrees (in the vertical direction), or 135 degrees (along the negative diagonal).然后,可以看到看像素的“ A ” ,只有4个可能的方向时,描述了周围的像素- 0度 (水平方向) , 45度 (沿积极对角线) , 90度 (垂直方向) ,或135度 (沿负对角线) 。 So now the edge orientation has to be resolved into one of these four directions depending on which direction it is closest to (eg if the orientation angle is found to be 3 degrees, make it zero degrees).所以,现在的边缘方向已经得到解决纳入其中四个方向取决于哪个方向,它是最接近于(如角被发现有3度,使零摄氏度) 。 Think of this as taking a semicircle and dividing it into 5 regions.认为这是采取了半圆形和分裂成5个地区。 Therefore, any edge direction falling within the yellow range (0 to & to 180 degrees) is set to 0 degrees.因此,任何先进的方向范围内的黄色范围 ( 0至5月22日& 至180度)设置为0度。 Any edge direction falling in the green range ( to degrees) is set to 45 degrees. Any edge direction falling in the blue range ( to degrees) is set to 90 degrees.任何先进的方向下滑的绿色范围 ( 至度)设置为45度。任何优势的方向下滑的蓝色范围 ( 至度)设置为90度。 And finally, any edge direction falling within the red range ( to degrees) is set to 135 degrees.最后,任何先进的方向范围内的红色范围 ( 到度)设置为135度。 Step 5 第5步 After the edge directions are known, nonmaximum suppression now has to be applied. Nonmaximum suppression is used to trace along the edge in the edge direction and suppress any pixel value (sets it equal to 0) that is not considered to be an edge. This will give a thin line in the output image.在被称为边缘方向, nonmaximum抑制现在必须适用。 Nonmaximum抑制是用来追踪沿边缘方向和制止任何像素值(套等于0 )这是不被认为是优势。这将给细线的输出图像。 Step 6 第6步 Finally, hysteresis is used as a means of eliminating streaking.最后,滞后是用来作为一种手段,消除条纹。 Streaking is the breaking up of an edge contour caused by the operator output fluctuating above and below the threshold.裸奔是打破的边缘轮廓线的经营者造成的产量波动上面和下面的门槛。 If a single threshold, T1 is applied to an image, and an edge has an average strength equal to T1, then due to noise, there will be instances where the edge dips below the threshold.如果一个门槛, T1讯号适用于图像,并具有优势的平均强度相等的T1 ,然后由于噪声,将有情况下,边逢低低于阈值。 Equally it will also extend above the threshold making an edge look like a dashed line.同样它也将延长超过阈值决策的优势看起来像一个虚线。 To avoid this, hysteresis uses 2 thresholds, a high and a low.为了避免这种情况,滞后使用2的门槛,高和低。 Any pixel in the image that has a value greater than T1 is presumed to be an edge pixel, and is marked as such immediately.任何像素的图像,其值大于表# t1推定为边缘像素,并标示为这种立即。 Then, any pixels that are connected to this edge pixel and that have a value greater than T2 are also selected as edge pixels.然后,任何像素连接到这个边缘像素,并有一个值大于时刻还选定为边缘像素。 If you think of following an edge, you need a gradient of T2 to start but you don't stop till you hit a gradient below T1.如果您认为以下的优势,您需要一个梯度的时刻开始,但你不停止直到触及梯度低于表# t1 。 You are visitor number: 你是第位访客人数:

301 评论

相关问答

  • 边缘检测阈值的确定毕业论文

    很高兴为您解答。edge函数检测边缘的阈值在edge的第三个参数设定EI = edge(I,"Canny",0.5);这里I是要做边缘检测的图像,Canny是所

    西关少爷Billy 2人参与回答 2023-12-05
  • 图像边缘检测的sci论文

    Figure里面的图片主要包括 位图 和 矢量图 两种。 1. 位图 ,一般是由显微镜、照相机等等直接获取的实验图像,其特征是放大之后,图片会模糊;图片像素

    胖小咪咪 3人参与回答 2023-12-07
  • 医学图像边缘检测论文

    (部分)张冬至,胡国清,夏伯锴,基于模态辨识的原油含水率智能组合测量模型[J],华南理工大学学报,2009, Vol.37, pp73~78郭强,吕浩杰,胡国清

    小老头and小胖子 2人参与回答 2023-12-07
  • 数字图像处理边缘检测论文

    摘 要 针对基于PC实现的图像边缘检测普遍存在的执行速度慢、不能满足实时应用需求等缺点,本文借助于TI公司的TMS320DM642图像处理芯片作为数字图像处

    调皮捣蛋妈 2人参与回答 2023-12-06
  • canny边缘检测论文

    Canny边缘检测是一种使用多种边缘检测算法检测边缘的方法。由John F.Canny于1986年提出,并在论文中有详尽的描述。 1)去噪。噪声会影响边缘检

    Yun云2870 4人参与回答 2023-12-09