Template selection and matching algorithm for image matching
Di Jia,Ninghua Yang,Jinguang Sun
DOI: https://doi.org/10.11834/jig.170156
2017-01-01
Journal of Image and Graphics
Abstract:Objective Template matching algorithms consider all possible transformations,such as rotation,scaling,and affine transformations.Template matching algorithms are commonly used to find the corresponding image regions between image pairs.However,the two following issues negatively affect its accuracy.1) When the photography baseline increases,the effective information of the area to be matched in the target image decreases and the matching accuracy gradually decreases.2) The choice of matching areas significantly influences the matching accuracy;thus,the matching results may differ considerably by selecting different regions as matching templates.We propose a template selection and matching algorithm for image matching to resolve these problems.Method First,sampling vector normalized cross-correlation (SV-NCC) is proposed to measure the regional consistency between two images by multichannel features.The proposed method discards two parameters,i.e.,△s and r,which play an important role in suppressing the interference of light and noise in the CSAD method but reduce matching accuracy.The NCC method is introduced using the "mean" and "cross-correlation" to inhibit the effect of light and noise to solve this problem.Template matching is conducted in Lab color space to better reduce the influence of the change in illumination.When computing the color similarity of two images,if the Euclidean distance of two color components < a,b > falls in a rectangle with width w and height h,then they are considered similar colors.Coefficient proportionality λ is used to adjust the proportion of brightness similarity;thus,distinction between similar colors is obtained by controlling λL.Second,we divide the image into many blocks and use the clustering method to derive several categories in accordance with the color feature.The reciprocal of the similar number of each area is used to measure similarity.The larger this value,the smaller the probability that the color or color combination is similar to the target image.Thus,the accuracy of template matching based on this location can be high.Although densitybased spatial clustering of applications with noise (DBSCAN) is used in the previously presented process,the image is divided into many blocks.Thus,no matter how large the image size is,the processing time of pixel clustering cannot substantially increase.In addition,the clustering results can exhibit a mosaic appearance but cannot affect the calculation of subsequent statistical scores.Finally,on the basisof the score map,a method for sorting the template area is proposed.These areas with high scores are selected as the final template areas.The parallel DBSCAN algorithm is also used in this research to fully utilize a multi-core CPU and reduce the computation time.For example,with an eight-core CPU,an 800 × 600 image with 100 × 100 blocks takes 2.8 s to process.Then,the computational complexity is reduced because of the fact that introducing the integral image to compute blocks can significantly reduce the processing time and can make this algorithm practical in real-life usage.Result The experiments use a 3.3 GHz,8 GB RAM,four-core CPU and are coded in MATLAB.Data from Oxford Graf,which contain six different views of the same target,and data of Pascal VOC 2010 are selected for the experiment to test the effectiveness of the proposed algorithm.The size of the template is set as 100 × 100,Tr =2,δ =0.25,and l =0.15.Given that two important parameters that affect the experimental results should be set on the basis of experience in using the CSAD,it is unsuitable to compare with the SV-NCC,which automatically computes the similarity between the blocks.Therefore,we compare the proposed method with the SAD method directly.We evaluate the proposed method in the two following aspects.1) When the baseline of photographic changes is low,the accuracy of the SAD and SV-NCC methods are all more than 90%.However,when the baseline of photographic changes increases,the matching accuracy of SAD is reduced rapidly.In the test of the sixth Graf image,the matching accuracy is less than 20% and the accuracy of SV-NCC matching is more than 40%.2) When the baseline of photographic changes increases,the matching accuracy is higher in the regions with high scores than that in the regions with low scores.Thus,the reasonable selection of regions with high scores can improve the accuracy of template matching,and the proposed method,which selects the best template positions,is verified.Conclusion The SV-NCC method is proposed to compute the similarity between regions by use of the multichannel features of colored images to resolve the previously mentioned issues when matching wide baseline colored images.On the basis of the assumption that,the lesser the color or color combination in the images to be matched,the higher the matching accuracy,a new algorithm based on the score map is proposed to optimize the template selection and improve the matching accuracy.The experiments show that this algorithm presents a significantly high image matching accuracy for wide baseline colored images.The algorithm is also robust,making it practical,particularly in areas where colored images need to be matched with high accuracy.The algorithm can also be combined with random sample consensus to eliminate mismatched regions.Quantitative and qualitative analyses of the proposed method show that it exhibits a good performance and that its matching results are suitable for image fusion,super-resolution reconstruction,and 3D reconstruction in the advanced steps.