@@ -133,6 +292,91 @@ public class ErsCorrection extends GeometryCorrection {
extrinsic_corr=gc.extrinsic_corr;// ;
rigOffset=gc.rigOffset;// = null;
woi_tops=gc.woi_tops;// = null; // used to calculate scanline timing
if(deep){
forward=clone1d(forward);
right=clone1d(right);
height=clone1d(height);
roll=clone1d(roll);
pXY0=clone2d(pXY0);
XYZ_he=clone2d(XYZ_he);
XYZ_her=clone2d(XYZ_her);
rXY=clone2d(rXY);
rXY_ideal=clone2d(rXY_ideal);
rByRDist=clone1d(rByRDist);// probably it is not needed
extrinsic_corr=extrinsic_corr.clone();
if(rigOffset!=null)rigOffset=rigOffset.clone();
woi_tops=clone1d(woi_tops);
}
resetScenes();// no scenes yet
// generate initial ers velocity and roll
setupERSfromExtrinsics();
}
publicstaticdouble[]clone1d(double[]din){
if(din==null)returnnull;
returndin.clone();
}
publicstaticint[]clone1d(int[]din){
if(din==null)returnnull;
returndin.clone();
}
publicstaticboolean[]clone1d(boolean[]din){
if(din==null)returnnull;
returndin.clone();
}
publicstaticdouble[][]clone2d(double[][]din){
if(din==null)returnnull;
double[][]dout=newdouble[din.length][];
for(inti=0;i<dout.length;i++){
dout[i]=clone1d(din[i]);
}
returndout;
}
publicstaticint[][]clone2d(int[][]din){
if(din==null)returnnull;
int[][]dout=newint[din.length][];
for(inti=0;i<dout.length;i++){
dout[i]=clone1d(din[i]);
}
returndout;
}
publicstaticboolean[][]clone2d(boolean[][]din){
if(din==null)returnnull;
boolean[][]dout=newboolean[din.length][];
for(inti=0;i<dout.length;i++){
dout[i]=clone1d(din[i]);
}
returndout;
}
publicstaticdouble[][][]clone3d(double[][][]din){
if(din==null)returnnull;
double[][][]dout=newdouble[din.length][][];
for(inti=0;i<dout.length;i++){
dout[i]=clone2d(din[i]);
}
returndout;
}
// setup from extrinsics vector
publicvoidsetupERSfromExtrinsics()
{
double[]ersv=getCorrVector().getIMU();
setupERS(
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[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)
// 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 !
newdouble[]{ersv[1],-ersv[0],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)
}
publicvoidsetupERS(
...
...
@@ -142,6 +386,16 @@ public class ErsCorrection extends GeometryCorrection {
// double [] watr_center, // camera orientation (az, tilt, roll in radians, corresponding to the frame center)
double[]watr_center_dt,// camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
double[]watr_center_d2t)// camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
{
this.ers_wxyz_center=wxyz_center;// world camera XYZ (meters) for the lens center (in camera coordinates, typically 0)
this.ers_wxyz_center_dt=wxyz_center_dt;// world camera Vx, Vy, Vz (m/s)
this.ers_wxyz_center_d2t=wxyz_center_d2t;// world camera Vx, Vy, Vz (m/s^2)
this.ers_watr_center_dt=watr_center_dt;// camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
this.ers_watr_center_d2t=watr_center_d2t;// camera rotaions (az, tilt, roll in radians/s, corresponding to the frame center)
setupERS();
}
publicvoidsetupERS()
{
ers_xyz=newdouble[pixelCorrectionHeight][3];
ers_xyz_dt=newdouble[pixelCorrectionHeight][3];
...
...
@@ -156,14 +410,14 @@ public class ErsCorrection extends GeometryCorrection {
if(qParent.image_data!=null)this.image_data=qParent.image_data.clone();// each camera will be re-written, not just modified, so shallow copy
this.new_image_data=qParent.new_image_data;
if(qParent.saturation_imp!=null)this.saturation_imp=qParent.saturation_imp.clone();// each camera will be re-written, not just modified, so shallow copy
public ArrayList <CLTPass3d> clt_3d_passes = null;
public double [][] rig_disparity_strength = null; // Disparity and strength created by a two-camera rig, with disparity scale and distortions of the main camera
public double [][] rig_pre_poles_ds = null; // Rig disparity and strength before processing poles
public double [][] rig_post_poles_ds = null; // Rig disparity and strength after processing poles
public boolean [] rig_pre_poles_sel = null; // Rig tile selection before processing poles
public boolean [] rig_post_poles_sel = null; // Rig tile selection after processing poles
public double [][] main_ds_ml = null; // main camera DSI restored from the COMBO-DSI file to generate ML test files
public int clt_3d_passes_size = 0; //clt_3d_passes size after initial processing
public int clt_3d_passes_rig_size = 0; //clt_3d_passes size after initial processing and rig processing
Stringx3d_path=quadCLT_main.correctionsParameters.selectX3dDirectory(// for x3d and obj
quadCLT_main.correctionsParameters.getModelName(quadCLT_main.image_name),// quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
Stringx3d_path=quadCLT_main.correctionsParameters.selectX3dDirectory(// for x3d and obj
quadCLT_main.correctionsParameters.getModelName(quadCLT_main.image_name),// quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
String x3d_path= quadCLT_main.correctionsParameters.selectX3dDirectory( // for x3d and obj
quadCLT_main.correctionsParameters.getModelName(quadCLT_main.image_name), // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
Stringx3d_path=quadCLT_main.correctionsParameters.selectX3dDirectory(// for x3d and obj
quadCLT_main.correctionsParameters.getModelName(quadCLT_main.image_name),// quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false