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

Home » Public Forums » archive » About warp image on ENVI's pts file
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
About warp image on ENVI's pts file [message #63152] Tue, 28 October 2008 20:53 Go to next message
Biny Young is currently offline  Biny Young
Messages: 9
Registered: June 2008
Junior Member
Hi all,

I registrated my camera image in Envi and got the pts file. But my
problem is when I warp the image on the pts file using my IDL
program ,the output image isn't the same as the one using Envi warped.
It's not rectified correctly. But using the same pts file in Envi to
warp ,the result is all right. Could anyone tell me why?

The source code :
pro warppts

imageFile="E:\basefile.jpg"
imageData= read_image(imageFile)
ptsFile = "E:\CameraAdd.pts"
nlines = FILE_LINES(ptsFile)
sarr = STRARR(nlines)
OPENR, unit, ptsFile,/GET_LUN
READF, unit, sarr
FREE_LUN, unit
pts = strarr(4,nlines-5)
for i=5,nlines-1 do begin
pts[*,i-5] = double(strsplit(sarr(i),/extract))
endfor
; Set up the arrays of original points to be warped:
XO = double(reform(pts[0,*]))
YO = double(reform(pts[1,*]))
; Set up the arrays of points to be fit:
XI = double(reform(pts[2,*]))
YI = double(reform(pts[3,*]))
; Use POLYWARP to generate the P and Q inputs to POLY_2D:
POLYWARP, XI, YI, XO, YO, 5, P, Q
warpdims = [703,525] ;I get this dimesions from ENVI
registration widget
method = 0
imageWarp = dblarr(3,warpdims[0],warpdims[1])
imageWarp[0,*,*] = POLY_2D(REFORM(imageData[0,*,*]), P,
Q,method,warpdims[0],warpdims[1])
imageWarp[1,*,*] = POLY_2D(REFORM(imageData[1,*,*]), P,
Q,method,warpdims[0],warpdims[1])
imageWarp[2,*,*] = POLY_2D(REFORM(imageData[2,*,*]), P,
Q,method,warpdims[0],warpdims[1])

; Display the new image:
window,0,xsize=warpdims[0],ysize=warpdims[1]
TV, imageWarp,TRUE=1
end
Re: About warp image on ENVI's pts file [message #63254 is a reply to message #63152] Wed, 29 October 2008 18:59 Go to previous message
Biny Young is currently offline  Biny Young
Messages: 9
Registered: June 2008
Junior Member
On 10月29日, 上午11时53分, Biny Young <_yang...@163.com> wrote:
Does anyone do image warping? Anythind about image warping will be so
appreciated. A example or some tips...
Greeting.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: what to make of read_interfile.pro ?
Next Topic: How to warp images?

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

Current Time: Wed Oct 08 15:07:21 PDT 2025

Total time taken to generate the page: 0.00564 seconds