Commit 3b27965b authored by Andrey Filippov's avatar Andrey Filippov

initial extraction of predefined planes

parent 5fc78264
...@@ -69,7 +69,6 @@ public class CLTPass3d{ ...@@ -69,7 +69,6 @@ public class CLTPass3d{
{ {
return this.tileProcessor; return this.tileProcessor;
} }
public void updateSelection(){ // add updating border tiles? public void updateSelection(){ // add updating border tiles?
int tilesX = tileProcessor.getTilesX(); int tilesX = tileProcessor.getTilesX();
int tilesY = tileProcessor.getTilesY(); int tilesY = tileProcessor.getTilesY();
...@@ -558,6 +557,9 @@ public class CLTPass3d{ ...@@ -558,6 +557,9 @@ public class CLTPass3d{
return this.superTiles; return this.superTiles;
} }
public double [] showDisparityHistogram( public double [] showDisparityHistogram(
double [][][][] disparity_strength, // pre-calculated disparity/strength [per super-tile][per-measurement layer][2][tiles] or null
boolean [][] tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
boolean smplMode, // = true; // Use sample mode (false - regular tile mode) boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square) int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst int smplNum, // = 3; // Number after removing worst
...@@ -568,6 +570,9 @@ public class CLTPass3d{ ...@@ -568,6 +570,9 @@ public class CLTPass3d{
return null; return null;
} }
return this.superTiles.showDisparityHistogram( return this.superTiles.showDisparityHistogram(
disparity_strength, // pre-calculated disparity/strength [per super-tile][per-measurement layer][2][tiles] or null
tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
smplMode, // = true; // Use sample mode (false - regular tile mode) smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // = 2; // Sample size (side of a square) smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst smplNum, // = 3; // Number after removing worst
...@@ -575,49 +580,6 @@ public class CLTPass3d{ ...@@ -575,49 +580,6 @@ public class CLTPass3d{
measSel); measSel);
} }
public double [] showDisparityHistogram()
{
if (this.superTiles == null){
return null;
}
return this.superTiles.showDisparityHistogram();
}
public double [] showDisparityHistogram(double [][] dispHist)
{
if (this.superTiles == null){
return null;
}
return this.superTiles.showDisparityHistogram(dispHist);
}
public int showDisparityHistogramWidth()
{
return this.superTiles.showDisparityHistogramWidth();
}
public double [][][] getMaxMinMax(){
if (this.superTiles == null){
return null;
}
return superTiles.getMaxMinMax();
}
public double [] showMaxMinMax(){
if (this.superTiles == null){
return null;
}
return this.superTiles.showMaxMinMax();
}
public int getNumBins(){
if (this.superTiles == null){
return 0;
}
return superTiles.numBins;
}
public double[] getSuperTileStrength() public double[] getSuperTileStrength()
{ {
if (this.superTiles == null){ if (this.superTiles == null){
......
This diff is collapsed.
...@@ -684,7 +684,6 @@ public class TilePlanes { ...@@ -684,7 +684,6 @@ public class TilePlanes {
// make a plane and find the worst (largest disparity difference) tile // make a plane and find the worst (largest disparity difference) tile
// z = -(x*Vx + y*Vy)/Vz // z = -(x*Vx + y*Vy)/Vz
// double [][][] disp_str = new double [measuredSelection.length][][];
double worst_d2 = 0.0; double worst_d2 = 0.0;
int [] worst_layer_index = {-1,-1}; int [] worst_layer_index = {-1,-1};
double [] v = getVector(); double [] v = getVector();
...@@ -692,16 +691,6 @@ public class TilePlanes { ...@@ -692,16 +691,6 @@ public class TilePlanes {
for (int nl = 0; nl < measuredSelection.length; nl++){ for (int nl = 0; nl < measuredSelection.length; nl++){
if (measuredSelection[nl] != null){ if (measuredSelection[nl] != null){
// already calculated, but not masked by selection! // already calculated, but not masked by selection!
/*
disp_str[nl] = measuredLayers.getDisparityStrength(
nl, // int num_layer,
sTileXY[0], // int stX,
sTileXY[1], // int stY,
measuredSelection[nl], // boolean [] sel_in,
strength_floor, //
measured_strength_pow, //
true); // boolean null_if_none)
*/
if (disp_str[nl] != null) { if (disp_str[nl] != null) {
for (int indx = 0; indx < disp_str[nl][0].length; indx++){ for (int indx = 0; indx < disp_str[nl][0].length; indx++){
double w = disp_str[nl][1][indx]; double w = disp_str[nl][1][indx];
......
...@@ -2759,7 +2759,7 @@ public class TileProcessor { ...@@ -2759,7 +2759,7 @@ public class TileProcessor {
clt_parameters.stSmplNum, // Number after removing worst clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[0] = scan_prev.showDisparityHistogram(); dbg_hist[0] = scan_prev.getSuperTiles().showDisparityHistogram();
scan_prev.setSuperTiles( scan_prev.setSuperTiles(
clt_parameters.stStepNear, // double step_disparity, clt_parameters.stStepNear, // double step_disparity,
...@@ -2775,11 +2775,11 @@ public class TileProcessor { ...@@ -2775,11 +2775,11 @@ public class TileProcessor {
clt_parameters.stSmplNum, // Number after removing worst clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[1] = scan_prev.showDisparityHistogram(); dbg_hist[1] = scan_prev.getSuperTiles().showDisparityHistogram();
dbg_hist[2] = scan_prev.showMaxMinMax(); dbg_hist[2] = scan_prev.getSuperTiles().showMaxMinMax();
int hist_width0 = scan_prev.showDisparityHistogramWidth(); int hist_width0 = scan_prev.getSuperTiles().showDisparityHistogramWidth();
int hist_height0 = dbg_hist[0].length/hist_width0; int hist_height0 = dbg_hist[0].length/hist_width0;
if (show_st){ if (show_st){
sdfa_instance.showArrays(dbg_hist, hist_width0, hist_height0, true, "disparity_supertiles_histograms",dbg_st_titles); sdfa_instance.showArrays(dbg_hist, hist_width0, hist_height0, true, "disparity_supertiles_histograms",dbg_st_titles);
...@@ -2973,7 +2973,7 @@ public class TileProcessor { ...@@ -2973,7 +2973,7 @@ public class TileProcessor {
clt_parameters.stSmplNum, // Number after removing worst clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[0] = scan_prev.showDisparityHistogram(); dbg_hist[0] = scan_prev.getSuperTiles().showDisparityHistogram();
scan_prev.setSuperTiles( scan_prev.setSuperTiles(
clt_parameters.stStepNear, // double step_disparity, clt_parameters.stStepNear, // double step_disparity,
clt_parameters.stStepFar, // double step_near, clt_parameters.stStepFar, // double step_near,
...@@ -2988,7 +2988,7 @@ public class TileProcessor { ...@@ -2988,7 +2988,7 @@ public class TileProcessor {
clt_parameters.stSmplNum, // Number after removing worst clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[1] = scan_prev.showDisparityHistogram(); dbg_hist[1] = scan_prev.getSuperTiles().showDisparityHistogram();
} }
// SuperTiles st = // SuperTiles st =
...@@ -3007,13 +3007,13 @@ public class TileProcessor { ...@@ -3007,13 +3007,13 @@ public class TileProcessor {
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
if (show_st) { // otherwise only blured version is needed if (show_st) { // otherwise only blured version is needed
dbg_hist[2] = scan_prev.showDisparityHistogram(); dbg_hist[2] = scan_prev.getSuperTiles().showDisparityHistogram();
dbg_hist[3] = scan_prev.showMaxMinMax(); dbg_hist[3] = scan_prev.getSuperTiles().showMaxMinMax();
} }
if (show_st){ if (show_st){
int hist_width0 = scan_prev.showDisparityHistogramWidth(); int hist_width0 = scan_prev.getSuperTiles().showDisparityHistogramWidth();
int hist_height0 = dbg_hist[0].length/hist_width0; int hist_height0 = dbg_hist[0].length/hist_width0;
showDoubleFloatArrays sdfa_instance = new showDoubleFloatArrays(); // just for debugging? showDoubleFloatArrays sdfa_instance = new showDoubleFloatArrays(); // just for debugging?
sdfa_instance.showArrays(dbg_hist, hist_width0, hist_height0, true, "disparity_supertiles_histograms",dbg_st_titles); sdfa_instance.showArrays(dbg_hist, hist_width0, hist_height0, true, "disparity_supertiles_histograms",dbg_st_titles);
...@@ -3614,7 +3614,7 @@ public class TileProcessor { ...@@ -3614,7 +3614,7 @@ public class TileProcessor {
clt_parameters.stSmplNum, // Number after removing worst clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[0] = scan_prev.showDisparityHistogram(); dbg_hist[0] = scan_prev.getSuperTiles().showDisparityHistogram();
SuperTiles st = scan_prev.setSuperTiles( SuperTiles st = scan_prev.setSuperTiles(
clt_parameters.stStepNear, // double step_disparity, clt_parameters.stStepNear, // double step_disparity,
...@@ -3630,11 +3630,11 @@ public class TileProcessor { ...@@ -3630,11 +3630,11 @@ public class TileProcessor {
clt_parameters.stSmplNum, // Number after removing worst clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[1] = scan_prev.showDisparityHistogram(); dbg_hist[1] = scan_prev.getSuperTiles().showDisparityHistogram();
dbg_hist[2] = scan_prev.showMaxMinMax(); dbg_hist[2] = scan_prev.getSuperTiles().showMaxMinMax();
int hist_width0 = scan_prev.showDisparityHistogramWidth(); int hist_width0 = scan_prev.getSuperTiles().showDisparityHistogramWidth();
int hist_height0 = dbg_hist[0].length/hist_width0; int hist_height0 = dbg_hist[0].length/hist_width0;
if (show_st){ if (show_st){
...@@ -4431,7 +4431,7 @@ public class TileProcessor { ...@@ -4431,7 +4431,7 @@ public class TileProcessor {
clt_parameters.stSmplNum, // Number after removing worst clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[0] = scan_prev.showDisparityHistogram(); dbg_hist[0] = scan_prev.getSuperTiles().showDisparityHistogram();
scan_prev.setSuperTiles( scan_prev.setSuperTiles(
clt_parameters.stStepNear, // double step_disparity, clt_parameters.stStepNear, // double step_disparity,
...@@ -4447,12 +4447,12 @@ public class TileProcessor { ...@@ -4447,12 +4447,12 @@ public class TileProcessor {
clt_parameters.stSmplNum, // Number after removing worst clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[1] = scan_prev.showDisparityHistogram(); dbg_hist[1] = scan_prev.getSuperTiles().showDisparityHistogram();
dbg_hist[2] = scan_prev.showMaxMinMax(); dbg_hist[2] = scan_prev.getSuperTiles().showMaxMinMax();
if (clt_parameters.stShow){ if (clt_parameters.stShow){
int hist_width0 = scan_prev.showDisparityHistogramWidth(); int hist_width0 = scan_prev.getSuperTiles().showDisparityHistogramWidth();
int hist_height0 = dbg_hist[0].length/hist_width0; int hist_height0 = dbg_hist[0].length/hist_width0;
sdfa_instance.showArrays(dbg_hist, hist_width0, hist_height0, true, "disparity_supertiles_histograms",dbg_st_titles); sdfa_instance.showArrays(dbg_hist, hist_width0, hist_height0, true, "disparity_supertiles_histograms",dbg_st_titles);
} }
......
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