Problem A
Image Edge Analysis and Application

With the development of science and technology, the demand for measurement
accuracy of various workpieces and parts is getting higher and higher, and the
requirements for measurement instruments are also getting more and more
demanding. Various image measuring equipment such as digital image size
measuring instrument are now gradually replacing the traditional manual caliper
measurement application. Generally, after the camera is calibrated, based on
the the dot matrix or checkerboard feature information of the calibrated image,
the image can be corrected for distortion and the mapping relationship between
the image coordinate space and the world coordinate space can be calculated.

The edge of the target object is very useful for image recognition and
computer analysis. Image edge is the reflection of discontinuity of the local
characteristics of an image. The edge can outline the target object and make it
clear to the observer at a glance. The edge contains rich intrinsic information
(such as orientation, step property and shape, etc.), which is an important
attribute for extracting image features in image recognition. Image edge
contour extraction is a very important processing in boundary segmentation and
also a classical problem in image processing. The purpose of both contour
extraction and contour tracking is to obtain the external contour features of
an image. Applying certain methods where necessary to express the features of
the contours to prepare for image shape analysis has a significant impact on
performing high-level processing such as feature description, recognition and

The contour can be described as a set of ordered points, and the common
expression of the contour is a polygon. Contours can be either closed or open.
The closed contours on an image are all connected start to end, and the open
contours generally intersect with the image boundary. In Figure 1, there are
five closed contour curves. Although edge detection algorithms such as sobel
and canny can detect the image edge pixels boundary based on the difference of
image gray value, it does not take the contour as a whole. On an image, a
contour corresponds to a series of pixel points. The contour describes a
continuous sequence of points, and the edge pixel points can be assembled into
a contour curve to describe the edge information of the image.

A sub-pixel is a virtual pixel defined between two physical pixels of an image
acquisition sensor. To improve resolution or image quality, sub-pixel
calculation is very useful. Image sub-pixel edge extraction is a more accurate
method than traditional pixel edge extraction. Sub-pixel means that the
coordinate value of each pixel point on the image is no longer integer
positioning, but floating-point number positioning. If the accuracy is
increased to 0.1 pixel using subpixel technique, it is equivalent to 10 times
higher resolution of image system analysis.

For the following three schematic diagrams, in Figure 1, the object edge
contour lines of the image have been extracted and the image edge contour has
been segmented into basic graphics such as straight line segments, circular arc
segments, and circles. In Figure 2, The edge contour of a rounded rectangle is
divided into several geometric shapes. In Figure 3, an elliptical sub-pixel
contour curve is shown drawn on the background of a grayscale pixel image grid.

Figure 1. Image Edge Detection

Figure 2. Segmentation Image Edge Contour

Figure 3. Sub-pixel Edge Contour of Image


<>Question 1

: Build a mathematical model, analyze the method and process of extracting
sub-pixel edge with 1/10 pixel accuracy and above, extract sub-pixel edge
contour boundaries of the main edge parts of the objects on the three images
(Pic1_1, Pic1_2, Pic1_3) in Annex 1, and convert the edge sub-pixel point data
into ordered edge contour curve data, with the need to considering how to
eliminate the interference effects of edge burrs and shadow parts of the edges.
Note that the Pic1_3 image was taken under relatively complex lighting
conditions, with more interference information.

a)Please draw the extracted edge contours in different colors on the image,
output it as a color edge contour image and save it as png image format for
submission. The file names are pic1_1.png, pic1_2.png, pic1_3.png.

b)Output the edge contour data in the format of EdgeContoursOutput.xls file in
Annex 1, and output the data of the Pic1_1 and Pic1_2 images to the
corresponding Sheet1 and Sheet2 of the worksheet respectively. The output data
contains the total edge contours count, the total edge contours length in the
image coordinate space, point count and length of each contour curve, and the X
and Y coordinate data of each contour point.

c)The total contour curves count on each image and the point count and length
data on each curve should be given in the paper. See Table 1, Table 2 and Table

<>Question 2

:While the measured image is taken, there is a dot matrix calibration plate
placed at the same horizontal height of the target object. The diameter of the
dots on the calibration plate is 1 mm, and the center distance between two dots
is 2 mm. Annex 2 contains three calibration plate images taken at different
angles and one product image (Pic2_4.bmp). Please build a mathematical model,
use the calibration plate image information to conduct image rectification
analysis of the product image and consider how to calculate, as accurately as
possible, the actual physical sizes of the edge segmentation fitting curve
segments on the product image. Please calculate the length (mm) of each edge
contour, and finally calculate the total edge contours length (mm). According
to the contour data labeling shown in Figure 4, output the data results of the
table format files such as EdgeContoursLengthOutput.xls in Annex 2.

Figure 4. Image Contour Data Labeling

<>Question 3

: Two sub-pixel contour edge data (EdgeContour1.xls and EdgeContour2.xls) are
provided in Annex 3, and the shape are shown in Figure 5. Please build a
mathematical model, analyze the automated segmentation and fitting of edge
contour curve data into straight line segments, circular arc segments
(including circles), or elliptical arc segments (including ellipses), and
discuss the model method or strategy for automated segmentation and fitting of
edge contours. The blue curve starts from the blue digit 1 label and outputs
the model calculation result data along the arrow direction. The green curve
starts from the green digit 1 label and outputs the model calculation result
data along the arrow direction. Please fill in the parameters of the segmented
curve segments into the table in the table format. Submit Table 7 and Table 8
(regarding contour 1 and contour 2 segmentation data) in the paper. Note that
the type of the lines in this table is populated according to the actual type.

Figure 5. Edge Contour Curve Data


* SweepAngle indicates the sweep angle from the start point to the end point,
angular system;
* Size indicates the radius value of specified ellipse or elliptic arc in the
X and Y directions;
* RotationAngle indicates the rotation angle value of specified ellipse or
elliptic arc, angular system;
* For the direction of rotation angle, the rotation direction from positive
direction of x-axis to positive direction of y-axis is positive direction, and
vice versa is negative direction.
* All image coordinate points are expressed under the image coordinate
system, that is, the upper left corner is the (0,0) origin, the positive
direction of the X-axis is to the right, and the positive direction of the
Y-axis is downward.







∇f(x,y)≡grad[f (x,y)]≡ [ g x ( x , y ) g y ( x , y ) ] \begin{bmatrix} g_x
(x,y)\\ g_y (x,y) \end{bmatrix}[gx​(x,y)gy​(x,y)​]= [ ∂ f ( x , y ) ∂ x ∂ f ( x
, y ) ∂ y ] \begin{bmatrix} \cfrac{\partial f (x,y)}{\partial x}\\
\cfrac{\partial f (x,y)}{\partial y} \end{bmatrix}⎣⎢⎢⎡​∂x∂f(x,y)​∂y∂f(x,y)​​⎦⎥⎥⎤




Sobel 算子
Sobel 算子对噪声具有平滑抑制作用,但是得到的边缘较粗,且可能出现伪边缘。




1]之间)后,计算总像素数目SP,得到要加噪的像素数目,并随机获取要加噪的每个像素位置P(i, j)并指定像素值为255或者0。




3.Winner 滤波是使原始图像 f(x,y)及其恢复图像 g(x,y)之间的均方误差最小的复原方法. Wiener


标准 Hough 变换 (SHT) 使用线条的参数化表示:

变量 rho 是沿垂直于线条的向量从原点到线条的距离。θ是从原点到线条的垂直投影相对于正 x 轴顺时针测量的角度(以度为单位)。θ的范围是 –90° ≤
θ < 90°。线条本身的角度是 θ + 90°,也是相对于正 x 轴顺时针测量的。





* 找一个代码写得好的队友很重要,模型出来了运用到实际问题里还是有不少坑,需要对算法进行改进,即使是现成的代码也得看懂,更不用说根据算法写代码了。
* mathtype真香。这篇博文为什么没有太多公式,因为用latex打公式太麻烦啦!
* mathwork上有关于matlab部分算法及功能的介绍,如果在使用时有不懂可以先去上面找找。
* 知网很好用,但关键词要找准,计算机视觉这个大类下,即使是边缘检测也有很多领域的运用,要找准适合比赛题目方向的。
* 有一本专业的书籍在手边会方便很多。

©2019-2020 Toolsou All rights reserved,
Python学习笔记(一)Linux【shell】 shell编程创建一个线程——— Javaweb (3)evo工具使用问题——Degenerate covariance rank, Umeyama alignment is not possibleVMware 16安装centos 7详细教程C语言做一个简易的登陆验证(功能)界面C语言——qsort函数Spring Boot面试必问:自动配置原理Android EditText密码显示隐藏Qt入门教程【基础控件篇】QCalendarWidget日历控件