Commit c2df58ec authored by Andrey Filippov's avatar Andrey Filippov

added parameters for thersholding velocities outputs.

parent ab8971fa
......@@ -166,6 +166,11 @@ public class CuasDetectRT {
int curt_pix_decimate = clt_parameters.imp.curt_pix_decimate;
int curt_vel_decimate = clt_parameters.imp.curt_vel_decimate;
int curt_vel_radius = clt_parameters.imp.curt_vel_radius;
boolean curt_vel_thresh_en =clt_parameters.imp.curt_vel_thresh_en;
double curt_vel_athresh = clt_parameters.imp.curt_vel_athresh;
double curt_vel_rthresh = clt_parameters.imp.curt_vel_rthresh;
double[] curt_temp_weights = clt_parameters.imp.curt_temp_weights.clone();
boolean curt_save_c5full = clt_parameters.imp.curt_save_c5full;
......@@ -300,7 +305,8 @@ public class CuasDetectRT {
"-N"+d2s(w3d3_now)+":"+d2s(w3d3_prev)+
"-A1_"+d2s(alpha1)+
"-NH"+num_hist_5d+
"-VR"+curt_vel_radius+"-VD"+curt_vel_decimate+"-MF"+min_frac_last;
"-VR"+curt_vel_radius+"-VD"+curt_vel_decimate+"-MF"+min_frac_last+
"-TE"+(curt_vel_thresh_en?"1":"0") + "-TA"+curt_vel_athresh + "-TR"+curt_vel_rthresh;
// Level-0 5D convolution (fine velocity from coarse-velocity history)
int num_5d_lev0 = Math.max(0, dpixels_3d3.length - num_hist_5d + 1);
dpixels_5d_pyramid[0] = new double[num_5d_lev0][][][];
......
......@@ -1144,8 +1144,10 @@ min_str_neib_fpn 0.35
public int curt_pix_decimate = 1; // decimate pixel resolution
public int curt_vel_decimate = 4; // decimate velocities
public int curt_vel_radius = 5; // velocities radius in decimated samples
public boolean curt_vel_thresh_en = true; // zero out per-(sub)pixel velocities, if they have stronger neighbors in 4D space
public double curt_vel_athresh = 1.0; // absolute threshold: discard this pixel-velocity if it has immediate neighbor (of 80=81-1) stronger by this value
public double curt_vel_rthresh = 0.1; // relative threshold: discard this pixel-velocity if it has immediate neighbor stronger by this value times stronger value
public double[] curt_temp_weights = {1,1,1,1,1}; // historic weights for 5D convolution ([0] is the latest sample)
// debug/saving images
public boolean curt_save_c5full = false; // save fine velocities [direction][scene][subpixels]
public boolean curt_save_c5rect = true; // save fine velocities for selected rectangle only [scene][flattened image]
......@@ -3411,14 +3413,20 @@ min_str_neib_fpn 0.35
"Decimate velocities (increase velocity resolution).");
gd.addNumericField("Velocities radius", this.curt_vel_radius, 0,3,"",
"Velocities radius in decimated samples.");
gd.addCheckbox ("Filter by stronger 4d space neighbors", this.curt_vel_thresh_en,
"Zero-out velocity components if they have stronger neighbors");
gd.addNumericField("Absolute threshold", this.curt_vel_athresh, 6,8,"",
"Discard this pixel-velocity if it has immediate neighbor (of 80=81-1) stronger by this valuediscard this pixel-velocity if it has immediate neighbor (of 80=81-1) stronger by this value.");
gd.addNumericField("Relative thershold", this.curt_vel_rthresh, 6,8,"",
"Discard this pixel-velocity if it has immediate neighbor stronger by this value times stronger value.");
gd.addStringField ("Historic weight for 5D convolution", IntersceneMatchParameters.doublesToString(curt_temp_weights), 80,
"Historic weights for 5D convolution ([0] is the latest sample). Will be normalized");
gd.addMessage("=== Debug, saving images ===");
gd.addCheckbox ("Save full velocities hyperstack", this.curt_save_c5full,
"save fine velocities [direction][scene][subpixels].");
"Save fine velocities [direction][scene][subpixels].");
gd.addCheckbox ("Save velocities for rectangle", this.curt_save_c5rect,
"save fine velocities for selected rectangle only [scene][flattened image].");
"Save fine velocities for selected rectangle only [scene][flattened image].");
gd.addStringField ("Output selection Rectangle", rectangleToString(curt_save_select), 40, "Selection Rectangle:left, top, width,height");
gd.addTab("Airplane","Airplane mode (fast forward movement, low vertical speed");
......@@ -4911,6 +4919,11 @@ min_str_neib_fpn 0.35
this.curt_pix_decimate = (int) gd.getNextNumber();
this.curt_vel_decimate = (int) gd.getNextNumber();
this.curt_vel_radius = (int) gd.getNextNumber();
this.curt_vel_thresh_en = gd.getNextBoolean();
this.curt_vel_athresh = gd.getNextNumber();
this.curt_vel_rthresh = gd.getNextNumber();
this.curt_temp_weights = IntersceneMatchParameters. StringToDoubles(gd.getNextString(), 0);
this.curt_save_c5full = gd.getNextBoolean();
......@@ -6237,6 +6250,9 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"curt_pix_decimate", this.curt_pix_decimate+""); // int
properties.setProperty(prefix+"curt_vel_decimate", this.curt_vel_decimate+""); // int
properties.setProperty(prefix+"curt_vel_radius", this.curt_vel_radius+""); // int
properties.setProperty(prefix+"curt_vel_thresh_en", this.curt_vel_thresh_en+""); // boolean
properties.setProperty(prefix+"curt_vel_athresh", this.curt_vel_athresh+""); // double
properties.setProperty(prefix+"curt_vel_rthresh", this.curt_vel_rthresh+""); // double
properties.setProperty(prefix+"curt_temp_weights", IntersceneMatchParameters.doublesToString(this.curt_temp_weights));
properties.setProperty(prefix+"curt_save_c5full", this.curt_save_c5full+""); // boolean
......@@ -7548,6 +7564,11 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"curt_pix_decimate")!=null) this.curt_pix_decimate=Integer.parseInt(properties.getProperty(prefix+"curt_pix_decimate"));
if (properties.getProperty(prefix+"curt_vel_decimate")!=null) this.curt_vel_decimate=Integer.parseInt(properties.getProperty(prefix+"curt_vel_decimate"));
if (properties.getProperty(prefix+"curt_vel_radius")!=null) this.curt_vel_radius=Integer.parseInt(properties.getProperty(prefix+"curt_vel_radius"));
if (properties.getProperty(prefix+"curt_vel_thresh_en")!=null) this.curt_vel_thresh_en=Boolean.parseBoolean(properties.getProperty(prefix+"curt_vel_thresh_en"));
if (properties.getProperty(prefix+"curt_vel_athresh")!=null) this.curt_vel_athresh=Double.parseDouble(properties.getProperty(prefix+"curt_vel_athresh"));
if (properties.getProperty(prefix+"curt_vel_rthresh")!=null) this.curt_vel_rthresh=Double.parseDouble(properties.getProperty(prefix+"curt_vel_rthresh"));
if (properties.getProperty(prefix+"curt_temp_weights")!=null) this.curt_temp_weights= IntersceneMatchParameters.StringToDoubles(properties.getProperty(prefix+"curt_temp_weights"),0); // use 0
if (properties.getProperty(prefix+"curt_save_c5full")!=null) this.curt_save_c5full=Boolean.parseBoolean(properties.getProperty(prefix+"curt_save_c5full"));
......@@ -8837,6 +8858,9 @@ min_str_neib_fpn 0.35
imp.curt_pix_decimate = this.curt_pix_decimate;
imp.curt_vel_decimate = this.curt_vel_decimate;
imp.curt_vel_radius = this.curt_vel_radius;
imp.curt_vel_thresh_en = this.curt_vel_thresh_en;
imp.curt_vel_athresh = this.curt_vel_athresh;
imp.curt_vel_rthresh = this.curt_vel_rthresh;
imp.curt_temp_weights = this.curt_temp_weights.clone();
imp.curt_save_c5full = this.curt_save_c5full;
......
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