Commit 1ea8ea53 authored by Andrey Filippov's avatar Andrey Filippov

adding velocity suppress radius

parent ede9c9b0
......@@ -167,6 +167,7 @@ public class CuasDetectRT {
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;
int curt_vel_suppr_rad =clt_parameters.imp.curt_vel_suppr_rad;
double curt_vel_athresh = clt_parameters.imp.curt_vel_athresh;
double curt_vel_rthresh = clt_parameters.imp.curt_vel_rthresh;
......@@ -189,8 +190,9 @@ public class CuasDetectRT {
curt_pix_decimate, // int pixel_decimate,
curt_vel_decimate, // int velocity_decimate,
curt_vel_radius, // int velocity_radius,
getWidth (), // int width,
getHeight()); // int height)
curt_vel_suppr_rad, // int vel_suppr_rad,
getWidth (), // int width,
getHeight()); // int height)
// For testing, create whole arrays?
boolean save_LoG = debugLevel> -4;
boolean save_5d = debugLevel> -4;
......@@ -306,7 +308,7 @@ public class CuasDetectRT {
"-A1_"+d2s(alpha1)+
"-NH"+num_hist_5d+
"-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;
"-TE"+(curt_vel_thresh_en?"1":"0") + "-TA"+curt_vel_athresh + "-TR"+curt_vel_rthresh+"-SR"+curt_vel_suppr_rad;
// 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][][][];
......
......@@ -41,6 +41,10 @@ public class CuasRTUtils {
final private int [] indx_center_5d;
final private int [] indx_margins_5d;
final private int vel_suppr_rad;
final private int [] indx_all_vsupp;
final private int [] indx_center_vsupp;
final private int [] indx_margins_vsupp;
final ConsolidationKernel consolidationKernel;
......@@ -56,12 +60,14 @@ public class CuasRTUtils {
int pixel_decimate,
int velocity_decimate,
int velocity_radius,
int vel_suppr_rad,
int width,
int height) {
this.psf_radius = psf_radius;
this.width = width;
this.height = height;
this.n_sigma = n_sigma;
this.vel_suppr_rad=vel_suppr_rad;
// Setup 2D pre-filter kernel, based on LoG
kernel2d_rad = getRadiusLoGKernel(psf_radius,n_sigma);
kernel2d = getLoGKenel(psf_radius, kernel2d_rad);
......@@ -104,6 +110,13 @@ public class CuasRTUtils {
indx_all_5d = indices[0];
indx_center_5d = indices[1];
indx_margins_5d = indices[2];
indices = getIndices(
this.vel_suppr_rad,
width,
height);
indx_all_vsupp = indices[0];
indx_center_vsupp = indices[1];
indx_margins_vsupp = indices[2];
}
public double getPsfRadius() {
......
......@@ -1145,6 +1145,7 @@ min_str_neib_fpn 0.35
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 int curt_vel_suppr_rad = 3; // suppress weaker in this radius
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)
......@@ -3415,6 +3416,8 @@ min_str_neib_fpn 0.35
"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("Velocities suppress radius", this.curt_vel_suppr_rad, 0,3,"",
"Suppress weaker in this radius.");
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,"",
......@@ -4921,6 +4924,7 @@ min_str_neib_fpn 0.35
this.curt_vel_radius = (int) gd.getNextNumber();
this.curt_vel_thresh_en = gd.getNextBoolean();
this.curt_vel_suppr_rad = (int) gd.getNextNumber();
this.curt_vel_athresh = gd.getNextNumber();
this.curt_vel_rthresh = gd.getNextNumber();
......@@ -6251,6 +6255,7 @@ min_str_neib_fpn 0.35
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_suppr_rad", this.curt_vel_suppr_rad+""); // int
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));
......@@ -7566,6 +7571,7 @@ min_str_neib_fpn 0.35
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_suppr_rad")!=null) this.curt_vel_suppr_rad=Integer.parseInt(properties.getProperty(prefix+"curt_vel_suppr_rad"));
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"));
......@@ -8859,6 +8865,7 @@ min_str_neib_fpn 0.35
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_suppr_rad = this.curt_vel_suppr_rad;
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();
......
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