Home estimation of subpixel values from images in Python
Reply: 1

estimation of subpixel values from images in Python

c-wilson Published in 2018-02-13 13:18:03Z

This question already has an answer here:

  • How to get the image pixel at real locations in opencv? 4 answers

I have an image and and am transforming it with a nonlinear spatial transformation. I have a written a function that, for every pixel (i, j) in the destination image array, returns a coordinate (y, x) in the source array.

The returned coordinate is a floating point value, meaning that it corresponds to a point that lies between the pixels in the source image.

Does anyone know if there an established method in PIL or opencv to interpolate the value of this subpixel, or should I roll my own? Thanks!

Yves Daoust
Yves Daoust Reply to 2018-02-13 17:01:33Z

There are two common methods:

  • bilinear interpolation,

  • bicubic interpolation.

These evaluate an intermediate value, based on the values at four or sixteen neighboring pixels, using weighting functions based on the fractional parts of the coordinates.

Lookup these expressions.

From my experience, the bilinear quality is often sufficient.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301158 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO