I need to rectify 1 image respect to another (sort of orthorectification for satellite imagery). Distortion is severe and therefore I need to use a 3rd degree polynomial to unwarp the 2nd image and superpose on the first image.
A number of correspondence points are manually chosen from the 2 images. Therefore I have an array of X,Y coordinates from the first image and corresponding X,Y coordinates in the second image.
I need to fit those values into a 3rd degree polynomial that I'll use to warp the image (I need to calculate the polynomial coefficients).
Therefore the problem is properly fitting 2 Bivariate polynomial of 3rd degree with the X,Y source-destination point values and calculate the polynomial coefficients.
I have tryed adapting some code I have found on the forum for Poly3D fitting but the fitting I obtain is very bad ! (see attached vi). My math skills are limited and therefore I need a vi sample that can be adapted to my need (not pure math explaination).
Furthermore to complicate things further I have found at least 3 versions of Bivariate Polynomial equations that could apply to my specific case (it seem that eliminating some terms from the equations may provide more stable results when used for correcting image distortions); see attached images for an example of the polynomials I would like to fit.
Anyone have a suggestion to solve this problem ?
p.s. Cannot and don't want to use IMAQ Vision for that (furthermore image rectification results are not good anyway in my case).