Current Issue Cover
旋转骨架法在二值图像分形维数计算中的应用

纪佑军1, 何杰1, 韩海水2, 程忠钊3, 曾保全2(1.西南石油大学地球科学与技术学院, 成都 610500;2.中国石油勘探开发研究院, 北京 100083;3.西安长庆科技工程有限责任公司, 西安 710018)

摘 要
目的 计盒法是一种计算二值图像分形维数的常用方法,传统方法如BCM(box-counting method)对无旋转的图像结构具有较理想的计算结果,但是对具有旋转的图像结构的拟合结果偏差较大,导致同一物体在不同旋转角度下的图像的计算结果存在较大差异。为了减小图像旋转对盒维数的影响,本文提出了一种计算二值位图分形维数的新方法——旋转骨架法。方法 将二值图像提取骨架,使位图转换为矢量图,利用遗传算法计算图像中物体的最小包容矩形和旋转角度,然后将矢量图进行旋转使其变为一个无旋转的图形,接下来采用多尺度的盒子覆盖矢量图形得到多个拟合点,最后按最小二乘法对拟合点进行拟合得到盒维数。与BCM方法相比,其核心工作与关键改进为骨架的提取、最小包容体的计算、矢量图的分形维数计算等过程。结果 对3种类型的图像进行了分析,在自相似的分形图像中,相比BCM方法,3幅图的平均误差分别降低了0.725 2%、3.060 5%和2.298 5%,变化幅度分别降低了0.057 3、0.088 3和0.085 9;在文字扫描图像中,相比BCM方法,变化幅度降低了0.012 75,平均拟合误差降低了0.001 28;在植物图像中,与BCM方法相比,分形维数的变化幅度降低了0.017 04,平均拟合误差降低了0.000 5。结论 该方法充分利用了位图易旋转、无厚度的特点,减小了图像旋转对盒维数的影响,评价结果优于BCM方法。
关键词
Application of skeleton rotating method in fractal dimension calculate of binary image

Ji Youjun1, He Jie1, Han Haishui2, Cheng Zhongzhao3, Zeng Baoquan2(1.School of Geoscience and Technology, Southwest Petroleum University, Chengdu 610500, China;2.China Petroleum Exploration and Development Institute, Beijing 100083, China;3.Xi'an Changqing Science and Technology Engineering Co, Ltd, Xi'an 710018, China)

Abstract
Objective Fractals have been widely used in image processing, signal processing, physics, biology, system science, medicine, geography, material science, and architecture. Fractals have also become an important tool to describe and study complex and irregular geometric features quantitatively. Fractal dimensions are formally defined as the Hausdorff-Besicovitch dimension. However, estimating fractal dimensions can be conducted in several ways, each of which uses a slightly different definition of the dimension. A few of these methods include the box-counting method (BCM), wavelet transform, power spectrum (using the Fourier transform), Hurst coefficient, Bouligand-Minkowski, variation, and capacity dimension methods. Given its high efficiency and easy implementation, BCM has become a widely used method to calculate the fractal dimension of binary images. However, BCM is influenced by many factors, such as range of box sizes, selection of fitting points for calculation, method of box covering, and rotation angle of the image, which lead to the instability of the box-counting dimension. Among the factors that affect the box dimension, the box-counting dimension of binary images change greatly due to image rotation and then leads to the deviation of the box-counting dimension. When the image has rotation, the box dimension calculated by the BCM method is usually smaller than the theoretical fractal dimension. The traditional method (BCM) only has a good estimation of nonrotating images. The estimation of rotating images deviates greatly when the traditional method is used and leads to the large difference in the box-counting dimension of the binary image with different rotating angles of the same object. The average deviation of the box-counting dimension caused by rotation is 3%~5%, and the maximum deviation can reach approximately 8%. To reduce the influence of the image's rotation on the box-counting dimension, the rotation angle of the image must become 0. If the binary image is directly rotated, then the new binary image generated after rotation is inevitably accompanied by interpolation. Although the rotation of the image is corrected, it also causes image deformation and deviation of the box-counting dimension. To avoid rotating the binary images directly, this study proposes a new method to calculate the fractal dimension of binary images. Method BCM is mostly used to calculate the box-counting dimension of bitmap because the bitmap is relatively easy to obtain, and the box-counting method of vector graphs is rarely studied. Vector graphics have more advantages compared with bitmaps because binary images cannot avoid the thickness problem caused by the pixel size and the interpolation problem caused by the bitmap image rotation. On the contrary, vector images are characterized by no thickness and easy rotation without interpolation. Based on these characteristics, this study proposes a new method called skeleton rotating method to calculate the box-counting dimension. The innovation of this method is the conversion of the binary image into a vector graph and the calculation of the box-counting dimension on the basis of the vector graph. This method mainly includes the following steps: First, the central point of the pixel point of the binary image is regarded as a series of points on the plane. Lines are used to connect the adjacent points on the plane to form a skeleton (vector graph) of the binary image. Then, the minimum containing the rectangle and rotation angle θ of the skeleton are calculated using the genetic algorithm. To ensure the accuracy of the calculation results, the genetic algorithm parameters are set as follows: initial number of population, 100; mutation probability of offspring, 0.1; total generations of reproduction, 10 000. Next, the skeleton is rotated by the angle θ to obtain a nonrotating vector graph, and the skeleton is covered with boxes of different sizes in a suitable range of box sizes. Simultaneously, we need to record the number of boxes covered with different sizes and the size of the boxes when covering the skeleton to obtain multiple fitting points (-ln r,ln Nr). Lastly, the fitting points are fitted in accordance with the least squares method to obtain the box-counting dimension. Result In order to compare skeleton rotating method more comprehensively, this paper analyzes and verifies the self-similar image, character scanning image and plant image. In the self-similar image, three different types of self-similar fractal image are calculated (each type contains 45 images with different rotation angles). Compared with the BCM method, the average fitting error (least square fitting error) of the skeleton rotating method was reduced by 0.725 2%, 3.060 5% and 2.298 5% respectively, while the variation range (the difference between the maximum and minimum calculated value) decreased by 0.057 3, 0.088 3 and 0.085 9, respectively. In the character scanning image, compared with the BCM, the change range of the box dimension of the character scanning image is reduced by 0.012 75 and the average fitting error is reduced by 0.001 28. In the plant image, compared with the BCM, the change of box dimension is reduced by 0.017 04 and the average fitting error is reduced by 0.000 5. Conclusion The skeleton rotating method converts the binary image into a vector graph on which the estimation of the box-counting dimension is based. The vector graph is used as a basis because it is convenient to rotate and has no thickness. When the vector graph is used for estimating the box-counting dimension, the interpolation problem caused by the rotation of the binary image is avoided, and the influence of the rotation of the binary image on the box-counting dimension is reduced. The results of the skeleton rotating method are better than that of the BCM.
Keywords

订阅号|日报