comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » lens distortion
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
lens distortion [message #36468] Tue, 16 September 2003 15:10 Go to next message
Ale is currently offline  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 Go to previous message
JD Smith is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How to use the SPAWN pipe?
Next Topic: Re: Mercator Map Projection Image and Contour "Bleeding" Problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:46:33 PDT 2025

Total time taken to generate the page: 0.39959 seconds