Re: using a pixel shader for undistorting an image?



"Giff" <Giffnews@xxxxxxxxx> wrote in
news:1176373177.376232.41730@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

On 12 Apr, 11:46, Harris <xgeorg...@xxxxxxxxxxxxx> wrote:


The problem you are describing is generally known as "camera
calibration"

Not exactly, maybe I was not clear enough. I already did the
calibration, now I need to use the results of it to undistort the
images coming from the camera, I know how to do this in C++, what I
want to do is to move this computation onto the GPU, using a pixel
shader.



Sorry, my mistake then....

If you already have a working code in C/C++, perhaps you can just use a GPGPU library for exactly
than purpose. The most generic way to do it, of course, is to use a pre-compiler toolkit like BrookGPU
that makes the task of shader programming much much easier when it comes to GPGPU routines.

Take a look at SourgeForge - there are some very interesting projects related to SIMD and GPGPU
programming. I plan to test some of them myself to see how they can be used in heavyweight
processing algorithms (signal processing and pattern recognition).




I think I have a clue on how to do this: in the initialization process
I will create a texture containing, for each pixe, the destination of
that pixel in the undistorted image (or probably just the offsets in
the x and y directions). I will then pass this texture to the pixel
shader and use it to sample the right pixel.




Yes, this this the main idea in geometric corrections. The main problem is how to code a fast and
straight-forward implementation, preferrably SIMD-compatible, so that the spatial-dependent
transformations can be executed as fast as possible. I think you can find some conference papers on-
line from various game companies (mostly related to FPS game engines like Unreal) that describe
some of the latest features of shader technology, including on-the-fly "lens" effects (the inverse of
which is very similar to what you are trying to do).

Good luck :-)




--
Harris
.



Relevant Pages

  • Re: DPI
    ... The pixel originates in your camera. ... There are roughly eight million Pixels on the sensor in your ... resolution discernable by the human eye. ...
    (alt.photography)
  • Re: DSLR vs Superzoom - help please
    ... crop of sub-2-micron pixel cameras). ... camera working at f/2. ... f/4, regardless of the size of the sensor, because the 'f' in f/4 stands ... So it can take the photo you want to take at a given ISO ...
    (rec.photo.digital)
  • Re: Steps From Levels?
    ... pixel has the value r, g, b, can I determine the RGB values for one ... editing, camera settings, and so on. ... But the zone system clue lead me to Norman Koren ... parameter settings in camera or image editing. ...
    (rec.photo.digital.slr-systems)
  • Re: Noise levels as a function of pixel size
    ... At shorter wavelength some information is lost; however, note that lenses usually have a very sharp decrease of performance near the violet; so maybe the information is not there in the first place;-). ... a 0.086 micron pixel, and not also into the adjacent pixel, publish it. ... http://www.dpreview.com/reviews/konicaminoltaa200/page6.asp "As noted in our other eight megapixel digital camera reviews this particular CCD in combination with compact wide angle lenses does appear to lead to purple fringing. ...
    (rec.photo.digital)
  • Re: Shooting RAW vs RAW and JPG
    ... any digital camera will ever have. ... The problem is that it is fixed, and without the raw ... or pad it out with null bits to fit into the 16-bit format. ... is 12 bits per pixel from the sensor. ...
    (rec.photo.digital)