Applying matrices from polywarp to coordinates [message #92712] |
Fri, 12 February 2016 07:00 |
lefsky@gmail.com
Messages: 13 Registered: June 2010
|
Junior Member |
|
|
I have a series of ground control points that I need to transform with first and second degree polynomials so I can relate them (the input) to a manually digitized reference (the target)
I am using polywarp to create the transformation matrices, and that part of the task returns a zero status using either first or second order polynomial degree
polywarp,target_x,target_y,input_x,input_y,degree,kx,ky,stat us=status
print,'status:',status
I use the following code to apply the transform matrices to the input data.
est_x=fltarr(n_elements(in))
est_y=fltarr(n_elements(in))
for i=0.0,degree do begin
for j=0.0,degree do begin
est_x=est_x+(kx[i,j]*(input_x^j)*(input_y^i))
est_y=est_y+(ky[i,j]*(input_x^j)*(input_y^i))
endfor
endfor
This works fine for first order equations (2 x 2 output matrices) and fails for the second degree equations (3 x 3 matrices)
I've look these over but can't find the error in the code. Does anyone else see it? Or is there a better way to do this?
M
|
|
|