Bicubic Interpolation for radial distortion

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bicubic Interpolation for radial distortion

hijstr
I have a question for the OpenCv community!

I was recently looking for an algorithm to blindly remove radial
distortion within images which I succesfully found here:
www.vassg.hu/pdf/vass_gg_2003_lo.pdf

After implementing this, I have my program properly removing the
distortion, the problem now is that without any interpolation, the
result is too jaggy, so I want to implement bicubic interpolation.

Now as far as I can see,there is no implementation of this in CV so
I'm trying to put together my own version. Maybe someone can clear up
how it is done for me.

At the moment, the solution in my head is to do the following:

To get the interpolated undistorted point, you need to convolve a
weighted kernel over the source image (distorted point) at the point
found through the radial distortion algorithm. Bicubic uses a 4x4 kernel.
I was thinking, if i run a smoothing kernel over the source image,
before applying the distortion removal, isn't this smoothed image
acting as a look up table of interpolated values? So instead of
convolving the bicubic kernel over the located point in the source
image, just run a kernel over EVERY point in the source, meaning you
just have to look up the values at every point?

Reply | Threaded
Open this post in threaded view
|

Re: Bicubic Interpolation for radial distortion

Golan Levin
Hijstr,

IPP already has this functionality, and allows you to choose between
bilinear, bicubic and Lanczos (sinc-like) interpolation, as well as
no-interpolation.

Unless you have specific objections to using commercial libraries
(which is certainly a consideration for some people), this might save
you some effort. IPP is extremely fast. It also has a function for
creating and re-using a remapping table, with interpolative
resampling, so that you don't have to do the same radial calculations
each time.

g



--- In [hidden email], "hijstr" <fupoff@...> wrote:

>
> I have a question for the OpenCv community!
>
> I was recently looking for an algorithm to blindly remove radial
> distortion within images which I succesfully found here:
> www.vassg.hu/pdf/vass_gg_2003_lo.pdf
>
> After implementing this, I have my program properly removing the
> distortion, the problem now is that without any interpolation, the
> result is too jaggy, so I want to implement bicubic interpolation.
>
> Now as far as I can see,there is no implementation of this in CV so
> I'm trying to put together my own version. Maybe someone can clear up
> how it is done for me.
>
> At the moment, the solution in my head is to do the following:
>
> To get the interpolated undistorted point, you need to convolve a
> weighted kernel over the source image (distorted point) at the point
> found through the radial distortion algorithm. Bicubic uses a 4x4
kernel.
> I was thinking, if i run a smoothing kernel over the source image,
> before applying the distortion removal, isn't this smoothed image
> acting as a look up table of interpolated values? So instead of
> convolving the bicubic kernel over the located point in the source
> image, just run a kernel over EVERY point in the source, meaning you
> just have to look up the values at every point?
>


Reply | Threaded
Open this post in threaded view
|

Re: Bicubic Interpolation for radial distortion

Peter Eisenlohr
In reply to this post by hijstr
hijstr schrieb:
> I was recently looking for an algorithm to blindly remove radial
> distortion within images which I succesfully found here:
> www.vassg.hu/pdf/vass_gg_2003_lo.pdf
>
> After implementing this, I have my program properly removing the
> distortion, the problem now is that without any interpolation, the
> result is too jaggy, so I want to implement bicubic interpolation.

There is bilinear interpolation available when using cvUndistort2(). You
can also use bicubic interpolation when using cvInitUndistortMap() etc.
and passing CV_INTER_CUBIC to cvRemap(). The results of either look fine
to me, maybe there's another source of the jaggedyness?

  Peter