Use the OpenCV function cv::Canny() to implement the Canny Edge Detector.
使用OpenCV函数:cv::Canny()来执行Canny边缘检测
Theory
The Canny Edge detector was developed by John F. Canny in 1986. Also known to many as the optimal detector, the Canny algorithm aims to satisfy three main criteria:
Low error rate: Meaning a good detection of only existent edges.
低错误率:意味着标识出尽可能的实际边缘,减小噪声产生的误报
Good localization: The distance between edge pixels detected and real edge pixels have to be minimized.
高定位性:检测出的边缘像素与实际的边缘像素差距尽可能的小
Minimal response: Only one detector response per edge.
最小响应:一个边缘只响应一次
Steps
1.Filter out any noise. The Gaussian filter is used for this purpose. An example of a Gaussian kernel of size=5 that might be used is shown below:
2.Find the intensity gradient of the image. For this, we follow a procedure analogous to Sobel:
第二步:计算图像的梯度。这一步按照Sobel算子的步骤进行计算。
a:Apply a pair of convolution masks (in x and y directions:
a:分别在X方向和Y方向上进行卷积操作:
b:Find the gradient strength and direction with:
Gx=⎡⎣⎢−1−2−1000+1+2+1⎤⎦⎥
Gy=⎡⎣⎢−10+1−20+2−10+1⎤⎦⎥
b:计算梯度值和方向:
G=G2x+G2y−−−−−−−√θ=arctan(GyGx)
The direction is rounded to one of four possible angles (namely 0, 45, 90 or 135)
方向一般是这四种可能。
3.Non-maximum suppression is applied. This removes pixels that are not considered to be part of an edge. Hence, only thin lines (candidate edges) will remain.
什么是Thrift
The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and s
org.json.JSONException: No value for items
在JSON解析中会遇到一种错误,很常见的错误
06-21 12:19:08.714 2098-2127/com.jikexueyuan.secret I/System.out﹕ Result:{"status":1,"page":1,&