Re: using a pixel shader for undistorting an image?



pixel.to.life wrote:

Sounds like you already got the difficult part out of the way:
calibration. How did you get the mappings between distorted and
corrected image-pixels? This is what you plan to use as a lookup table
on the GPU right?

I have not done that, a colleague did it using OpenCV.

I wonder if just resampling a 640x480 image interactively when the
pixel transforms are given is too computationally intensive to move to
GPU.

No, it's not. But the CPUs are doing a lot of other things and, when the undistortion is on (we use the Remap function from OpenCV), we lose 4-5 fps.

In this case, the only such operation I see is to
resample based on a lookup table. Sounds easy enough.

Yes it does. But the result is not perfect (yet). I get some artifacts in the resulting image, basically because the offset image (2 channels containing the x and y offset for each pixel) is not very continuous: the values change abruptly along circular-like lines.
I am trying to do some interpolation in the shader but no luck yet...
.


Quantcast