Commit ee9c0264 authored by Andrey Filippov's avatar Andrey Filippov

Implemented main camera field correction from the DSI of the dual camera

rig.
parent b3afa1ab
This diff is collapsed.
This diff is collapsed.
......@@ -35,6 +35,8 @@ public class LinkPlanes {
public double plFrontoTol; // = 0.2; plFrontoTol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable
public double plFrontoRms; // = 0.05; // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes
public double plFrontoOffs; // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
public double PlFrontoPow; // = 1.0; // increase weight even more
public double plMinStrength; // = 0.1; // Minimal total strength of a plane
public double plMaxEigen; // = 0.05; // Maximal eigenvalue of a plane
public double plEigenFloor; // = 0.01; // Add to eigenvalues of each participating plane and result to validate connections
......@@ -139,6 +141,7 @@ public class LinkPlanes {
plFrontoTol = clt_parameters.plFrontoTol;
plFrontoRms = clt_parameters.plFrontoRms;
plFrontoOffs = clt_parameters.plFrontoOffs;
PlFrontoPow = clt_parameters.PlFrontoPow;
plMaxOverlap = clt_parameters.plMaxOverlap;
......@@ -3994,6 +3997,7 @@ public class LinkPlanes {
plFrontoTol, // final double fronto_tol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable this feature
plFrontoRms, // final double fronto_rms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes
plFrontoOffs, // final double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
PlFrontoPow, // final double PlFrontoPow, // = 1.0; // increase weight even more
debugLevel, // final int debugLevel)
dbg_tileX,
dbg_tileY);
......@@ -4519,6 +4523,7 @@ public class LinkPlanes {
plFrontoTol, // final double fronto_tol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable this feature
plFrontoRms, // final double fronto_rms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes
plFrontoOffs, // final double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
PlFrontoPow, // final double PlFrontoPow, // = 1.0; // increase weight even more
debugLevel, // final int debugLevel)
dbg_tileX,
dbg_tileY);
......@@ -4613,6 +4618,7 @@ public class LinkPlanes {
plFrontoTol, // final double fronto_tol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable this feature
plFrontoRms, // final double fronto_rms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes
plFrontoOffs, // final double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
PlFrontoPow, // final double PlFrontoPow, // = 1.0; // increase weight even more
debugLevel, // final int debugLevel)
dbg_tileX,
dbg_tileY);
......
This diff is collapsed.
This diff is collapsed.
......@@ -1350,6 +1350,7 @@ public class TilePlanes {
double fronto_tol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable this feature
double fronto_rms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes. May be tighter
double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
double fronto_pow, // = 1.0; // increase weight even more
double [][][] disp_str, // calculate just once when removing outliers (null - OK, will generate it)
double inTargetEigen, // target eigenvalue for primary axis (is disparity-dependent, so is non-constant)
int maxRemoved, // maximal number of tiles to remove (not a constant)
......@@ -1470,7 +1471,7 @@ public class TilePlanes {
almost_fronto, // boolean fronto_mode,
fronto_offs, // double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
fronto_pow, // double fronto_pow, // = 1.0; // increase weight even more
this.mlfp,
debugLevel-1) != null);
......@@ -1516,6 +1517,8 @@ public class TilePlanes {
this.smplMode,
almost_fronto, // boolean fronto_mode,
fronto_offs, // double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
fronto_pow, // double fronto_pow, // = 1.0; // increase weight even more
this.mlfp,
debugLevel-0) != null); // will show image
if (!OK) { // restore how it was
......@@ -1561,7 +1564,9 @@ public class TilePlanes {
smplMode, // = true; // Use sample mode (false - regular tile mode)
false, // boolean fronto_mode,
0.0, //double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
0.0, // double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
1.0, // double fronto_pow, // = 1.0; // increase weight even more
mlfp,
debugLevel);
......@@ -1606,6 +1611,7 @@ public class TilePlanes {
boolean fronto_mode,
double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
double fronto_pow, // = 1.0; // increase weight even more
MeasuredLayersFilterParameters mlfp,
int debugLevel)
......@@ -1823,7 +1829,11 @@ public class TilePlanes {
if (w > 0.0){
double d = disp_str[nl][0][indx];
if (d > d0) {
w *= (d-d0)/fronto_offs; // more weight of the near pixels, same weight of the centre pixels
double kw = (d-d0)/fronto_offs; // more weight of the near pixels, same weight of the centre pixels
if (fronto_pow != 1.00) {
kw = Math.pow(kw, fronto_pow);
}
w *= kw; // increase influence of near pixels even more
disp_str[nl][1][indx] = w;
sw += w;
swz += w * d;
......@@ -4280,6 +4290,7 @@ public class TilePlanes {
double fronto_tol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable this feature
double fronto_rms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes. May be tighter
double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
double fronto_pow, // = 1.0; // increase weight even more
int debugLevel)
{
if (debugLevel > 2) {
......@@ -4371,6 +4382,7 @@ public class TilePlanes {
fronto_tol, // double fronto_tol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable this feature
fronto_rms, // double fronto_rms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes. May be tighter
fronto_offs, //double fronto_offs, // = 0.2; // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0 - disable
fronto_pow, // double fronto_pow, // = 1.0; // increase weight even more
disp_strength,
plTargetEigen, // targetV, // double targetEigen, // target eigenvalue for primary axis (is disparity-dependent, so is non-constant)
max_outliers, // int maxRemoved, // maximal number of tiles to remove (not a constant)
......
......@@ -704,14 +704,6 @@ public class TileProcessor {
CLTPass3d combo_pass =new CLTPass3d(this);
final int tlen = tilesX * tilesY;
// final int disparity_index = usePoly ? ImageDtt.DISPARITY_INDEX_POLY : ImageDtt.DISPARITY_INDEX_CM;
// combo_pass.tile_op = new int [tilesY][tilesX]; // for just non-zero
// combo_pass.disparity_map = new double [ImageDtt.DISPARITY_TITLES.length][];
// for (int i = 0; i< ImageDtt.QUAD; i++) combo_pass.disparity_map[ImageDtt.IMG_DIFF0_INDEX + i] = new double[tlen];
// for now - will copy from the best full correlation measurement
// combo_pass.texture_tiles = new double [tilesY][tilesX][][];
// combo_pass.max_tried_disparity = new double [tilesY][tilesX];
combo_pass.is_combo = true;
combo_pass.calc_disparity = disparity.clone(); //new double [tlen];
combo_pass.calc_disparity_combo = disparity.clone(); //new double [tlen];
......@@ -5344,6 +5336,7 @@ public class TileProcessor {
clt_parameters.plFrontoTol, // final double plFrontoTol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable
clt_parameters.plFrontoRms, // final double plFrontoRms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes
clt_parameters.plFrontoOffs, // final double plFrontoOffs, // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0
clt_parameters.PlFrontoPow, // final double PlFrontoPow, // = 1.0; // increase weight even more
geometryCorrection,
clt_parameters.correct_distortions,
......@@ -5365,6 +5358,24 @@ public class TileProcessor {
clt_parameters.stHighMix, // stHighMix = 0.4; // Consider merging initial planes if jumps between ratio above
world_hor, // final double [] world_hor, // horizontal plane normal (default [0.0, 1.0, 0.0])
clt_parameters.show_histograms, // final boolean show_histograms,
clt_parameters.ft_mod_strength, // final boolean mod_strength, // when set, multiply each tile strength by the number of selected neighbors
clt_parameters.ft_clusterize_by_highest, // final boolean clusterize_by_highest = true;
clt_parameters.ft_clust_sigma, // final double clust_sigma = 0.7;
clt_parameters.ft_disp_arange_vert, // final double disp_arange_vert = 0.07;
clt_parameters.ft_disp_rrange_vert, // final double disp_rrange_vert = 0.01;
clt_parameters.ft_disp_arange_hor, // final double disp_arange_hor = 0.035;
clt_parameters.ft_disp_rrange_hor, // final double disp_rrang_hor = 0.005;
clt_parameters.ft_tolerance_above_near, // final double tolerance_above_near = 100.0; // 0.07; any?
clt_parameters.ft_tolerance_below_near, // final double tolerance_below_near = -0.01;
clt_parameters.ft_tolerance_above_far, // final double tolerance_above_far = 0.07;
clt_parameters.ft_tolerance_below_far, // final double tolerance_below_far = 0.1; // 100.0; // any farther
clt_parameters.ft_hor_vert_overlap, // final int hor_vert_overlap = 2;
clt_parameters.ft_used_companions, // final int used_companions = 5; // cell that has this many new used companions is considered used (borders and already use3d are considered used too)
clt_parameters.ft_used_true_companions, // final int used_true_companions = 1; // there should be at least this many new selected tiles among neighbors.,
//clt_parameters.ft_
clt_parameters.debug_initial_discriminate, // final boolean debug_initial_discriminate,
clt_parameters.batch_run?-3:debugLevel, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
......@@ -5418,6 +5429,7 @@ public class TileProcessor {
clt_parameters.plFrontoTol, // final double plFrontoTol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable
clt_parameters.plFrontoRms, // final double plFrontoRms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes
clt_parameters.plFrontoOffs, // final double plFrontoOffs, // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0
clt_parameters.PlFrontoPow, // final double PlFrontoPow, // = 1.0; // increase weight even more
geometryCorrection,
clt_parameters.correct_distortions,
clt_parameters.stSmplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
......@@ -5531,6 +5543,7 @@ public class TileProcessor {
clt_parameters.plFrontoTol, //final double fronto_tol, // fronto tolerance (pix) - treat almost fronto as fronto (constant disparity). <= 0 - disable this feature
clt_parameters.plFrontoRms, // final double plFrontoRms, // Target rms for the fronto planes - same as sqrt(plMaxEigen) for other planes
clt_parameters.plFrontoOffs, // final double plFrontoOffs, // increasing weight of the near tiles by using difference between the reduced average as weight. <= 0
clt_parameters.PlFrontoPow, // final double PlFrontoPow, // = 1.0; // increase weight even more
debugLevel, // 1, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
......@@ -5859,7 +5872,7 @@ public class TileProcessor {
0, // int nlayer, // over multi-layer - do not render more than nlayer on top of each other
st.getPlanesMod(), // TilePlanes.PlaneData [][] planes,
st.getShellMap(), // shells, // int [][] shells,
1000, // int max_shells,
5000, // int max_shells,
clt_parameters.plFuse,// boolean fuse,
false, // boolean show_connections,
false, // boolean use_NaN,
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment