@@ -534,15 +726,21 @@ public class ErsCorrection extends GeometryCorrection {
...
@@ -534,15 +726,21 @@ public class ErsCorrection extends GeometryCorrection {
// setup from extrinsics vector
// setup from extrinsics vector
publicvoidsetupERSfromExtrinsics()
publicvoidsetupERSfromExtrinsics()
{
{
doubleBUGS=26.5/36.38;// tempoorary correction for the wrong scan line time!
double[]ersv=getCorrVector().getIMU();
double[]ersv=getCorrVector().getIMU();
setupERS(
setupERS(
newdouble[3],// double [] wxyz_center, // world camera XYZ (meters) for the frame center
newdouble[3],// double [] wxyz_center, // world camera XYZ (meters) for the frame center
newdouble[]{ersv[3],ersv[4],ersv[5]},// double [] wxyz_center_dt, // world camera Vx, Vy, Vz (m/s)
newdouble[]{BUGS*ersv[3],BUGS*ersv[4],BUGS*ersv[5]},// double [] wxyz_center_dt, // world camera Vx, Vy, Vz (m/s)
newdouble[3],// double [] wxyz_center_d2t, // world camera Vx, Vy, Vz (m/s^2)
newdouble[3],// double [] wxyz_center_d2t, // world camera Vx, Vy, Vz (m/s^2)
// double [] watr_center, // camera orientation (az, tilt, roll in radians, corresponding to the frame center)
// double [] watr_center, // camera orientation (az, tilt, roll in radians, corresponding to the frame center)
// new double [] {ersv[1], ersv[0], ersv[2]}, // double [] watr_center_dt, // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
// new double [] {ersv[1], ersv[0], ersv[2]}, // double [] watr_center_dt, // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
// REVERSING tilt sign !
// REVERSING tilt sign !
newdouble[]{ersv[1],-ersv[0],ersv[2]},// double [] watr_center_dt, // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
/// new double [] {ersv[1], -ersv[0], ersv[2]}, // double [] watr_center_dt, // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
//// new double [] {-ersv[1], -ersv[0], ersv[2]}, // double [] watr_center_dt, // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
// 2* - because watr_center_dt is now 2 * omega!
// new double [] {-2*BUGS*ersv[1], -2*BUGS*ersv[0], 2*BUGS*ersv[2]}, // double [] watr_center_dt, // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
newdouble[]{-2*BUGS*ersv[1],-2*BUGS*ersv[0],-2*BUGS*ersv[2]},// double [] watr_center_dt, // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
newdouble[3]);// double [] watr_center_d2t) // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
newdouble[3]);// double [] watr_center_d2t) // camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
}
}
...
@@ -730,64 +928,6 @@ public class ErsCorrection extends GeometryCorrection {
...
@@ -730,64 +928,6 @@ public class ErsCorrection extends GeometryCorrection {
returnpXpYD;
returnpXpYD;
}
}
publicdouble[]getImageCoordinatesReferenceERS(
QuadCLTcameraQuadCLT,// camera station that got image to be to be matched
doublepx,// pixel coordinate X in this camera view
doublepy,// pixel coordinate Y in this camera view
doubledisparity,// this view disparity
booleandistortedView,// This camera view is distorted (diff.rect), false - rectilinear
double[]reference_xyz,// this view position in world coordinates (typically zero3)
double[]reference_atr,// this view orientation relative to world frame (typically zero3)
booleandistortedCamera,// camera view is distorted (false - rectilinear)
double[]camera_xyz,// camera center in world coordinates
double[]camera_atr,// camera orientation relative to world frame
doubleline_err)// threshold error in scan lines (1.0)
double[][]vector_XYS=correlate2DIterate(// returns optical flow and confidence
// for prepareSceneTiles()
camera_xyz0,// final double [] scene_xyz, // camera center in world coordinates
camera_atr0,// final double [] scene_atr, // camera orientation relative to world frame
scene_QuadCLT,// final QuadCLT scene_QuadClt,
reference_QuadCLT,// final QuadCLT reference_QuadClt,
reference_tiles_macro,// final double [][] reference_tiles_macro,
clt_parameters.ofp.center_occupancy_ref,// final double reference_center_occupancy, // fraction of remaining tiles in the center 8x8 area (<1.0)
// flowXY should be initialized to all pairs of zeros (or deliberate pixel offset pairs if initial error is too high, will be modified with each iteration
flowXY,// final double [][] flowXY, // per macro tile {mismatch in image pixels in X and Y directions // initialize to [reference_tiles.length][2]
clt_parameters.ofp.tolerance_absolute_inter,// final double tolerance_absolute, // absolute disparity half-range in each tile
clt_parameters.ofp.tolerance_relative_inter,// final double tolerance_relative, // relative disparity half-range in each tile
clt_parameters.ofp.occupancy_inter,// final double occupancy, // fraction of remaining tiles (<1.0)
clt_parameters.ofp.num_laplassian,// final int num_passes,
clt_parameters.ofp.change_laplassian,// final double max_change,
// for correlate2DSceneToReference ()
clt_parameters.ofp.chn_weights,// final double [] chn_weights, // absolute, starting from strength (strength,r,b,g)
clt_parameters.ofp.corr_sigma,// final double corr_sigma,
clt_parameters.ofp.fat_zero,// final double fat_zero,
clt_parameters.ofp.late_normalize_iterate,// final boolean late_normalize,
// for correlation2DToVectors_CM()
clt_parameters.ofp.iradius_cm,// final int iradius, // half-size of the square to process
clt_parameters.ofp.dradius_cm,// final double dradius, // weight calculation (1/(r/dradius)^2 + 1)
clt_parameters.ofp.refine_num_cm,// final int refine_num, // number of iterations to apply weights around new center
clt_parameters.ofp.num_refine_all,// final int num_run_all, // run all tiles for few iterations before filtering
clt_parameters.ofp.max_refines,// final int max_tries,
// for recalculateFlowXY()
clt_parameters.ofp.magic_scale,// final double magic_scale, // 0.85 for CM
clt_parameters.ofp.min_change,// final double min_change,
clt_parameters.ofp.best_neibs_num,// final int best_num,
clt_parameters.ofp.ref_stdev,// final double ref_stdev,
clt_parameters.ofp.debug_level_iterate);// final int debug_level)