Commit d129b782 authored by Andrey Filippov's avatar Andrey Filippov

assigning tiles to surfaces

parent 6ae8367c
...@@ -507,6 +507,7 @@ private Panel panel1, ...@@ -507,6 +507,7 @@ private Panel panel1,
addButton("CLT reset 3D", panelClt1, color_stop); addButton("CLT reset 3D", panelClt1, color_stop);
addButton("CLT 3D", panelClt1, color_conf_process); addButton("CLT 3D", panelClt1, color_conf_process);
addButton("CLT planes", panelClt1, color_conf_process); addButton("CLT planes", panelClt1, color_conf_process);
addButton("CLT ASSIGN", panelClt1, color_process);
addButton("CLT OUT 3D", panelClt1, color_process); addButton("CLT OUT 3D", panelClt1, color_process);
add(panelClt1); add(panelClt1);
...@@ -4782,6 +4783,26 @@ private Panel panel1, ...@@ -4782,6 +4783,26 @@ private Panel panel1,
UPDATE_STATUS, //final boolean updateStatus, UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL); //final int debugLevel); DEBUG_LEVEL); //final int debugLevel);
return; return;
} else if (label.equals("CLT ASSIGN")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
if (QUAD_CLT == null){
System.out.println("QUAD_CLT is null, nothing to show");
return;
}
if (!CLT_PARAMETERS.showTsDialog()) return;
boolean OK = QUAD_CLT.assignCLTPlanes(
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
THREADS_MAX, //final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL); //final int debugLevel);
if (!OK){
System.out.println("Could not assign tiles to surfaces, probably \"CLT planes\" command did not run");
return;
}
return;
} else if (label.equals("CLT OUT 3D")) { } else if (label.equals("CLT OUT 3D")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL; DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
...@@ -4790,7 +4811,6 @@ private Panel panel1, ...@@ -4790,7 +4811,6 @@ private Panel panel1,
System.out.println("QUAD_CLT is null, nothing to show (will add previous steps)"); System.out.println("QUAD_CLT is null, nothing to show (will add previous steps)");
return; return;
} }
String configPath=null; String configPath=null;
if (EYESIS_CORRECTIONS.correctionsParameters.saveSettings) { if (EYESIS_CORRECTIONS.correctionsParameters.saveSettings) {
......
...@@ -4460,7 +4460,6 @@ public class QuadCLT { ...@@ -4460,7 +4460,6 @@ public class QuadCLT {
} }
return rslt; return rslt;
} }
// public ImagePlus [] cltDisparityScan(
public void showCLTPlanes( public void showCLTPlanes(
EyesisCorrectionParameters.CLTParameters clt_parameters, EyesisCorrectionParameters.CLTParameters clt_parameters,
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
...@@ -4481,9 +4480,33 @@ public class QuadCLT { ...@@ -4481,9 +4480,33 @@ public class QuadCLT {
threadsMax, threadsMax,
updateStatus, updateStatus,
debugLevel); debugLevel);
// CLTPass3d last_scan = tp.clt_3d_passes.get(tp.clt_3d_passes.size() -1); // get last one
} }
public boolean assignCLTPlanes(
EyesisCorrectionParameters.CLTParameters clt_parameters,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
final int debugLevel)
{
if (tp == null){
System.out.println("showCLTPlanes(): tp is null");
return false;
}
if (tp.clt_3d_passes == null){
System.out.println("showCLTPlanes(): tp.clt_3d_passes is null");
return false;
}
return tp.assignTilesToSurfaces(
clt_parameters,
geometryCorrection,
threadsMax,
updateStatus,
debugLevel);
}
public void out3d( public void out3d(
EyesisCorrectionParameters.CLTParameters clt_parameters, EyesisCorrectionParameters.CLTParameters clt_parameters,
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
......
...@@ -72,6 +72,9 @@ public class SuperTiles{ ...@@ -72,6 +72,9 @@ public class SuperTiles{
int [][] shell_map = null; // per supertile, per disparity plane - shell index + 1 (0 - none) int [][] shell_map = null; // per supertile, per disparity plane - shell index + 1 (0 - none)
double [][] surfaces; // per shell, per tile (linescan order) disparity value or NaN in missing supertiles double [][] surfaces; // per shell, per tile (linescan order) disparity value or NaN in missing supertiles
TileSurface tileSurface = null;
/** /**
* currently lowest plane for each includes all tiles, so do not use it. May change in the future * currently lowest plane for each includes all tiles, so do not use it. May change in the future
...@@ -185,6 +188,15 @@ public class SuperTiles{ ...@@ -185,6 +188,15 @@ public class SuperTiles{
} }
} }
public void setTileSurface( TileSurface tileSurface)
{
this.tileSurface = tileSurface;
}
public TileSurface getTileSurface()
{
return tileSurface;
}
public void initFuseCoeff( public void initFuseCoeff(
double scale_diag, double scale_diag,
boolean debug) boolean debug)
......
...@@ -2942,6 +2942,53 @@ public class TileProcessor { ...@@ -2942,6 +2942,53 @@ public class TileProcessor {
} }
public boolean assignTilesToSurfaces(
EyesisCorrectionParameters.CLTParameters clt_parameters,
GeometryCorrection geometryCorrection,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
final int debugLevel)
{
CLTPass3d scan_prev = clt_3d_passes.get(clt_3d_passes.size() -1); // get last one
// boolean show_st = clt_parameters.stShow || (debugLevel > 1);
SuperTiles st = scan_prev.getSuperTiles();
TileSurface tileSurface = st.getTileSurface();
if (tileSurface == null){
return false;
}
double [][][] dispStrength = st.getDisparityStrengths(
clt_parameters.stMeasSel); // int stMeasSel) // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert)
boolean [][] tileSel = st.getMeasurementSelections(
clt_parameters.stMeasSel); // int stMeasSel) // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert)
tileSurface.InitTilesAssignment(
clt_parameters.tsReset,
dispStrength, // final double [][][] dispStrength,
tileSel, // final boolean [][] tileSel,
debugLevel); // final int debugLevel,
int [] stats= tileSurface.assignTilesToSurfaces(
clt_parameters.tsMaxDiff, //final double maxDiff,
clt_parameters.tsMinDiffOther, //final double minDiffOther, // should be >= maxDiff
clt_parameters.tsMinStrength, //final double minStrength,
clt_parameters.tsMaxStrength, //final double maxStrength,
clt_parameters.tsMoveDirs, //final int moveDirs, // 1 increase disparity, 2 - decrease disparity, 3 - both directions
clt_parameters.tsEnMulti, //final boolean enMulti,
clt_parameters.tsSurfStrPow, //final double surfStrPow, // surface strength power
clt_parameters.tsSigma, //final double sigma,
clt_parameters.tsNSigma, //final double nSigma,
clt_parameters.tsMinAdvantage, //final double minAdvantage,
clt_parameters.plDispNorm, // final double dispNorm, // disparity normalize (proportionally scale down disparity difference if above
dispStrength, // final double [][][] dispStrength,
0, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
tileSurface.printStats(stats);
return true;
}
//====================== //======================
public void showPlanes( public void showPlanes(
EyesisCorrectionParameters.CLTParameters clt_parameters, EyesisCorrectionParameters.CLTParameters clt_parameters,
...@@ -3174,9 +3221,11 @@ public class TileProcessor { ...@@ -3174,9 +3221,11 @@ public class TileProcessor {
st.tileProcessor.getTilesY(), // int tilesY, st.tileProcessor.getTilesY(), // int tilesY,
geometryCorrection, // GeometryCorrection geometryCorrection, geometryCorrection, // GeometryCorrection geometryCorrection,
st.tileProcessor.threadsMax); // int threadsMax); st.tileProcessor.threadsMax); // int threadsMax);
st.setTileSurface(tileSurface);
TileSurface.TileData [][] tileData = tileSurface.createTileShells ( // TileSurface.TileData [][] tileData =
tileSurface.createTileShells (
clt_parameters.msUseSel, // final boolean use_sel, clt_parameters.msUseSel, // final boolean use_sel,
clt_parameters.msDivideByArea, // final boolean divide_by_area, clt_parameters.msDivideByArea, // final boolean divide_by_area,
clt_parameters.msScaleProj, // final double scale_projection, clt_parameters.msScaleProj, // final double scale_projection,
...@@ -3185,19 +3234,17 @@ public class TileProcessor { ...@@ -3185,19 +3234,17 @@ public class TileProcessor {
0, // -1, // debugLevel, // final int debugLevel) 0, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX, clt_parameters.tileX,
clt_parameters.tileY); clt_parameters.tileY);
int [][] tiles_layers = tileSurface.sortTilesToSurfaces( tileSurface.InitTilesAssignment(
true,
dispStrength, // final double [][][] dispStrength, dispStrength, // final double [][][] dispStrength,
tileSel, // final boolean [][] tileSel, tileSel, // final boolean [][] tileSel,
tileData, // final TileData [][] tileData_src, debugLevel); // final int debugLevel,
// parameters if (debugLevel > -10){
clt_parameters, // final EyesisCorrectionParameters.CLTParameters clt_parameters, return; // just cut off the rest
debugLevel, // final int debugLevel, }
clt_parameters.tileX,
clt_parameters.tileY);
TilePlanes.PlaneData[][][] split_planes = // use original (measured planes. See if smoothed are needed here) TilePlanes.PlaneData[][][] split_planes = // use original (measured planes. See if smoothed are needed here)
...@@ -3571,6 +3618,10 @@ public class TileProcessor { ...@@ -3571,6 +3618,10 @@ public class TileProcessor {
} }
} }
public void secondPassSetup( // prepare tile tasks for the second pass based on the previous one(s) public void secondPassSetup( // prepare tile tasks for the second pass based on the previous one(s)
// final double [][][] image_data, // first index - number of image in a quad // final double [][][] image_data, // first index - number of image in a quad
......
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