APP下载

Symmetric axis detection for images based on Hough algorithm

2015-03-29LIXiaoleiPANJinxiaoLIUBinCHENPing

关键词:中轴线刚体对称轴

LI Xiao-lei, PAN Jin-xiao, LIU Bin, CHEN Ping,2

(1. Shanxi Key Laboratory of Signal Capturing & Processing, North University of China, Taiyuan 030051, China;2. Key Laboratory of Molecular Imaging, Institute of Automation, Chinese Academy of Sciences, Beijing 100190, China)



Symmetric axis detection for images based on Hough algorithm

LI Xiao-lei1, PAN Jin-xiao1, LIU Bin1, CHEN Ping1,2

(1.ShanxiKeyLaboratoryofSignalCapturing&Processing,NorthUniversityofChina,Taiyuan030051,China;2.KeyLaboratoryofMolecularImaging,InstituteofAutomation,ChineseAcademyofSciences,Beijing100190,China)

To extract the symmetric axis of rigid target accurately, a symmetric axis detection method is proposed based on Hough algorithm. A bullet is selected as a research object. Firstly, the original image is collected and the characteristics of the target image are analyzed. Because the symmetric axis detection depends on the edge detection of the image, it is necessary to use relevant operators to detect the edge and get all possible edge points. Secondly, all possible symmetric axes related to all contour points acquired are determined by Hough transform, and all possible inclination angles and intercepts and their ranges are obtained. Finally, by using least squares method, when the distance between the symmetric points of the contour points from the one edge and the contour points from the other edge is the minimum, the optimal symmetric axis is got. Simulation results show that the proposed method can improve noise-resistance and precision of symmetric axis detection and has certain practical value.

Hough transform; symmetric axis; least squares method

0 Introduction

Alignment measurement technology is also called shaft alignment technology, which is mainly used for measuring parallel deviation and inclination deviation of two coupling shaft axes of mechanical parts[1]. However, whether these machine parts are centered has a crucial impact on quality of parts; therefore, alignment measurement needs to be carried out in the process of installing the parts. The principle of alignment measurement is that it needs to acquire coaxiality error by extracting two coupling shaft symmetric axes. Therefore, symmetry detection is the basis of and the key to the measurement in alignment measurement technique.

For the detectied parts, such as bullets, missiles, etc, their edges are not horizontal or vertical. Therefore, Hough transform and least squares methods can be used for symmetric axis exaction, and they have advantages of small noise, continuous curve impact and high detection accuracy. For this reason, taking a bullet as the research object, this paper presents symmetric axis detection for images with Hough algorithm and realizes symmetric axis extraction.

1 Symmetry detection principle for projectile with Hough transform

1.1 Principle of Hough transform method

For any point (x0,y0) in image space, it can be converted to a curveρ=x0cosθ+y0sinθin parameter space (θ,ρ). Using the transformρ=xcosθ+ysinθ,npoints in the same straight line are converted successively, thusncurves in parameter space (θ,ρ) are obtained. Thesencurves necessarily pass the same point (θ0,ρ0), whereθ0andρ0are the parameters determining polar equation of the straight line. Then finding the point (θ0,ρ0) in parameter space can solve the straight lineL[2-4]. The geometric meaning of the curve equation in parameter space is shown in Fig.1.

Fig.1 Linear parameter geometric meaning based on Hough transform

1.2 Least squares method for optimal symmetric axis

After all possible symmetric axes are defined by Hough transform, suppose that the edge points of one side of the detected object are known, the symmetric points through all possible symmetry axes can be got. Then the minimum distance between each symmetric point and all edge points of the other side are calculated. The symmetric optimal axis can be obtained when the minimum square sum of all minimum distance is calculated by means of least squares method. In addition, the inclination angle and intercept can be got by least squares method which makes the square sum of the minimum distance between all symmetric points and edge points of the other side minimum[5-6].

1.3 Symmetric axis extraction with Hough transform algorithm

The idea of the method is to obtain object contour first. Then by choosing four points, the range of edge points is determined preliminarily and by defining all possible symmetric axes with Hough transform, the range of inclination angle and intercept of the symmetric axis can be obtained. Finally, the optimal symmetric axis with least squares method within this range can be got.

To compare the advantages and disadvantages between the existing algorithms and improved algorithm, two-point method, fitting method and improved Hough algorithm are respectively used to extract symmetric axis of the image shown in Fig.2. The result is shown in Table 1. It can be seen that extraction accuracy with improved Hough algorithm is the highest.

Fig.2 Original image

Table 1 Symmetric axis extraction using two-point method, fitting method and improved Hough algorithm

2 Algorithm simulation

First, the original image of the bullet is collected, and then Gaussian filter is used to maintain the image contour information. Finally, the symmetric axis is extracted by means of the following algorithm[7-10].

Step 1: Remove background color interference.

Step 2: Look for edge according to grayscale value change, and select two points in the front-end warhead and back-end projectile respectively to intercept warhead and projectile for study.

Step 3: Take the warhead as research object and two points on it, then the four points on it are saved in a matrixA.

Step 4: Based on the known up-contour and down-contour points, the corresponding slope (k) and intercept (b) are obtained by a polynomial fitting, and the intercept rangeBof four points is got byy-y0=k(x-x0).

Step 5: In the same way, the intercepts of all up and down-contour points for warhead are got. By judging whether these intercepts are withinB, contour points which satisfy the conditions can be determined preliminarily.

Step 6: All possible symmetric axes are defined by using Hough transform for the obtained contour points and then the ranges of all the inclination angles and intercepts are presented.

Step 7: The ranges of these inclination angle and intercepts mean that the distances can be known between the symmetric points of the contour points from the one edge and the contour points from the other edge[8-10]. Furthermore, the least square sums of these distances are got and the corresponding inclination angles and intercepts are presented.

Step 8: By comparing these inclination angles and intercepts, optimal inclination angle and intercept are obtained. And then the optimal symmetric axis of the warhead is got byy=kx+b.

Step 9: Repeat the above steps, the optimal symmetric axis of shell can be got.

Step 10: Coaxiality error is the difference in inclination angle between the symmetric axis of shell and the symmetric axis of warhead.

Fig.3 shows the simulation process of extracting bullet’s symmetric axis based on Matlab6.0 according to the above steps.

Fig.3(a) is the image with the part outside the contour removed from the original image. Fig.3(b) is the binary image by searching up and down-contour. When the binary image is magnified, the contour line is continuous. Fig.3(c) is the intercepted warhead image. Fig.3(d) is the intercepted shell image. Fig.3(e) is warhead’s symmetric axis. Fig.3(f) is shell’s symmetric axis. Fig.3(g) is symmetric axis of the whole image.

Fig.3 Extraction process of bullet’s symmetric axis

2.1 Calculation of inclination angle and slope of symmetric axis

As Fig.1 shows, the polar coordinates of symmetry axis is expressed asρ=x0cosθ+y0sinθ, then the inclination angle of the symmetric axis is 90°+θ, and the intercept of symmetric axis isρ/sinθ.

2.2 Calculation of symmetric points

Suppose that a contour edge point on one edge is (x1,y1) and the symmetry axis equation isy=kx+b, then the symmetric point can be calculated by

2.3 Calcuation of square sum for distance

The square sum for distance can be calculated by (x1-x)2+(y1-y)2. The inclination angle and intercept are optimal when the sum of all least square sum for distance is minimum.

3 Algorithm verification and precision analysis

3.1 Experiment verification

To verify the stability and effectiveness of improved Hough transform algorithm to extract symmetric axis, random noise is added to original image. The results are shown in Fig.4. The symmetric axis of noised image is got by simulation. Compared with the image without additional noise, symmetric axes of warhead and shell with additional noise have not changed much, that is to say, the angle difference of two symmetric axes has a little change and the stability of algorithm is verified.

Fig.4 Extraction process of the bullet’s symmetric axis with additional noise

3.2 Precision analysis

Fig.5 shows that using the proposed algorithm can extract symmetric axis accurately. The abscissas means thei-th image is collected,i=1,…,5; the ordinate means the angle difference of two symmetric axes. Here the fifth image is simulated.

It can be detected automatically that angle difference is 0.002 5 through MATLAB simulation. Therefore, the algorithm presented in this paper can detect angle difference of two symmetric axes accurately.

Fig.5 Angle difference of warhead and shell symmetric axes

4 Conclusion

A symmetric axis detection method is presented for images based on improved Hough algorithm. The experimental results show that this method can improve noise-resistance and measurement precision of symmetric axis detection and has certain practical value. However, the operation speed of algorithm is slow and it needs to be further improved.

[1] LIU Xiao-ru. Research on image processing technology in alignment measurement. Beijing: Graduate University of Chinese Academy of Sciences, 2008.

[2] ZHANG San-xi, HU Xiao-li. Target profile interpretation based on optical image processing. Applied Optics, 2011, 32(4): 657-661.

[3] WEI Min. Symmetry axis extraction for sequence image axisymmetry object. Semiconductor Optoelectronic, 2007, 28(1): 143-146.

[4] ZHOU Jun-ni, YANG Run-lin. A new method of symmetry object pose measurement based on hough fitting method. TV Technology, 2007, 31(8): 91-93.

[5] LU Jian. Least squares method and its application. Journal of Science and Technology in Western China, 2007, (19): 19-21.

[6] SUN Ji-ping, HONG Liang. A symmetric axis detection method for two-dimension image. China patent, 201310521084.9. 2014-01-22.

[7] Yip R K K. A Hough transform technique for the detection of reflectional symmetry and skew-symmetry. Pattern Recognition Letters, 2000, 21(2): 117-130.

[8] DING Wei-li. Symmetry recognition algorithm research based on image. Electronics Technology, 2014, 27(10): 1-5.

[9] WEI Hong-qiang. Ellipse detection algorithm based on boundary tracing and hough transform. Journal of Science and Technology of Changchun University, 2010, 33(3): 133-136.

[10] MENG Wei-hua, XIANG Jing-bo. Target segmentation algorithm based on phase information. Electronics Optics & Control, 2014, 21(3): 16-18.

基于Hough算法的图像对称轴检测

李晓磊1, 潘晋孝1, 刘 宾1, 陈 平1,2

(1. 中北大学 信息探测与处理山西省重点实验室, 山西 太原 030051;2. 中国科学院自动化研究所, 中国科学院分子影像重点实验室, 北京 100190)

为高精度提取对称刚体对象的中轴线, 提出了一种基于Hough变换的图像对称轴检测方法。 本文以子弹为研究对象, 首先采集原始图像, 因刚体边缘是对称轴检测的基础, 采用相关的算子进行边缘检测, 获得所有可能的边缘点。 然后利用测得的所有边缘点, 通过Hough变换确定图像所有可能的对称轴, 进而得到所有的倾斜角和截距及其范围。 最后, 利用最小二乘法计算, 当刚体一边边缘点关于对称轴的对称点到另一边所有边缘点的最小距离之和为最小时, 该对称轴即为最优对称轴, 也是被测对象的中轴线。 仿真实验结果证明, 该算法在一定程度上提高了对称轴检测的抗噪性和精度, 对实际工程应用具有一定的价值。

Hough变换; 对称轴; 最小二乘法

LI Xiao-lei, PAN Jin-xiao, LIU Bin, et al. Symmetric axis detection for images based on Hough algorithm. Journal of Measurement Science and Instrumentation, 2015, 6(4): 342-346.

10.3969/j.issn.1674-8042.2015.04.007

Foundation item: National Natural Science Foundation of China (No.61171179, No.61227003)

LI Xiao-lei (1403234181@qq.com)

1674-8042(2015)04-0342-05 doi: 10.3969/j.issn.1674-8042.2015.04.007

Received date: 2015-08-11

CLD number: TN911.73 Document code: A

猜你喜欢

中轴线刚体对称轴
北京“实景三维中轴线”亮相“奋进新时代”主题成就展
差值法巧求刚体转动惯量
首付10万起! 做广州业主!坐拥中轴线+名校资源+三大商圈!
车载冷发射系统多刚体动力学快速仿真研究
先找对称轴!
抓牢对称轴突破二次函数
有几条对称轴
刚体定点转动的瞬轴、极面动态演示教具
地震作用下承台刚体假定的适用性分析
北京中轴线掠影