Efficient edge matching using improved ... - Semantic Scholar

22 downloads 0 Views 657KB Size Report
HCMA (hierarchical chamfer matching) is a classical image matching algorithm, which utilizes the edge in- formation to match the images robustly and the multi- ...
Efficient edge matching using improved hierarchical chamfer matching Qiang Zhang, Pengfei Xu, Wen Li, Zhongke Wu and Mingquan Zhou Research Center for Virtual Reality & Visualization Technology Beijing Normal University, P. R. China 100875 Corresponding author: [email protected] Abstract— Matching is a central problem in pattern recognition and computer vision, its applications includes object detection and tracking. HCMA (hierarchical chamfer matching) is a classical image matching algorithm, which utilizes the edge information to match the images robustly and the multi-resolution pyramid to accelerate the matching process. However, for images with cluttered background and high resolution, HCMA is still computationally expensive, which has impeded its success in practical applications, especially in time-critical systems. In this paper, an improved hierarchical chamfer matching algorithm is proposed to reduce its computational cost without degrading its matching quality. According to the experimental results, proposed improvements are able to save 75% ∼ 95% of the computational time, without causing any false matching.

template matching are discussed. Despite of extensive study and applications of the hierarchical chamfer matching algorithm, when deadling with images with cluttered background or high resolution, the computational load could be quite large, as these images contain a lot of edge information. In this paper, an improved hierarchical chamfer matching algorithm is proposed to reduce the computation time, without degrading the matching quality. The rest of the paper is organized as follows: Section 2 gives a brief analysis of HCMA, followed by the proposed improvements in Section 3. Simulation result is reported in Section 4. Section 5 concludes this paper with discussion.

I. I NTRODUCTION

II. A NALYSIS OF H IERARCHICAL C HAMFER M ATCHING

Matching is a central problem in pattern recognition and computer vision, its applications includes object detection and tracking. Various methods have been proposed in literature to match same or similar objects, by using either low-level information such as pixel value, or high-level information such as edge. Methods using low-level information, are normally called pixel-based or image-based methods, which matches template models directly to image pixels. In contrast, methods using higher-level information, are normally called featurebased methods, which matches extensive features of the objects. Feature-based methods reduces the risk of ambiguous matches and dependence on viewing conditions inherient in image-based correlation matching. Chamfer matching [1] is a classical edge-feature based matching technology, which match the spatial extensive features on the basis of shape. To improve the robustness and efficiency of matching, hierarchical chamfer matching [2] is proposed to matches edges by minimizing a generalized distance between two edge image pyramids. Due to the generalized metric, this algorithm is quite insensitive to noise, rotation, scaling, etc. Since its invention, hierarchical chamfer matching has been applied in many vision systems, including hand detection and recognition [3], [4], word recognition [3], etc.. The algorithm itself has also been studied extensively during the past decade by reseachers. In [5], color information of images has been incorporated in the matching algorithm. the design of distance transform is extensively studied in [6], [7]. Hausdorff distance is used as a metric to locate objects from images in [8], [9], the later uses cell decomposition to optimize the position. In [10], multi-feature based hierarchical

HCMA (Hierarchical Chamfer Matching) is parametric edge matching algorithm, which matches edges by minimizing a generalized distance between them. It is performed in a series of images which depicts the same orginal image, but in different resolutions. This series of images is called an image pyramid. By using the hierarchical structure of image pyramid, the computational cost of matching could be reduced significantly. The algorithm flow of HCMA is outlined in Figure 1, further details of the algorithm could be found in [2]. In HCMA, chamfer distance transform is applied on each level of the edge pyramid, to create a pyramid of distance images. However, this method consumes a lot of time. The chamfer distance transform mainly contains the following procedure: 1) initializing distance transform image by setting edge pixels as zero and non-edge pixels as infinity, 2) forward process, which require 4 × N add and compare operations, where N is size of the image. 3) backward process, which consumes the same computation complexity as forward process. III. P ROPOSED I MPROVEMENTS FOR H IERARCHICAL C HAMFER M ATCHING This paper focuses on two aspects to improve the hierarchical chamfer matching algorithm: speedup the process to build distance image pyramid and better initialization of start point. A. Proposed fast distance image pyramid building method As shown above, distance transformation is responsible for a large part of computation load in the whole hierarchical chamfer algorithm. The reason is that distance transform

Preprocess section: 1) Extract edges from image and template respectively: Img Edge = edge(Img) T mp Edge = edge(template) 2) Build pyramid from Img Edge: P yr = pyramid(Img Edge) 3) Initialize start points, usually a regular grid of points. Iteration section (At level i): 4) Get distance image of P yr(i) by distance transform: Dist = distance(P yr(i)) 5) Convert edge of template to a list of coordinate points at level i: P oly = polygon(T mp Edge, i) 6) Superimpose P oly on Dist according to start points, and find local minimums repetively. 7) Filter local minimum points by using reject criteria. 8) Go to level i − 1, using remaining points as start points. Fig. 1.

Fig. 2.

The Hierarchical Chamfer Matching Algorithm [2]

Demonstation of the proposed rescaling method

is a more computing-intensitve task comparing with other steps, as it involves sequential scans of the whole image, and unfortunately it is iterativelly performed on each level of the edge pyramid. In this paper, we propose to perform distance transform at one level and “rescale” the distance image for each level, to avoid iteration of distance transform on each level. However, a straightforward rescale operation will corrupt the edge information of the image and then degenerate the performance of the algorithm. A heuristic method to rescale distance images is proposed here to avoid this adversity: •

the new value of the selected pixel will be the minimal value in neighborhood, divided by the scaling facor. For example, in 12 rescaling, the new value will be half of the minimal value in neighborhood. An example is given in Figure 2.

Using this method, a new distance image pyramid, which approximates the distance image pyramid in original HCMA, could be obtained efficiently with well-preserved edge information. Figure 3 compares the Level 2 distance images of Lena

(a)

(b)

(c)

Fig. 3. (a) Edge image of Lena, (b) Level 2 distance image from proposed distance pyramid, (c) difference between proposed distance pyramid and classical one.

from proposed method and orginal one, the maximal difference between these two images is only 0.7, while the maximal value in distance image is 86.4. Futhermore, their difference at edge pixels is zero, which means the edge information are wellpreserved. On the other hand, proposed method requires only about 22% of the computation time, comparing with distance pyramid calculation in orginal HCMA. B. Proposed initialization of start points using crosscorrelation As mentioned above, start points affect both computation time and matching performance of the algorithm. Traditionally, grid points initialization is normally used, when there is no priori information is available. In this paper, cross-correlation is proposed to be performed to help initialize the start points more efficiently. Cross-correlation is welled studied in digital signal processing [11], and has also found its applications in pattern recognition and computer vision [12]. At first glance, cross correlation demands very high computational complexity compared with HCMA, which is O(N 2 ) vs. O(N ). However, initialization of start points is only performed at the first iteration, where resolution of the image is very small. For example, if we are matching a 128 × 128 image to a 640 × 640 image, sizes of the images at Level 5 are 40 × 40 and 8 × 8 respectively. Thus, the computational load of cross correlation performed at Level 5 of the pyramid is only 1/65536 of the original one. In fact, due to the merits of pyramid structure, the computational complexity of crosscorrelation is neglectable in practice. It is well known that, matching point is the exact point with the largest cross-correlation value, when only translation is involved between template and image. Of course, its complexity is too high to be implemented directly. However, by performing on the pyramid structure of HCMA, the computational complexity could be reduced dramatically, as shown above. Although matching on top level of the pyramid is not very accurate enough due to small resolution, this matching result could be refined and verified at the higher-resolution image iterativelly by using hierarchical chamfer matching algorithm. When rotation is also considered, the matching points are not always the points with the prominent cross-correlation values. However, the regions where the matching points are likely to exist can still be found based on cross correlation result. According to theoretical analysis and experiments in [13],

Preprocess section: 1) Extract edges from image and template respectively: Img Edge = edge(Img) T mp Edge = edge(template)

(a)

(b)

(c)

(d)

2) Build edge image pyramid from Img Edge: Edge P yr = pyramid(Img Edge) 3) Build distance image pyramid using proposed method; 4) Proposed start-points initialization, based on crosscorrelation; Iteration section (At level i): 5) Convert edge of template to a list of coordinate points at level i: P oly = polygon(T mp Edge, i) (e) 6) Superimpose P oly on Dist according to start points, and find local minimums repetively. 7) Filter local minimum points by using reject criteria. 8) Go to level i − 1, using remaining points as start points. Fig. 4.

The Improved Hierarchical Chamfer Matching Algorithm

the probability of matching has a significant association with number of independent objects, mean square deviation, power of the texture and feature of correlation peak. Inspired by this, we can distribute the start points more efficiently under the guidance of cross-correlation result. In experiments, simple threshholding method is used to eliminate regions where the value of cross-correlation is smaller than a certain threshhold, and start points are distributed in the region with high crosscorrelation value.. C. Overview of improved HCMA algorithm Fig. 4 gives a clear picture of the improved HCMA algorithm. Comparing with Fig. 1, the step of calculating distance image is removed from iteration part to preprocess part, to reduce the time complexity. Meanwhile, grid-based start points initialization is replaced by proposed initialization methods based on cross-correlation result. Other parts of the algorithm remain unchanged. IV. R ESULTS We implemented our method with Matlab language 1 and made experiments using a personal computer with a Intel 2.4GHz CPU and 2GB of RAM. Fig. 5 shows five pairs of orignal and template images. The sizes of orginal images in (a) and (b) are 512 × 512, the sizes of orignal images in (c) and (d) are 640 × 480, and the size of orignal image in (e) is 1024 × 768, respectively. 1 The source codes for orginal HCMA and improved HCMA could be downloaded from http://www.wohome.net/fileDownload.aspx? key=-743486652 and http://www.wohome.net/fileDownload. aspx?key=92511060 respectively.

Fig. 5.

Examplar set of orignal and template images

TABLE I T ESTING PARAMETERS FOR IMPROVED HCMA τ λ υx υy r L

0.7 2 3 3 1 5

The values of parameters are listed in Table I. The default value for introduced parameter τ , threshhold for selection of start points, is set to 0.7. Other parameters using in improved HCMA and orignal HCMA were determined by suggestions from [2]: The rejetion factor λ is set to 2; the intervals in xcoordinate and y-coordinate, υx and υy , are both set to 3; , the radius r to define the neighborhood is 1; and the maxium level of distance pyramid L is set to 5, which means that image on the top of pyramid is 1/16 rescaled from the original image. The effects of varying the introduced parameter τ is demonstrated in Fig. 6. When τ = 0, the improved HCMA algorithm degrades to algorithm without the better initialization improvement. Fig. 6 shows that proposed algorithm requires less computational time while the value of τ is increased, as larger τ will eliminate more candidate points at the early stage. However, larger τ also brings the risk of false matching. In experiments, the value of τ is set to 0.7 empirically. In experiments, proposed improvements on HCMA algorithm is able to greatly decrease the computational time, without causing any false matching. The comparision of computational time between orignal and improved HCMA is given in Fig. 7. It can be seen that the improved HCMA only consumes 5% ∼ 25% of the computational time, comparing with the original HCMA.

computational complexity of hierarchical chamfer matching algorithm. R EFERENCES

Fig. 6.

The relationship between threshhold and computational time

Fig. 7. Comparison of computational time between improved HCMA and original HCMA

V. C ONCLUSION The hierarchical chamfer matching algorithm is widely used in many image processing and computer vision systems. However, its computational time could be high for largeresolution and highly cluttered images In this paper, two improvements are proposed for hierarchical chamfer matching algorithm to reduce the computational cost, without degrading the matching quality: • fast distance image pyramid building method, which could keep the edge information intact, and meanwhile change the distance image calculation from an iterative step to a preprocess step in the algorithm flow. • initialization of start points based on cross-correlation result of the low-resolution images, so that a coarse estimate of the possible matching could be obtained. Based on this coarse estimate, we are able to reduce the number of start points for iteration section and thus the total computational time. From the experimental results, proposed improvements are able to save 75% ∼ 95% of the computational time, without causing any false matching. Future work is to formulate a probabilitic framework to initialize the start points, based on the cross-correlation result, and to study other initialization methods to further reduce the

[1] H. G. Barrow, J. M. Tenenbaum, R. C. Bolles, and H. C. Wolf, “Parametric correspondence and chamfer matching: Two new techniques for image matching,” in 5th Int. Joint Conf. Artificial Intelligence, 1977, pp. 659–663. [2] G. Borgefors, “Hierarchical chamfer matching: a parametric edge matching algorithm,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 10, pp. 849–865, Nov. 1988. [3] A. Thayananthan, B. Stenger, P. H. S. Torr, and R. Cipolla, “Shape context and chamfer matching in cluttered scenes,” in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2003, pp. 127– 133. [4] V. Athitsos, J. Alon, S. Sclaroff, and G. Kollios., “Boostmap: A method for efficient approximate similarity rankings,” in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2004, pp. 268–275. [5] N. Covavisaruch and P. Dhanaraks, “An image alignment technique for planar image mosaicing by hierarchical edge-color matching and chamfer matching methods,” in the 2004 Int. Conference on Imaging Science, Systems, and Technology (CISST’04), Las Vegas, Nevada, June 2004, pp. 399–404. [6] G. Borgefors, “Distance transformations in digital images,” Comput. Vision Graph. Image Process., vol. 34, no. 3, pp. 344–371, 1986. [7] M. A. Butt and P. Maragos, “Optimum design of chamfer distance transforms,” IEEE Transactions on Image Processing, vol. 7, pp. 1477– 1484, Oct. 1998. [8] D. P. Huttenlocher, G. A. Kl, and W. J. Rucklidge, “Comparing images using the hausdorff distance,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 15, pp. 850–863, 1993. [9] W. J. Rucklidge, “Efficient locating objects using the hausdoff distance,” International Journal of Computer Vision, vol. 24, pp. 251–270, 1997. [10] D. M. Gavrila, “Multi-feature hierarchical template matching using distance transforms,” in In Proc. of the International Conference on Pattern Recognition, 1998, pp. 439–444. [11] S. J. Orfanidis, Optimum Signal Processing: an introduction, 2nd ed. Collier Macmillan, 1988. [12] R. M. Haralick and L. G. Shapiro, Computer and Robot Vision, 2nd ed. Addison-Wesley, 1992. [13] H. H. Bailey, F. W. Blackwell, C. L. Lowery, and J. A. Ratkovic, “Image correlation, part i: simulation and analysis,” Defense Technical Information Center OAI-PMH Repository, Tech. Rep. AD2A03665, 1976.