<p><a href="https://i.sstatic.net/I60wq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/I60wq.png" alt="enter image description here"></a></p>

<p>I use template matching to detect a specific pattern in image.The shift determined is very shaky. Currently I apply it to R,G,B channel separately and average the result to obtain float values.Please, suggest how to obtain subpixel accuracy. I was planning to resize the image and then return the data in original scale, please suggest any other better method </p>

CC BY-SA 3.0
2016-03-03T14:48:16.543Z
Are you looking to measure details smaller than a pixel by looking at several different instances of the pattern that have different offsets from the pixel grid? Or are you looking to use the arrangement of the red, green and blue subpixels to improve accuracy with a single instance of the pattern?
trichoplax is on Codidact now
CC BY-SA 3.0
2016-03-04T03:24:09.633Z
I'm trying to measure details smaller than a pixel so by several instance you mean shifting it to left or right and then match .Thanks for your response.
Nikita Chopra
CC BY-SA 3.0
2016-03-04T12:30:21.587Z
By several instances I mean an image with a repeat pattern as described [here](http://computergraphics.stackexchange.com/questions/1880/what-is-the-state-of-the-art-on-using-computers-to-clean-up-images/1881#1881). By red, green and blue subpixels I mean taking advantage of the placement of different colours within a single pixel (the pixel geometry) as described [here](http://computergraphics.stackexchange.com/questions/424/subpixel-rendering-for-a-ray-tracer). It sounds like you probably mean the first approach.
trichoplax is on Codidact now
<algorithm><image-processing>
Template matching subpixel accuracy
Nikita Chopra
# Template matching subpixel accuracy

(Asked by: username_0 on 2016-03-03)

[![enter image description here](https://i.sstatic.net/I60wq.png)](https://i.sstatic.net/I60wq.png)

I use template matching to detect a specific pattern in image.The shift determined is very shaky. Currently I apply it to R,G,B channel separately and average the result to obtain float values.Please, suggest how to obtain subpixel accuracy. I was planning to resize the image and then return the data in original scale, please suggest any other better method

**Tags:** algorithm, image-processing

> **Comments:**
> **username_1**: Are you looking to measure details smaller than a pixel by looking at several different instances of the pattern that have different offsets from the pixel grid? Or are you looking to use the arrangement of the red, green and blue subpixels to improve accuracy with a single instance of the pattern?  
> **username_0**: I'm trying to measure details smaller than a pixel so by several instance you mean shifting it to left or right and then match .Thanks for your response.  
> **username_1**: By several instances I mean an image with a repeat pattern as described [here](http://computergraphics.stackexchange.com/questions/1880/what-is-the-state-of-the-art-on-using-computers-to-clean-up-images/1881#1881). By red, green and blue subpixels I mean taking advantage of the placement of different colours within a single pixel (the pixel geometry) as described [here](http://computergraphics.stackexchange.com/questions/424/subpixel-rendering-for-a-ray-tracer). It sounds like you probably mean the first approach.  

---

## 0 answers

