Monday, July 2, 2012

Image Processing - Template Matching

The following code segment can be used to perform a simple template matching which maps pixel by pixel between two images, gets a count of the errors/mismatching pixels and through the calculation of a error rate it determines weather the two images are same or not. Error rate is calculated by dividing the total errors by the total number of pixels inspected. In this example I've used 30 as the margin between matching and mismatching.



You can download a sample from the following link :
Template Matching Sample

1 comment:

  1. this is very use full.good post.
    but there is a problem.
    if we consider 2 same images.but with different resolutions(image A - 600x600 image B - 80x80 pixels),
    then this code doesn't work.
    what do u suggest that type of thing?

    ReplyDelete