资源描述
Click to edit the title text format,Second Level,Third Level,Fourth Level,Fifth Level,机器人与信息自动化研究所,Click to edit the title text format,*,*,单击此处编辑母版标题样式,Click to edit the title text format,Second Level,Third Level,Fourth Level,Fifth Level,*,深圳大学光电子研究所,Institute of Robotics and Automatic Information System,Click to edit the title text format,Institute of Robotics and Automatic Information System,Click to edit the title text format,Click to edit the title text format,Second Level,Third Level,Fourth Level,Fifth Level,深圳大学光电子研究所,Click to edit the title text format,*,/,机器视觉及应用,李东,lidong,边缘检测(,Edge detection,),Goal:Identify sudden changes(discontinuities)in an image,Intuitively,most semantic and shape information from the image can be encoded in the edges,More compact than pixels,Ideal:artists line drawing(but artist is also using object-level knowledge),Why do we care about edges?,Extract information,recognize objects,Recover geometry and viewpoint,Vanishing,point,Vanishing,line,Vanishing,point,Vertical vanishing,point,(at infinity),Origin of Edges,Edges are caused by a variety of factors,depth discontinuity,surface color discontinuity,illumination discontinuity,surface normal discontinuity,Closeup of edges,Closeup of edges,Closeup of edges,Closeup of edges,Characterizing edges,An edge is a place of rapid change in the image intensity function,image,intensity function(along horizontal scanline),first derivative,edges correspond toextrema of derivative,边缘检测,边缘是,图像上灰度的不连续点,,或者是,灰度变化剧烈处,边缘的数学表达:信号一阶微分最大值,/,两阶微分过零点,a,:原始信号,b,:一阶微分,c,:二阶微分,对于二维图像,f(x,y),,梯度定义为:,一阶微分是梯度的模:,二阶微分应理解为沿梯度方向的二阶方向导数,计算比较复杂,一般采用两阶微分算子(拉普拉斯算子)表示,拉普拉斯算子具有各向同性,梯度,(gradient),使用,梯度,(gradient),描述图像函数的变化,梯度方向是图像函数增长最大的方向,Intensity profile,With a little Gaussian noise,Gradient,Effects of noise,Consider a single row or column of the image,Plotting intensity as a function of position gives a signal,Where is the edge?,Effects of noise,Difference filters respond strongly to noise,Image noise results in pixels that look very different from their neighbors,Generally,the larger the noise the stronger the response,What can we do about it?,Solution:smooth first,To find edges,look for peaks in,f,g,f*g,Differentiation is convolution,and convolution is associative:,This saves us one operation:,Derivative theorem of convolution,f,Sobel,算子,Prewitt,算子,Roberts,算子,图像梯度算子的近似,Prewitt,算子,-1,0,1,-1,0,1,-1,0,1,计算均值,,平滑噪声,检测竖直边缘,-1,-1,-1,0,0,0,1,1,1,计算均值,,平滑噪声,检测水平边缘,Prewitt,算子,近似一阶微分,卷积模版:去噪,+,增强边缘,Sobel,算子,-1,0,1,-2,0,2,-1,0,1,计算均值,,平滑噪声,检测竖直边缘,-1,-2,-1,0,0,0,1,2,1,计算均值,,平滑噪声,检测水平边缘,Sobel,算子,近似一阶微分,去噪,+,增强边缘,给四邻域更大的权重,常见的梯度算子,(a):Roberts,算子,(b):3x3 Prewitt,算子,(c):Sobel,算子,(d):4x4 Prewitt,算子,拉普拉斯算子,拉普拉斯算子,首先用,Gauss,函数对图像进行平滑,抑制噪声,然后对经过平滑的图像使用,Laplacian,算子,利用卷积的性质,LoG,算子等效于:,Gaussian,平滑,+Laplacian,二阶微分,Laplacian of Gaussian(LoG),高斯拉普拉斯,Laplacian of Gaussian,operator,过零点为边缘的位置,在数字图像上实现,LoG,0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,16,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0,Prewitt,算子,Roberts,算子,Log,算子,Soble,算子,i=imread(miss.bmp);,i=i(:,:,1);,figure;,ro=edge(i,roberts);,imshow(1-ro);,figure;,pre=edge(i,prewitt);,imshow(1-pre);,figure;,so=edge(i,sobel);,imshow(1-so);,figure;,log=edge(i,log);,imshow(1-log);,matlab,:,edge,Derivative of Gaussian filter,*1-1=,Smoothed derivative removes noise,but blurs edge.Also finds edges at different“scales”.,1 pixel,3 pixels,7 pixels,Tradeoff between smoothing and localization,The gradient magnitude is large along a thick“trail”or“ridge,”so how do we identify the actual edge points?,How do we link the edge points to form curves?,Implementation issues,Designing an edge detector,Criteria for a good edge detector:,Good detection:the optimal detector should find all real edges,ignoring noise or other artifacts,Good localization,the edges detected must be as close as possible to the true edges,the detector must return one point only for each true edge point,Cues of edge detection,Differences in color,intensity,or texture across the boundary,Continuity and closure,High-level knowledge,Canny edge detector,This is probably the most widely used edge detector in computer vision,Theoretical model:step-edges corrupted by additive Gaussian noise,Canny has shown that the first derivative of the Gaussian closely approximates the operator that optimizes the product of,signal-to-noise ratio,and localization,J.Canny,A Computational Approach To Edge Detection,IEEE Trans.Pattern Analysis and Machine Intelligence,8:679-714,1986.,Note about Matlabs Canny detector,Small errors in implementation,Gaussian function not properly normalized,First filters with a Gaussian,then a difference of Gaussian(equivalent to filtering with a larger Gaussian and taking difference),Example,original image(Lena),Derivative of Gaussian filter,x,-direction,y,-direction,Compute Gradients(DoG),X-Derivative of Gaussian,Y-Derivative of Gaussian,Gradient Magnitude,Get Orientation at Each Pixel,Threshold at minimum level,Get orientation,theta=atan2(gy,gx),Non-maximum suppression for each orientation,At q,we have a maximum if the value is larger than those at both p and at r.Interpolate to get these values.,Before Non-max Suppression,After non-max suppression,Assume the marked point is an edge point.Then we construct the tangent to the edge curve(which is normal to the gradient at that point)and use this to predict the next points(here either r or s).,Edge linking,Hysteresis thresholding,Threshold at low/high levels to get weak/strong edge pixels,Do connected components,starting from strong edge pixels,Hysteresis thresholding,Check that maximum value of gradient value is sufficiently large,drop-outs?use hysteresis,use a high threshold to start edge curves and a low threshold to continue them.,Final Canny Edges,Canny edge detector,Filter image with x,y derivatives of Gaussian,Find magnitude and orientation of gradient,Non-maximum suppression:,Thin multi-pixel wide“ridges”down to single pixel width,Thresholding and linking(hysteresis):,Define two thresholds:low and high,Use the high threshold to start edge curves and the low threshold to continue them,MATLAB:edge(image,canny),Effect of,(,Gaussian kernel spread/size),Canny with,Canny with,original,The choice of,depends on desired behavior,large,detects large scale edges,small,detects fine features,渐增高斯滤波模版的尺寸,渐增双阈值的大小,保持,low=high*0.4,Learning to detect boundaries,Berkeley segmentation database:,www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/,image,human segmentation,gradient magnitude,45 years of boundary detection,Source:Arbelaez,Maire,Fowlkes,and Malik.TPAMI 2011(pdf),The End,
展开阅读全文