Commit f04c3e13 authored by Andrey Filippov's avatar Andrey Filippov

re-implemented LMA, found problem in the original one

parent 9898d7a6
...@@ -1663,6 +1663,7 @@ public class EyesisCorrectionParameters { ...@@ -1663,6 +1663,7 @@ public class EyesisCorrectionParameters {
public double dbg_y1 =0; public double dbg_y1 =0;
public double dbg_sigma =2.0; public double dbg_sigma =2.0;
public String dbg_mask = ".........:::::::::.........:::::::::......*..:::::*:::.........:::::::::........."; public String dbg_mask = ".........:::::::::.........:::::::::......*..:::::*:::.........:::::::::.........";
public int dbg_mode = 1; // 0 - old LMA, 1 - new LMA
public DCTParameters(int dct_size, int asym_size, int asym_pixels, int asym_distance, int dct_window, double compactness, int asym_tax_free) { public DCTParameters(int dct_size, int asym_size, int asym_pixels, int asym_distance, int dct_window, double compactness, int asym_tax_free) {
this.dct_size = dct_size; this.dct_size = dct_size;
...@@ -1689,6 +1690,7 @@ public class EyesisCorrectionParameters { ...@@ -1689,6 +1690,7 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"dbg_y1", this.dbg_y1+""); properties.setProperty(prefix+"dbg_y1", this.dbg_y1+"");
properties.setProperty(prefix+"dbg_sigma", this.dbg_sigma+""); properties.setProperty(prefix+"dbg_sigma", this.dbg_sigma+"");
properties.setProperty(prefix+"dbg_mask", this.dbg_mask+""); properties.setProperty(prefix+"dbg_mask", this.dbg_mask+"");
properties.setProperty(prefix+"dbg_mode", this.dbg_mode+"");
} }
public void getProperties(String prefix,Properties properties){ public void getProperties(String prefix,Properties properties){
...@@ -1707,6 +1709,7 @@ public class EyesisCorrectionParameters { ...@@ -1707,6 +1709,7 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"dbg_y1")!=null) this.dbg_y1=Double.parseDouble(properties.getProperty(prefix+"dbg_y1")); if (properties.getProperty(prefix+"dbg_y1")!=null) this.dbg_y1=Double.parseDouble(properties.getProperty(prefix+"dbg_y1"));
if (properties.getProperty(prefix+"dbg_sigma")!=null) this.dbg_sigma=Double.parseDouble(properties.getProperty(prefix+"dbg_sigma")); if (properties.getProperty(prefix+"dbg_sigma")!=null) this.dbg_sigma=Double.parseDouble(properties.getProperty(prefix+"dbg_sigma"));
if (properties.getProperty(prefix+"dbg_mask")!=null) this.dbg_mask=properties.getProperty(prefix+"dbg_mask"); if (properties.getProperty(prefix+"dbg_mask")!=null) this.dbg_mask=properties.getProperty(prefix+"dbg_mask");
if (properties.getProperty(prefix+"dbg_mode")!=null) this.dbg_mode=Integer.parseInt(properties.getProperty(prefix+"dbg_mode"));
} }
public boolean showDialog() { public boolean showDialog() {
GenericDialog gd = new GenericDialog("Set DCT parameters"); GenericDialog gd = new GenericDialog("Set DCT parameters");
...@@ -1726,6 +1729,8 @@ public class EyesisCorrectionParameters { ...@@ -1726,6 +1729,8 @@ public class EyesisCorrectionParameters {
gd.addNumericField("dbg_y1", this.dbg_y1, 2); //0..2 gd.addNumericField("dbg_y1", this.dbg_y1, 2); //0..2
gd.addNumericField("dbg_sigma", this.dbg_sigma, 3); //0..2 gd.addNumericField("dbg_sigma", this.dbg_sigma, 3); //0..2
gd.addStringField ("Debug mask (anything but * is false)", this.dbg_mask,100); gd.addStringField ("Debug mask (anything but * is false)", this.dbg_mask,100);
gd.addNumericField("LMA implementation: 0 - old, 1 - new", this.dbg_mode, 0); //32
// gd.addNumericField("Debug Level:", MASTER_DEBUG_LEVEL, 0); // gd.addNumericField("Debug Level:", MASTER_DEBUG_LEVEL, 0);
gd.showDialog(); gd.showDialog();
if (gd.wasCanceled()) return false; if (gd.wasCanceled()) return false;
...@@ -1744,6 +1749,7 @@ public class EyesisCorrectionParameters { ...@@ -1744,6 +1749,7 @@ public class EyesisCorrectionParameters {
this.dbg_y1= gd.getNextNumber(); this.dbg_y1= gd.getNextNumber();
this.dbg_sigma= gd.getNextNumber(); this.dbg_sigma= gd.getNextNumber();
this.dbg_mask= gd.getNextString(); this.dbg_mask= gd.getNextString();
this.dbg_mode= (int) gd.getNextNumber();
// MASTER_DEBUG_LEVEL= (int) gd.getNextNumber(); // MASTER_DEBUG_LEVEL= (int) gd.getNextNumber();
return true; return true;
......
...@@ -2835,7 +2835,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos ...@@ -2835,7 +2835,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
} else if (label.equals("Test Kernel Factorization")){ } else if (label.equals("Test Kernel Factorization")){
DEBUG_LEVEL=MASTER_DEBUG_LEVEL; DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
if (!DCT_PARAMETERS.showDialog()) return; if (!DCT_PARAMETERS.showDialog()) return;
FactorConvKernel factorConvKernel = new FactorConvKernel(); FactorConvKernel factorConvKernel = new FactorConvKernel(DCT_PARAMETERS.dbg_mode == 1);
factorConvKernel.setDebugLevel(DEBUG_LEVEL); factorConvKernel.setDebugLevel(DEBUG_LEVEL);
factorConvKernel.numIterations = DCT_PARAMETERS.LMA_steps; factorConvKernel.numIterations = DCT_PARAMETERS.LMA_steps;
factorConvKernel.setAsymCompactness( factorConvKernel.setAsymCompactness(
......
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