Commit 4ea50500 authored by Andrey Filippov's avatar Andrey Filippov

filtering foreground selection for the rig

parent 857dfbb8
This diff is collapsed.
This diff is collapsed.
...@@ -569,6 +569,7 @@ private Panel panel1, ...@@ -569,6 +569,7 @@ private Panel panel1,
addButton("Setup CLT Batch parameters", panelClt3, color_configure); addButton("Setup CLT Batch parameters", panelClt3, color_configure);
addButton("CLT batch process", panelClt3, color_process); addButton("CLT batch process", panelClt3, color_process);
addButton("CM Test", panelClt3, color_stop); addButton("CM Test", panelClt3, color_stop);
addButton("Show scan", panelClt3, color_configure);
add(panelClt3); add(panelClt3);
} }
...@@ -579,13 +580,16 @@ private Panel panel1, ...@@ -579,13 +580,16 @@ private Panel panel1,
addButton("Import Aux", panelClt4, color_restore); addButton("Import Aux", panelClt4, color_restore);
addButton("Setup CLT Batch parameters", panelClt4, color_configure); addButton("Setup CLT Batch parameters", panelClt4, color_configure);
addButton("CLT rig edit", panelClt4, color_configure); addButton("CLT rig edit", panelClt4, color_configure);
addButton("CLT 2*4 images", panelClt4, color_conf_process); // addButton("CLT 2*4 images", panelClt4, color_conf_process);
addButton("CLT 2*4 images - 2", panelClt4, color_conf_process); // addButton("CLT 2*4 images - 2", panelClt4, color_conf_process);
addButton("CLT 2*4 images - 3", panelClt4, color_conf_process); // addButton("CLT 2*4 images - 3", panelClt4, color_conf_process);
addButton("Rig8 images", panelClt4, color_conf_process);
addButton("Rig infinity calibration", panelClt4, color_conf_process); addButton("Rig infinity calibration", panelClt4, color_conf_process);
addButton("AUX Extrinsics", panelClt4, color_process); addButton("AUX Extrinsics", panelClt4, color_process);
addButton("AUX show fine", panelClt4, color_configure); addButton("AUX show fine", panelClt4, color_configure);
addButton("Rig enhance", panelClt4, color_conf_process); // addButton("Rig enhance", panelClt4, color_conf_process);
addButton("Ground truth", panelClt4, color_conf_process);
addButton("ML export", panelClt4, color_conf_process);
add(panelClt4); add(panelClt4);
} }
...@@ -4519,10 +4523,15 @@ private Panel panel1, ...@@ -4519,10 +4523,15 @@ private Panel panel1,
PROPERTIES); PROPERTIES);
} }
return; return;
/* ======================================================================== */
} else if (label.equals("CM Test")) { } else if (label.equals("CM Test")) {
cm_test(); cm_test();
return; return;
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("Show scan")) {
showScan();
return;
/* ======================================================================== */
} else if (label.equals("Import Aux")) { } else if (label.equals("Import Aux")) {
importAux(); importAux();
...@@ -4540,7 +4549,7 @@ private Panel panel1, ...@@ -4540,7 +4549,7 @@ private Panel panel1,
getPairImages2(false); getPairImages2(false);
return; return;
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("CLT 2*4 images - 3")) { } else if (label.equals("Rig8 images")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL; DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL); EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
getPairImages2(true); getPairImages2(true);
...@@ -4583,12 +4592,18 @@ private Panel panel1, ...@@ -4583,12 +4592,18 @@ private Panel panel1,
return; return;
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("Rig enhance")) { } else if (label.equals("Ground truth")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL; DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL); EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
enhanceByRig(); enhanceByRig();
return; return;
/* ======================================================================== */
} else if (label.equals("ML export")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
exportMLData();
return;
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("CLT rig edit")) { } else if (label.equals("CLT rig edit")) {
...@@ -5007,6 +5022,12 @@ private Panel panel1, ...@@ -5007,6 +5022,12 @@ private Panel panel1,
public boolean enhanceByRig() { public boolean enhanceByRig() {
if ((QUAD_CLT == null) || (QUAD_CLT.tp == null) || (QUAD_CLT.tp.clt_3d_passes == null)) {
String msg = "DSI data is not available. Please run \"CLT 3D\" first";
IJ.showMessage("Error",msg);
System.out.println(msg);
return false;
}
if (!prepareRigImages()) return false; if (!prepareRigImages()) return false;
String configPath=getSaveCongigPath(); String configPath=getSaveCongigPath();
if (configPath.equals("ABORT")) return false; if (configPath.equals("ABORT")) return false;
...@@ -5037,6 +5058,43 @@ private Panel panel1, ...@@ -5037,6 +5058,43 @@ private Panel panel1,
return true; return true;
} }
public boolean exportMLData() {
if ((QUAD_CLT == null) || (QUAD_CLT.tp == null) || (QUAD_CLT.tp.clt_3d_passes == null)) {
String msg = "DSI data is not available. Please run \"CLT 3D\" first";
IJ.showMessage("Error",msg);
System.out.println(msg);
return false;
}
if (!prepareRigImages()) return false;
String configPath=getSaveCongigPath();
if (configPath.equals("ABORT")) return false;
if (DEBUG_LEVEL > -2){
System.out.println("++++++++++++++ Generating ML datasets ++++++++++++++");
}
try {
TWO_QUAD_CLT.outputMLData( // actually there is no sense to process multiple image sets. Combine with other processing?
QUAD_CLT, // QuadCLT quadCLT_main,
QUAD_CLT_AUX, // QuadCLT quadCLT_aux,
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
THREADS_MAX, //final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} //final int debugLevel);
if (configPath!=null) {
saveTimestampedProperties( // save config again
configPath, // full path or null
null, // use as default directory if path==null
true,
PROPERTIES);
}
return true;
}
public boolean infinityRig() { public boolean infinityRig() {
if (!prepareRigImages()) return false; if (!prepareRigImages()) return false;
...@@ -5044,7 +5102,7 @@ private Panel panel1, ...@@ -5044,7 +5102,7 @@ private Panel panel1,
if (configPath.equals("ABORT")) return false; if (configPath.equals("ABORT")) return false;
if (DEBUG_LEVEL > -2){ if (DEBUG_LEVEL > -2){
System.out.println("++++++++++++++ Processing Infinity rig calibration ++++++++++++++"); System.out.println("++++++++++++++ Processing infinity rig calibration ++++++++++++++");
} }
try { try {
TWO_QUAD_CLT.processInfinityRigs( // actually there is no sense to process multiple image sets. Combine with other processing? TWO_QUAD_CLT.processInfinityRigs( // actually there is no sense to process multiple image sets. Combine with other processing?
...@@ -5473,6 +5531,27 @@ private Panel panel1, ...@@ -5473,6 +5531,27 @@ private Panel panel1,
return true; return true;
} }
public boolean showScan() {
if ((QUAD_CLT == null) || (QUAD_CLT.tp == null) || (QUAD_CLT.tp.clt_3d_passes == null)) {
String msg = "DSI data is not available. Please run \"CLT 3D\" first";
IJ.showMessage("Error",msg);
System.out.println(msg);
return false;
}
int scan_index = 0;
GenericJTabbedDialog gd = new GenericJTabbedDialog("Set CLT parameters",400,100);
gd.addNumericField("Scan index (0..."+(QUAD_CLT.tp.clt_3d_passes.size()-1), scan_index, 0, 2, "",
"Display scan by index");
gd.showDialog();
if (gd.wasCanceled()) return false;
scan_index = (int) gd.getNextNumber();
QUAD_CLT.tp.showScan(QUAD_CLT.tp.clt_3d_passes.get(scan_index),"Scan-"+scan_index);
return true;
}
public boolean cm_test() { public boolean cm_test() {
double hsize_x = 1.5; double hsize_x = 1.5;
double hsize_y = 1.5; double hsize_y = 1.5;
......
...@@ -73,7 +73,10 @@ public class QuadCLT { ...@@ -73,7 +73,10 @@ public class QuadCLT {
// magic scale should be set before using TileProcessor (calculated disparities depend on it) // magic scale should be set before using TileProcessor (calculated disparities depend on it)
public double [][] getGroundTruthByRig(){
if (tp == null) return null;
return tp.rig_disparity_strength;
}
public void setTiles (ImagePlus imp, // set tp.tilesX, tp.tilesY public void setTiles (ImagePlus imp, // set tp.tilesX, tp.tilesY
EyesisCorrectionParameters.CLTParameters clt_parameters, EyesisCorrectionParameters.CLTParameters clt_parameters,
int threadsMax int threadsMax
......
...@@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger;
public class TileProcessor { public class TileProcessor {
public ArrayList <CLTPass3d> clt_3d_passes = null; 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 int clt_3d_passes_size = 0; //clt_3d_passes size after initial processing public int clt_3d_passes_size = 0; //clt_3d_passes size after initial processing
private int tilesX; private int tilesX;
private int tilesY; private int tilesY;
...@@ -2218,11 +2219,11 @@ public class TileProcessor { ...@@ -2218,11 +2219,11 @@ public class TileProcessor {
block_propagate[tindx] = (disparity_map[ImageDtt.IMG_DIFF0_INDEX + imax2][tindx] > sure_smth); block_propagate[tindx] = (disparity_map[ImageDtt.IMG_DIFF0_INDEX + imax2][tindx] > sure_smth);
} }
} }
// TODO: check if minimal cluster strengh should be limited here // TODO: check if minimal cluster strength should be limited here
if (min_clstr_seed > 1){ if (min_clstr_seed > 1){
removeSmallClusters( removeSmallClusters(
true, // boolean diag_en, // enable diagonal directions, false only up, dowm, right,left true, // boolean diag_en, // enable diagonal directions, false only up, dowm, right,left
bgnd_tiles, // boolean [] tiles_src, // selected tiles, will modified bgnd_tiles, // boolean [] tiles_src, // selected tiles, will be modified
null, // double [] weights_src, // or null null, // double [] weights_src, // or null
min_clstr_seed, // int min_area, // minimal number of pixels min_clstr_seed, // int min_area, // minimal number of pixels
0.0, //clt_parameters.min_clstr_weight, // double min_weight // minimal total weight of the cluster 0.0, //clt_parameters.min_clstr_weight, // double min_weight // minimal total weight of the cluster
......
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