edge detection

The ideal case for edge will have a deep change, and the 1st derivation can be used for detecting purpose with looking for big absolute values, but in real word, ramp edges exist, well, the 2nd derivation produce a sign change, which can also be used for edge detection, shown as below.

这里写图片描述

However, it is not perfect in real world, some noise makes the trouble, the derivation operations on the contray amplify the noise.

这里写图片描述

So, usually, smothing is applied first before edge detection. Some edge detector(fileter) is designed to integrate the smothing element.
Edge detection is fundamental related to the gradient of the image. That is,

F=FxFyF=[F(x+1,y)F(x,y)F(x,y+1)F(x,y)]

The magnitude and orientation of pixel (x,y) is defined as,
M(x,y)=(Fx)2+(Fy)2

A(x,y)=atanFxFy

We can do things like,
M(x,y)>τ

|A(x,y)θ|<τ1,and,M(x,y)>τ2

The second equation can get the line of θ angle in the image.

Here briefly introduce three types edge detector(filter)s: sobel filter, LoG detector, canny detector.
1. Sobel filter

这里写图片描述

2. LoG detector(Laplacian of Gaussian)
The sobel filter has only one set of scale, by contrast, LoG can be tuned to detecting different scale of edges, LoG has the form as,

2G(x,y)=2x2G(x,y)+2y2G(x,y)=x2+y22σ2σ4ex2+y22σ2

The negative of LoG has the shape like this, and the σ parameter controls the body width of the function.

这里写图片描述

In LoG, 1) The Gaussian smooths the image down to a certain scale; 2) Laplacian finds edges at that scale; 3) LoG will look for zero-crossing of LoG operation since it is like a 2nd derivative. In matlab, function “fspecial” with “log” parameter works for it.

We can approximate the LoG with a difference of Gaussians(DoG), which is used a lot in computer vision(like SIFT)

DoG(x,y)=12πσ21ex2+y22σ2112πσ22ex2+y22σ22,σ1>σ2

3. canny detector
The basic steps of canny detector include:
1) Smooth image with a Gaussian;
2) Compute M(x,y),A(x,y) ;
3) Apply non-maxima suppression to M(x,y) to obtain a new gradient image gN(x,y)
the basic idea is to quantize A(x,y) into 4 bins, if M(x,y) is greater than both its neighbors in the quantized edge direction, gN(x,y)=M(x,y) , otherwise gN(x,y)=0
4) Detect and link edges

gH(x,y)=gN(x,y)τH

gL(x,y)=τLgN(x,y)<τH

respectively for strong and weak edges detection.
and the final map is gH(x,y) {all pixels in gL(x,y) that are adjacent to at least one pixel of gH(x,y) }
The canny edge detector usually has the cleaner result.

All three types edge detector can be realized with function “edge” in matlab.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值