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

Home » Public Forums » archive » Image warping in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Image warping in IDL [message #51276 is a reply to message #51188] Fri, 10 November 2006 01:05 Go to previous messageGo to previous message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On Thu, 09 Nov 2006 12:50:15 -0700, JD Smith <jdsmith@as.arizona.edu>
wrote:

> I'm afraid if you want to get any further with this, you are going to
> have to illustrate the issue with a small amount of actual IDL code.

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; img points to the input image
imgs=size(*img)
seval=indgen(imgs[1])
teval=indgen(imgs[2])
xmap=seval#replicate(1b,imgs[2])
ymap=replicate(1b,imgs[1])#teval

; X-distortion
xmap+=bsplineint2Dcp(xuvec,xvvec,xp,xq,xn,xm,xh,xk,seval,tev al,xCP)
; -> these parameters come from an external source
; Y-distortion
ymap+=bsplineint2Dcp(yuvec,yvvec,yp,yq,yn,ym,yh,yk,seval,tev al,yCP)
; -> these parameters come from an external source

; At this point we have the corresponding output pixel (non-integer)
for each input pixel

; Forward mapping: resample_array performs Fant's resampling
algorithm:
interimg=ptr_new(*img)

; loop over rows
for i=0,imgs[2]-1 do $
resample_array, xmap[*,i], img, interimg, imgs[1], 1,
i*imgs[1]
; loop over columns
for i=0,imgs[1]-1 do $
resample_array, ymap[i,*], interimg, img, imgs[2], imgs[1], i

ptr_free,interimg

; img now points to the output image
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The two loops are the time consumers.
So to repeat the question:
1. Can I do something faster then the looping to resample the image?
OR
2. Is there a "magic operation" for converting CP's and uvec/vvec so
that xmap and ymap describe distortion of output pixels?

I'd like to refer to this URL for the spline surface evaluated in
bsplineint2Dcp:
http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/surface/bs pline-construct.html
So I've got the control points(CP), the knot vectors(uvec and vvec)
and I have the degrees(p,q).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Making movies
Next Topic: Re: Pair Counts in an Annulus, for large data sets

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

Current Time: Wed Oct 08 14:32:47 PDT 2025

Total time taken to generate the page: 0.00410 seconds