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

Home » Public Forums » archive » Re: fft and least sqaues problem
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: fft and least sqaues problem [message #81141 is a reply to message #81135] Tue, 14 August 2012 11:22 Go to previous messageGo to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
Finally, I found the mistake - sitting in front of this pc :)

Here is the code:

s=size(im,/dim)*1.
im1 =im
dx=.25
dy=.3
im2=image_shift(im1,dx,dy);more precise then interpolate(im,findgen(s[0])+dx,findgen(s[1])+dy,/grid,/cubi c)
fim1=fft(im1,-1)
fim2=fft(im2,-1)
corr=fim1*conj(fim2)/abs(fim1*fim2)
corr=shift(corr,s/2)
phase=atan(imaginary(corr)/real_part(corr))
wx=(findgen(s) mod s[0])
wy=(rebin(findgen(1,s[1]),s))
wx-=s[0]/2
wy-=s[1]/2
wx*=2.*!pi/s[0]
wy*=2.*!pi/s[1]
r=5;fitting radius
phase2=phase[s[0]/2 - r : s[0]/2 + r,s[1]/2 - r : s[1]/2 + r]
wx2=wx[s[0]/2 - r : s[0]/2 + r,s[1]/2 - r : s[1]/2 + r]
wy2=wy[s[0]/2 - r : s[0]/2 + r,s[1]/2 - r : s[1]/2 + r]
print,la_least_squares(transpose([[wx2[*]],[wy2[*]]]),phase2 [*])

Thanks Helder!

Cheers

CR
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coyote Library Updates
Next Topic: RESOLVE_ROUTINE not finding MEDIAN function?

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

Current Time: Sun Oct 12 12:09:35 PDT 2025

Total time taken to generate the page: 1.52017 seconds