From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bivariate Polynomial Fitting (for Image Rectification)

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).

 

 

 

 

 

 

 

Download All
0 Kudos
Message 1 of 2
(2,634 Views)

Can you clarify what you mean by very bad fit? It looks like the Dest points and Fitted points are on top of each other, as would be expected if the fit was good.

0 Kudos
Message 2 of 2
(2,593 Views)