((single_set_name==null)||(correctionsParameters.getNameFromTiff(sourceFiles[nFile]).contains(single_set_name)))){// not used in lwir
((single_set_name==null)||((correctionsParameters.getNameFromTiff(sourceFiles[nFile])!=null)&&correctionsParameters.getNameFromTiff(sourceFiles[nFile]).contains(single_set_name)))){// not used in lwir
finaldoublemin_neib_strength1=clt_parameters.imp.sfm_neib_str1;// 0.5; // update if no-individual and neibs correction strength exceeds
finaldoublemin_neib_strength1=clt_parameters.imp.sfm_neib_str1;// 0.5; // update if no-individual and neibs correction strength exceeds
finaldoublemin_neib_strength16=clt_parameters.imp.sfm_neib_str16;// 0.5; // update if no-individual and neibs correction strength exceeds
finaldoublemin_neib_strength16=clt_parameters.imp.sfm_neib_str16;// 0.5; // update if no-individual and neibs correction strength exceeds
...
@@ -639,6 +652,9 @@ public class StructureFromMotion {
...
@@ -639,6 +652,9 @@ public class StructureFromMotion {
scene_pairs,// final QuadCLT[][] scene_pairs,
scene_pairs,// final QuadCLT[][] scene_pairs,
scenes_xyzatr,// final double[][][][] scenes_xyzatr, // new double[num_pairs][2][][]; // 2 scenes
scenes_xyzatr,// final double[][][][] scenes_xyzatr, // new double[num_pairs][2][][]; // 2 scenes
scenes_xyzatr_dt,// final double[][][][] scenes_xyzatr_dt, // new double[num_pairs][2][][];// 2 scenes
scenes_xyzatr_dt,// final double[][][][] scenes_xyzatr_dt, // new double[num_pairs][2][][];// 2 scenes
sfm_min_gain,// final double sfm_min_gain,
sfm_min_frac,// final double sfm_min_frac,
mb_max_gain,// final double mb_max_gain,
mb_max_gain,// final double mb_max_gain,
range_disparity_offset,// final double range_disparity_offset, // disparity at actual infinity // clt_parameters.imp.range_disparity_offset ; final double mb_max_gain,
range_disparity_offset,// final double range_disparity_offset, // disparity at actual infinity // clt_parameters.imp.range_disparity_offset ; final double mb_max_gain,
corr_fz_inter,// final double corr_fz_inter,
corr_fz_inter,// final double corr_fz_inter,
...
@@ -648,6 +664,13 @@ public class StructureFromMotion {
...
@@ -648,6 +664,13 @@ public class StructureFromMotion {
n_recenter,// final int n_recenter, // when cosine window, re-center window this many times
n_recenter,// final int n_recenter, // when cosine window, re-center window this many times
batch_mode,// final boolean batch_mode,
batch_mode,// final boolean batch_mode,
debugLevel);// final int debugLevel)
debugLevel);// final int debugLevel)
if(sfmCorr==null){
if(debugLevel>-3){
System.out.println("sfmPair(): not enough SfM tiles, bailing out");
}
returnnull;
}
if((sfm_shrink>0)||(fade_sigma>0.0)){
if((sfm_shrink>0)||(fade_sigma>0.0)){
shrinkFadeSfmGain(
shrinkFadeSfmGain(
sfm_shrink,// final int sfm_shrink,
sfm_shrink,// final int sfm_shrink,
...
@@ -783,6 +806,9 @@ public class StructureFromMotion {
...
@@ -783,6 +806,9 @@ public class StructureFromMotion {
@@ -947,6 +994,8 @@ public class StructureFromMotion {
...
@@ -947,6 +994,8 @@ public class StructureFromMotion {
scene_pairs_sets[nset],// final QuadCLT[][] scene_pairs,
scene_pairs_sets[nset],// final QuadCLT[][] scene_pairs,
scenes_xyzatr_sets[nset],// final double[][][][] scenes_xyzatr, // new double[num_pairs][2][][]; // 2 scenes
scenes_xyzatr_sets[nset],// final double[][][][] scenes_xyzatr, // new double[num_pairs][2][][]; // 2 scenes
scenes_xyzatr_dt_sets[nset],// final double[][][][] scenes_xyzatr_dt, // new double[num_pairs][2][][];// 2 scenes
scenes_xyzatr_dt_sets[nset],// final double[][][][] scenes_xyzatr_dt, // new double[num_pairs][2][][];// 2 scenes
sfm_min_gain,// final double sfm_min_gain,
sfm_min_frac,// final double sfm_min_frac,
mb_max_gain,// final double mb_max_gain,
mb_max_gain,// final double mb_max_gain,
range_disparity_offset,// final double range_disparity_offset, // disparity at actual infinity // clt_parameters.imp.range_disparity_offset ; final double mb_max_gain,
range_disparity_offset,// final double range_disparity_offset, // disparity at actual infinity // clt_parameters.imp.range_disparity_offset ; final double mb_max_gain,
corr_fz_inter,// final double corr_fz_inter,
corr_fz_inter,// final double corr_fz_inter,
...
@@ -956,6 +1005,13 @@ public class StructureFromMotion {
...
@@ -956,6 +1005,13 @@ public class StructureFromMotion {
n_recenter,// final int n_recenter, // when cosine window, re-center window this many times
n_recenter,// final int n_recenter, // when cosine window, re-center window this many times
batch_mode,// final boolean batch_mode,
batch_mode,// final boolean batch_mode,
debugLevel);// final int debugLevel)
debugLevel);// final int debugLevel)
if(sfmCorr==null){
if(debugLevel>-3){
System.out.println("sfmPairsSet(): not enough SfM tiles, bailing out");
}
returnnull;
}
if((sfm_shrink>0)||(fade_sigma>0.0)){
if((sfm_shrink>0)||(fade_sigma>0.0)){
shrinkFadeSfmGain(
shrinkFadeSfmGain(
sfm_shrink,// final int sfm_shrink,
sfm_shrink,// final int sfm_shrink,
...
@@ -1472,6 +1528,8 @@ public class StructureFromMotion {
...
@@ -1472,6 +1528,8 @@ public class StructureFromMotion {
* @param scene_pairs pairs of scene instances to correlate ([1] to [0])
* @param scene_pairs pairs of scene instances to correlate ([1] to [0])
* @param scenes_xyzatr pairs of scene poses relative to the reference one
* @param scenes_xyzatr pairs of scene poses relative to the reference one
* @param scenes_xyzatr_dt pairs of scene poses derivatives (for ERS)
* @param scenes_xyzatr_dt pairs of scene poses derivatives (for ERS)
* @param sfm_min_gain minimal SfM gain to apply SfM to the depth map
* @param sfm_min_frac minimal fraction of defined tiles to have SfM correction
* @param mb_max_gain motion blur correction maximal gain
* @param mb_max_gain motion blur correction maximal gain
* @param range_disparity_offset disparity at actual infinity. Here can be just 0.
* @param range_disparity_offset disparity at actual infinity. Here can be just 0.
* @param corr_fz_inter Fat zero correction. Recommended value:
* @param corr_fz_inter Fat zero correction. Recommended value:
...
@@ -1484,7 +1542,8 @@ public class StructureFromMotion {
...
@@ -1484,7 +1542,8 @@ public class StructureFromMotion {
* @param debugLevel debug level
* @param debugLevel debug level
* @return per tile array (sparse) of SfmCorr instances, containing tile's SfM gain,
* @return per tile array (sparse) of SfmCorr instances, containing tile's SfM gain,
* individual disparity correction (to add to the current disparity)/strength and
* individual disparity correction (to add to the current disparity)/strength and
* optionally averaged between neighbors correction/strength
* optionally averaged between neighbors correction/strength. Returns null if there
* insufficient tiles with high enough disparity gain.
*/
*/
publicstaticSfmCorr[]getSfmCorr(
publicstaticSfmCorr[]getSfmCorr(
finalCLTParametersclt_parameters,
finalCLTParametersclt_parameters,
...
@@ -1495,6 +1554,8 @@ public class StructureFromMotion {
...
@@ -1495,6 +1554,8 @@ public class StructureFromMotion {
finalQuadCLT[][]scene_pairs,
finalQuadCLT[][]scene_pairs,
finaldouble[][][][]scenes_xyzatr,// new double[num_pairs][2][][]; // 2 scenes
finaldouble[][][][]scenes_xyzatr,// new double[num_pairs][2][][]; // 2 scenes
finaldouble[][][][]scenes_xyzatr_dt,// new double[num_pairs][2][][];// 2 scenes
finaldouble[][][][]scenes_xyzatr_dt,// new double[num_pairs][2][][];// 2 scenes
finaldoublesfm_min_gain,
finaldoublesfm_min_frac,
finaldoublemb_max_gain,
finaldoublemb_max_gain,
finaldoublerange_disparity_offset,// disparity at actual infinity // clt_parameters.imp.range_disparity_offset ; final double mb_max_gain,
finaldoublerange_disparity_offset,// disparity at actual infinity // clt_parameters.imp.range_disparity_offset ; final double mb_max_gain,
finaldoublecorr_fz_inter,
finaldoublecorr_fz_inter,
...
@@ -1607,10 +1668,18 @@ public class StructureFromMotion {
...
@@ -1607,10 +1668,18 @@ public class StructureFromMotion {
clt_parameters,// final CLTParameters clt_parameters,
clt_parameters,// final CLTParameters clt_parameters,
data_PD[i],// final double [][] corr2d_PD,
data_PD[i],// final double [][] corr2d_PD,
dpXYddisp_avg,// final double [][] dpXYddisp,
dpXYddisp_avg,// final double [][] dpXYddisp,
sfm_min_gain,// final double sfm_min_gain,
sfm_min_frac,// final double sfm_min_frac,
centroid_radius,// final double centroid_radius, // 0 - use all tile, >0 - cosine window around local max
centroid_radius,// final double centroid_radius, // 0 - use all tile, >0 - cosine window around local max
n_recenter,// final int n_recenter, // when cosine window, re-center window this many times
n_recenter,// final int n_recenter, // when cosine window, re-center window this many times
corr_size,//final int corr_size, // 15
corr_size,//final int corr_size, // 15
debugLevel);// final int debugLevel);
debugLevel);// final int debugLevel);
if(disp_corr[i]==null){
if(debugLevel>-3){
System.out.println("getSfmCorr(): not enough SfM tiles, bailing out");
}
returnnull;
}
}
}
ai.set(0);
ai.set(0);
...
@@ -1717,18 +1786,23 @@ public class StructureFromMotion {
...
@@ -1717,18 +1786,23 @@ public class StructureFromMotion {
* pixels in X and Y directions.
* pixels in X and Y directions.
* @param clt_parameters processing parameters
* @param clt_parameters processing parameters
* @param corr2d_PD per-tile sparse array of the 2D correlation results
* @param corr2d_PD per-tile sparse array of the 2D correlation results
* @param dpXYddisp per-tile sparse array of the X,Y components of teh SfM gain
* @param dpXYddisp per-tile sparse array of the X,Y components of the SfM gain
* @param sfm_min_gain minimal SfM gain to apply SfM to the depth map
* @param sfm_min_frac minimal fraction of defined tiles to have SfM correction
* @param centroid_radius windowing for centroid argmax: 0 - use all tile, >0 - cosine
* @param centroid_radius windowing for centroid argmax: 0 - use all tile, >0 - cosine
* window around local max
* window around local max
* @param n_recenter number of refining of the argmax
* @param n_recenter number of refining of the argmax
* @param corr_size 2d correlation tile size (side of a square, normally 15)
* @param corr_size 2d correlation tile size (side of a square, normally 15)
* @param debugLevel debug level
* @param debugLevel debug level
* @return per tile sparse array of {disparity_correction, strength} pairs
* @return per tile sparse array of {disparity_correction, strength} pairs. Will return
* null if number of sfm tiles is less than sfm_min_frac of defined tiles