A template matching algorithm based on gray Scale (II.): Local gray value coding

Source: Internet
Author: User

Brief introduction

In the previous article: gray-based template matching algorithm (a): MAD, SAD, SSD, MSD, NCC, SSDA algorithm, introduced several typical template matching algorithms, but this kind of algorithm has a high time complexity, image size sensitivity and other issues, The complexity of optimization algorithms, even for SSDA, is high.

This paper introduces a new algorithm, called local gray value coding algorithm, which is coarse-matched by the gray-scale value coding, and then matched by phase correlation method.

Algorithm Introduction

Coarse match

Similar to the assumptions in the previous article, here the size of the search graph is MXM, the size of the template T NxN, the template T on the search graph s on the slide, the upper and lower steps of sliding are N (a template size), the S is divided into a number of T-size sub-graph. If M is not an integer multiple of n, then there are a few rows remaining in the bottom and right parts of the S graph. Here is an example to illustrate.

The search graph S is a 512x512 Lena image that is m=512, and the template graph T is one of the parts, the size is 64x64, that is n=64. Just divide s into 8x8 adjacent and non-coincident sub-graphs (also called restriction blocks), and each sub-graph (limit block) is the same size as the template size. Next we are going to encode the template and each restriction block separately (this is why it is called local grayscale coding), and then determine the template with which limit block similarity is the highest, to preliminarily determine the location of the template, this is the coarse match.

Office Non-grayscale coding

Coding is done by defining R blocks of KXK size (there is a bit more in the block, and the drawing is at a glance). Take the template T code as an example, where the size of R Block is 8x8, i.e. k=8. At this point, the T is divided into 8x8 r blocks, and the pixels inside each R block are calculated.

Description: The size of the R Block is based on the situation, or it can be ..., 9x9,10x10, if n is not an integer multiple of k, the process is the same as above. In short, the smaller the R block, the more accurate the description of the image, and the greater the computational volume.

A r block is centered and its 8-neighborhood R Block, such as.







Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

A template matching algorithm based on gray Scale (II.): Local gray value coding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.