Commit f2fc939c authored by Andrey Filippov's avatar Andrey Filippov

working snapshot

parent 66969e94
...@@ -249,18 +249,29 @@ public class CuasRanging { ...@@ -249,18 +249,29 @@ public class CuasRanging {
uasLogReader, // UasLogReader uasLogReader, uasLogReader, // UasLogReader uasLogReader,
debugLevel); // int debugLevel) debugLevel); // int debugLevel)
if (save_noise_map) { if (save_noise_map) {
/*
ImagePlus imp_noise_map = ShowDoubleFloatArrays.makeArrays( ImagePlus imp_noise_map = ShowDoubleFloatArrays.makeArrays(
cuasMotion.getNoiseMap(), // float[][] pixels, cuasMotion.getNoiseMap(), // float[][] pixels,
cuasMotion.getTilesX(), // int width, cuasMotion.getTilesX(), // int width,
cuasMotion.getTilesY(), // int height, cuasMotion.getTilesY(), // int height,
center_CLT.getImageName()+"-NOISE-MAP"); //String [] titles) center_CLT.getImageName()+"-NOISE-MAP"); //String [] titles)
center_CLT.saveImagePlusInModelDirectory(imp_noise_map); // ImagePlus imp) center_CLT.saveImagePlusInModelDirectory(imp_noise_map); // ImagePlus imp)
*/
ImagePlus imp_noise_map8 = ShowDoubleFloatArrays.makeArrays( ImagePlus imp_noise_map8 = ShowDoubleFloatArrays.makeArrays(
cuasMotion.getNoiseMap8(), // float[][] pixels, cuasMotion.getNoiseMap8(), // float[][] pixels,
cuasMotion.getTilesX(), // int width, cuasMotion.getTilesX(), // int width,
cuasMotion.getTilesY(), // int height, cuasMotion.getTilesY(), // int height,
center_CLT.getImageName()+"-NOISE-MAP8"); //String [] titles) center_CLT.getImageName()+"-NOISE-MAP8"); //String [] titles)
center_CLT.saveImagePlusInModelDirectory(imp_noise_map8); // ImagePlus imp) center_CLT.saveImagePlusInModelDirectory(imp_noise_map8); // ImagePlus imp)
ImagePlus imp_noise_neibs = ShowDoubleFloatArrays.makeArrays(
cuasMotion.getNoiseNeibs(), // float[][] pixels,
cuasMotion.getTilesX(), // int width,
cuasMotion.getTilesY(), // int height,
center_CLT.getImageName()+"-NOISE-NEIBS"); //String [] titles)
center_CLT.saveImagePlusInModelDirectory(imp_noise_neibs); // ImagePlus imp)
} }
......
...@@ -816,6 +816,8 @@ min_str_neib_fpn 0.35 ...@@ -816,6 +816,8 @@ min_str_neib_fpn 0.35
public int cuas_max_range = 2; // how far to extend local max: 1 3x3 neighbors, 2 - 5x5 neighbs public int cuas_max_range = 2; // how far to extend local max: 1 3x3 neighbors, 2 - 5x5 neighbs
public int cuas_fin_range = 2; // for final filtering public int cuas_fin_range = 2; // for final filtering
public int cuas_num_cycles = 25; // number of cycles of testing and removing bad targets // will get out earlier public int cuas_num_cycles = 25; // number of cycles of testing and removing bad targets // will get out earlier
public int cuas_trim_first = 5; // Trim targets after first (non-centered) pass (if > 0)
// Recalculate Motion Vectors before centered \"tracking camera\" // Recalculate Motion Vectors before centered \"tracking camera\"
public boolean cuas_recalc_mv = true; // Recalculate motion vectors before centered targets accumulation by masking far-from target areas public boolean cuas_recalc_mv = true; // Recalculate motion vectors before centered targets accumulation by masking far-from target areas
...@@ -858,6 +860,7 @@ min_str_neib_fpn 0.35 ...@@ -858,6 +860,7 @@ min_str_neib_fpn 0.35
public double cuas_target_radius = 2.0; // target centroids center radius public double cuas_target_radius = 2.0; // target centroids center radius
public double cuas_target_strength =0.2; // target centroids strength public double cuas_target_strength =0.2; // target centroids strength
public double cuas_target_strength2 =0.2; // target centroids strength
public double [][] cuas_target_frac = {{0,0.04},{2.5,0.1},{5,0.3}}; public double [][] cuas_target_frac = {{0,0.04},{2.5,0.1},{5,0.3}};
public boolean cuas_no_border = true; // exclude targets with centers on the 16x16 tile edges public boolean cuas_no_border = true; // exclude targets with centers on the 16x16 tile edges
// CUAS Motion LMA parameters // CUAS Motion LMA parameters
...@@ -2718,9 +2721,9 @@ min_str_neib_fpn 0.35 ...@@ -2718,9 +2721,9 @@ min_str_neib_fpn 0.35
"Do not boost if motion vector faster than this (before in code equiv 1.8 pix)."); "Do not boost if motion vector faster than this (before in code equiv 1.8 pix).");
gd.addNumericField("Increase tracking camera exposure", this.cuas_boost_accum, 5,8,"", gd.addNumericField("Increase tracking camera exposure", this.cuas_boost_accum, 5,8,"",
"If >1 increase tracking camera exposure (later - conditional)."); "If >1 increase tracking camera exposure (later - conditional).");
gd.addCheckbox ("Accumulate tracking base exposuer", this.cuas_accum_base, gd.addCheckbox ("Accumulate tracking base exposure", this.cuas_accum_base,
"Accumulate centered targets with base \"exposure\"."); "Accumulate centered targets with base \"exposure\".");
gd.addCheckbox ("Accumulate tracking boosted exposuer", this.cuas_accum_boosted, gd.addCheckbox ("Accumulate tracking boosted exposure", this.cuas_accum_boosted,
"Accumulate centered targets with boosted \"exposure\"."); "Accumulate centered targets with boosted \"exposure\".");
gd.addNumericField("Boost pairs for weak targets", this.cuas_boost_mstr, 5,8,"", gd.addNumericField("Boost pairs for weak targets", this.cuas_boost_mstr, 5,8,"",
"Scale corr_pairs if motion strength is below, regardless of speed."); "Scale corr_pairs if motion strength is below, regardless of speed.");
...@@ -2751,7 +2754,9 @@ min_str_neib_fpn 0.35 ...@@ -2751,7 +2754,9 @@ min_str_neib_fpn 0.35
gd.addNumericField("Local final max range", this.cuas_fin_range, 0,3,"", gd.addNumericField("Local final max range", this.cuas_fin_range, 0,3,"",
"While filtering local correlation maximums: 0 - 1x1 (ignore neighbors), 1 - 3x3 neighbors, 2 - 5x5 ones."); "While filtering local correlation maximums: 0 - 1x1 (ignore neighbors), 1 - 3x3 neighbors, 2 - 5x5 ones.");
gd.addNumericField("Number of enhancement cycles", this.cuas_num_cycles, 0,3,"", gd.addNumericField("Number of enhancement cycles", this.cuas_num_cycles, 0,3,"",
"Number of cycles of testing and removing bad targets from compoetition with weaker neighbors."); "Number of cycles of testing and removing bad targets from competition with weaker neighbors.");
gd.addNumericField("Trim targets after non-centered pass", this.cuas_trim_first, 0,3,"",
"Trim targets after first (non-centered) pass (if > 0).");
gd.addMessage("=== Recalculate Motion Vectors before centered \"tracking camera\" ==="); gd.addMessage("=== Recalculate Motion Vectors before centered \"tracking camera\" ===");
// gd.addCheckbox ("Refine motion vectors", this.cuas_recalc_mv, // gd.addCheckbox ("Refine motion vectors", this.cuas_recalc_mv,
...@@ -4431,6 +4436,7 @@ min_str_neib_fpn 0.35 ...@@ -4431,6 +4436,7 @@ min_str_neib_fpn 0.35
this.cuas_max_range = (int) gd.getNextNumber(); this.cuas_max_range = (int) gd.getNextNumber();
this.cuas_fin_range = (int) gd.getNextNumber(); this.cuas_fin_range = (int) gd.getNextNumber();
this.cuas_num_cycles = (int) gd.getNextNumber(); this.cuas_num_cycles = (int) gd.getNextNumber();
this.cuas_trim_first = (int) gd.getNextNumber();
// this.cuas_recalc_mv = gd.getNextBoolean(); // this.cuas_recalc_mv = gd.getNextBoolean();
this.cuas_recalc_mv_num = (int) gd.getNextNumber(); this.cuas_recalc_mv_num = (int) gd.getNextNumber();
...@@ -5750,8 +5756,8 @@ min_str_neib_fpn 0.35 ...@@ -5750,8 +5756,8 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_max_range", this.cuas_max_range+""); // int properties.setProperty(prefix+"cuas_max_range", this.cuas_max_range+""); // int
properties.setProperty(prefix+"cuas_fin_range", this.cuas_fin_range+""); // int properties.setProperty(prefix+"cuas_fin_range", this.cuas_fin_range+""); // int
properties.setProperty(prefix+"cuas_num_cycles", this.cuas_num_cycles+""); // int properties.setProperty(prefix+"cuas_num_cycles", this.cuas_num_cycles+""); // int
properties.setProperty(prefix+"cuas_trim_first", this.cuas_trim_first+""); // int
// properties.setProperty(prefix+"cuas_recalc_mv", this.cuas_recalc_mv+""); // boolean
properties.setProperty(prefix+"cuas_recalc_mv_num", this.cuas_recalc_mv_num+""); // int properties.setProperty(prefix+"cuas_recalc_mv_num", this.cuas_recalc_mv_num+""); // int
properties.setProperty(prefix+"cuas_recalc_mv_boost", this.cuas_recalc_mv_boost+"");// double properties.setProperty(prefix+"cuas_recalc_mv_boost", this.cuas_recalc_mv_boost+"");// double
properties.setProperty(prefix+"cuas_recalc_mv_corr", this.cuas_recalc_mv_corr+""); // double properties.setProperty(prefix+"cuas_recalc_mv_corr", this.cuas_recalc_mv_corr+""); // double
...@@ -7004,8 +7010,8 @@ min_str_neib_fpn 0.35 ...@@ -7004,8 +7010,8 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_max_range")!=null) this.cuas_max_range=Integer.parseInt(properties.getProperty(prefix+"cuas_max_range")); if (properties.getProperty(prefix+"cuas_max_range")!=null) this.cuas_max_range=Integer.parseInt(properties.getProperty(prefix+"cuas_max_range"));
if (properties.getProperty(prefix+"cuas_fin_range")!=null) this.cuas_fin_range=Integer.parseInt(properties.getProperty(prefix+"cuas_fin_range")); if (properties.getProperty(prefix+"cuas_fin_range")!=null) this.cuas_fin_range=Integer.parseInt(properties.getProperty(prefix+"cuas_fin_range"));
if (properties.getProperty(prefix+"cuas_num_cycles")!=null) this.cuas_num_cycles=Integer.parseInt(properties.getProperty(prefix+"cuas_num_cycles")); if (properties.getProperty(prefix+"cuas_num_cycles")!=null) this.cuas_num_cycles=Integer.parseInt(properties.getProperty(prefix+"cuas_num_cycles"));
if (properties.getProperty(prefix+"cuas_trim_first")!=null) this.cuas_trim_first=Integer.parseInt(properties.getProperty(prefix+"cuas_trim_first"));
// if (properties.getProperty(prefix+"cuas_recalc_mv")!=null) this.cuas_recalc_mv=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_recalc_mv"));
if (properties.getProperty(prefix+"cuas_recalc_mv_num")!=null) this.cuas_recalc_mv_num=Integer.parseInt(properties.getProperty(prefix+"cuas_recalc_mv_num")); if (properties.getProperty(prefix+"cuas_recalc_mv_num")!=null) this.cuas_recalc_mv_num=Integer.parseInt(properties.getProperty(prefix+"cuas_recalc_mv_num"));
if (properties.getProperty(prefix+"cuas_recalc_mv_boost")!=null) this.cuas_recalc_mv_boost=Double.parseDouble(properties.getProperty(prefix+"cuas_recalc_mv_boost")); if (properties.getProperty(prefix+"cuas_recalc_mv_boost")!=null) this.cuas_recalc_mv_boost=Double.parseDouble(properties.getProperty(prefix+"cuas_recalc_mv_boost"));
if (properties.getProperty(prefix+"cuas_recalc_mv_corr")!=null) this.cuas_recalc_mv_corr=Double.parseDouble(properties.getProperty(prefix+"cuas_recalc_mv_corr")); if (properties.getProperty(prefix+"cuas_recalc_mv_corr")!=null) this.cuas_recalc_mv_corr=Double.parseDouble(properties.getProperty(prefix+"cuas_recalc_mv_corr"));
...@@ -8275,8 +8281,8 @@ min_str_neib_fpn 0.35 ...@@ -8275,8 +8281,8 @@ min_str_neib_fpn 0.35
imp.cuas_max_range = this.cuas_max_range; imp.cuas_max_range = this.cuas_max_range;
imp.cuas_fin_range = this.cuas_fin_range; imp.cuas_fin_range = this.cuas_fin_range;
imp.cuas_num_cycles = this.cuas_num_cycles; imp.cuas_num_cycles = this.cuas_num_cycles;
imp.cuas_trim_first = this.cuas_trim_first;
// imp.cuas_recalc_mv = this.cuas_recalc_mv;
imp.cuas_recalc_mv_num = this.cuas_recalc_mv_num; imp.cuas_recalc_mv_num = this.cuas_recalc_mv_num;
imp.cuas_recalc_mv_boost = this.cuas_recalc_mv_boost; imp.cuas_recalc_mv_boost = this.cuas_recalc_mv_boost;
imp.cuas_recalc_mv_corr = this.cuas_recalc_mv_corr; imp.cuas_recalc_mv_corr = this.cuas_recalc_mv_corr;
......
...@@ -212,6 +212,33 @@ public class TileNeibs{ ...@@ -212,6 +212,33 @@ public class TileNeibs{
default: return indx; default: return indx;
} }
} }
public static int getDir(double dx, double dy, double thresh) {
if (dy < -thresh) {
if (dx < -thresh) {
return 7;
} else if (dx > thresh) {
return 1;
} else { // dx ~= 0;
return 0;
}
} else if (dy > thresh) {
if (dx < -thresh) {
return 5;
} else if (dx > thresh) {
return 3;
} else { // dx ~= 0;
return 4;
}
} else { // dy == 0
if (dx < -thresh) {
return 6;
} else if (dx > thresh) {
return 2;
} else { // dx ~= 0;
return 8;
}
}
}
public static int getDX(int dir) public static int getDX(int dir)
{ {
......
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