public static void applyDistortion ( Point2D_F64 normPt , double [ ] radial , double t1 , double t2 ) { final double x = normPt . x ; final double y = normPt . y ; double a = 0 ; double r2 = x * x + y * y ; double r2i = r2 ; for ( int i = 0 ; i < radial . length ; i ++ ) { a += radial [ i ] * r2i ; r2i *= r2 ; } normPt . x = x + x * a + 2 * t1 * x * y + t2 * ( r2 + 2 * x * x ) ; normPt . y = y + y * a + t1 * ( r2 + 2 * y * y ) + 2 * t2 * x * y ; }
Applies radial and tangential distortion to the normalized image coordinate .