lens distortion [message #36468] |
Tue, 16 September 2003 15:10  |
Ale
Messages: 6 Registered: April 2002
|
Junior Member |
|
|
I need to develop an IDL routine to correct lens distortion
(barrel/pincushion) for our CT camera. Where could I find suggestions or
examples on this topics ?
Thank you
Alessandro
|
|
|
Re: lens distortion [message #36490 is a reply to message #36468] |
Tue, 23 September 2003 11:38  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Mon, 22 Sep 2003 04:53:14 -0700, Ale wrote:
> I tried your routine but I received this error :
>
> IDL> .COMPILE "C:\WINDOWS\Desktop\lente.pro" % Compiled module:
> PINCUSHION_CORRECT. IDL> read_jpeg,filepath('people.jpg',
> SUBDIR=['examples','data']),im,/GRAYSCALE % Compiled module: FILEPATH. %
> Loaded DLM: JPEG.
> IDL> tv,[im,pincushion_correct(im,-.15)] % Compiled module: DIST. %
> SHIFT: Expression must be a scalar in this context: <LONG Array[2]>. %
> Execution halted at: PINCUSHION_CORRECT 6
> C:\WINDOWS\Desktop\lente.pro % $MAIN$
>
> Perhaps I did something wrong.
You didn't upgrade your IDL ;). This works for IDL>=v5.5. Change
product(d) to d[0]*d[1], change shift(dist(d[0],d[1]),d/2) to
shift(dist(d[0],d[1]),d[0]/2,d[1]/2), and change lindgen(d) to
lindgen(d[0],d[1]). Isn't the REFORM-style dimension notation nicer?
JD
|
|
|