Commit 3abbfc39 authored by Andrey Filippov's avatar Andrey Filippov

quadratic photometric equalization

parent f0866aad
...@@ -3218,9 +3218,9 @@ public class CLTParameters { ...@@ -3218,9 +3218,9 @@ public class CLTParameters {
gd.addMessage ("It is applied when the source files are read."); gd.addMessage ("It is applied when the source files are read.");
gd.addCheckbox ("Enable photometric calibration", this.photo_en, gd.addCheckbox ("Enable photometric calibration", this.photo_en,
"Equalize per- sensor gains and offsets. Requires disparity map. Save to reference scene and with current scene (to .corr-zml)."); "Equalize per- sensor gains and offsets. Requires disparity map. Save to reference scene and with current scene (to .corr-zml).");
gd.addNumericField("Full photometric (re)calibrations", this.photo_num_full, 0,3,"pix", gd.addNumericField("Full photometric (re)calibrations", this.photo_num_full, 0,3,"",
"Full recalibratrions include re-importing raw images with updated offsets/gains"); "Full recalibratrions include re-importing raw images with updated offsets/gains");
gd.addNumericField("Refines", this.photo_num_refines, 0,3,"pix", gd.addNumericField("Refines", this.photo_num_refines, 0,3,"",
"Calculate calibration, remove outliers (e.g. FG/BG) and repeat"); "Calculate calibration, remove outliers (e.g. FG/BG) and repeat");
gd.addNumericField("Minimal DSI strength", this.photo_min_strength, 5,7,"", gd.addNumericField("Minimal DSI strength", this.photo_min_strength, 5,7,"",
"Do not use weak tiles."); "Do not use weak tiles.");
...@@ -3895,7 +3895,6 @@ public class CLTParameters { ...@@ -3895,7 +3895,6 @@ public class CLTParameters {
gd.addTab ("O-Flow", "parameters for the interscene Optical FLow calculations"); gd.addTab ("O-Flow", "parameters for the interscene Optical FLow calculations");
this.ofp.dialogQuestions(gd); this.ofp.dialogQuestions(gd);
gd.addTab ("Inter-Match", "Parameters for full-resolution (no decimation/macrotiles) scene matching");
this.imp.dialogQuestions(gd); this.imp.dialogQuestions(gd);
gd.addTab ("Inter-LMA", "parameters for the interscene LMA fitting"); gd.addTab ("Inter-LMA", "parameters for the interscene LMA fitting");
......
...@@ -58,11 +58,6 @@ public class IntersceneMatchParameters { ...@@ -58,11 +58,6 @@ public class IntersceneMatchParameters {
public boolean show_color_nan = true; // use NAN background for color images (sharp, but distinct black) public boolean show_color_nan = true; // use NAN background for color images (sharp, but distinct black)
public boolean show_mono_nan = false; // use NAN background for monochrome images (sharp, but distinct black) public boolean show_mono_nan = false; // use NAN background for monochrome images (sharp, but distinct black)
public double [][] stereo_views = { // base, up, back public double [][] stereo_views = { // base, up, back
{ 0.0, 0.0, 0.0}, { 0.0, 0.0, 0.0},
{ 200.0, 0.0, 0.0}, { 200.0, 0.0, 0.0},
...@@ -85,76 +80,8 @@ public class IntersceneMatchParameters { ...@@ -85,76 +80,8 @@ public class IntersceneMatchParameters {
public double range_min_strength = 0.5; public double range_min_strength = 0.5;
public double range_max = 5000.0; public double range_max = 5000.0;
// Some "AGC" to adjust how much to discard
public int margin = 1; // do not use tiles if their centers are closer to the image edge
public int sensor_mask_inter = -1; // bitmask of the sensors to use (-1 - all)
public boolean use_partial = true; // find motion vectors for individual pairs, false - for sum only
public boolean run_poly = false; // not yet implemented
public double centroid_radius = 4.0; //
public int n_recenter = 2; // when cosine window, re-center window this many times
// filtering motion vectors
// TD accumulation of the inter-scene correlations demonstrated artifacts (horizontally offset by 8 pixels
// false maximum that is sharper than the real one. Still not understood - maybe float precision related.
public double td_weight = 0.5; // mix correlations accumulated in TD with
public double pd_weight = 0.5; // correlations (post) accumulated in PD
public boolean td_nopd_only = false; // true; // only use TD accumulated data if no safe PD is available for the tile.
public double min_str_fpn = 0.2; // 0.25; // minimal correlation strength for all but TD-accumulated layer
public double min_str_sum_fpn = 0.5; // 0.8; // minimal correlation strength for TD-accumulated layer
public double min_str = 0.12; //18; // tiles w/o FPN: minimal correlation strength for all but TD-accumulated layer
public double min_str_sum = 0.2; // 0.33; // tiles w/o FPN: minimal correlation strength for TD-accumulated layer
public int min_neibs = 2; // minimal number of strong neighbors (> min_str)
public double weight_zero_neibs = 0.2; // Reduce weight for no-neib (1.0 for all 8)
public double half_disparity = 5.0; // Reduce weight twice for this disparity
public double half_avg_diff = 0.2; // when L2 of x,y difference from average of neibs - reduce twice
// Detect initial match
public double min_ref_str = 0.15; // 0.22; // For orientations: use only tiles of the reference scene DSI_MAIN is stronger
public int pix_step = 4; // Azimuth/tilt search step in pixels
public int search_rad = 10; // Search radius in steps
public double maybe_sum = 1.0; // minimal sum of strengths (will search for the best)
public double sure_sum = 50.0; // definitely good sum of strengths (no more search) too high, will be FOM-defined
public double maybe_avg = 0.01; // maybe average strength
public double sure_avg = 0.15; // 0.015; // sure average strength disabling (was 0.03)
public double max_search_rms = 1.5; // good - 0.34, so-so - 0.999
public double maybe_fom = 1.0; // good - 38, second good - 4.5
public double sure_fom = 12.0; // good - 38, second good - 4.5
// Reference scene disparity
public boolean use_combo_dsi = true; // use interscene DSI if available (instead of the single-scene)
public boolean use_lma_dsi = true; // only use reference DSI tiles that have LMA (strong) disparity
// Remove correlation caused by FPN
public boolean fpn_remove = true; // only use reference DSI tiles that have LMA (strong) disparity
public double fpn_max_offset = 8.0; // pix - ignore larger FPN offsets
public double fpn_radius = 0.75; // pix - zero around center
public boolean fpn_ignore_border = false; // only if fpn_mask != null - ignore tile if maximum touches fpn_mask
// Remove moving objects (goal is not to detect slightest movement, but to improve pose matching
public boolean mov_en = true; // enable detection/removal of the moving objects during pose matching
public double mov_sigma = 1.5; // pix - weighted-blur offsets before detection
// next two to prevent motion detection while errors are too big
public double mov_max_std = 0.5; // pix
public double mov_thresh_rel = 3.5; // .0; // exceed average error
public double mov_thresh_abs= 0.5; // sqrt(dx^2+dy^2) in moving areas
public double mov_clust_max = 1.5; // cluster maximum should exceed threshold this times
public int mov_grow = 4; // grow detected moving area
public boolean mov_show = true; // show debug images for movement detection
public int mov_debug_level = 1; // >0 verbose
//LMA parameters
public boolean [] adjust_atr = new boolean [] {true,true,true};
public boolean [] adjust_xyz = new boolean [] {true,true,true};
public double exit_change_atr = 1.0E-5;//rad, L2 norm for difference to ext LMA
public double exit_change_xyz = 1.0E-3;//meters, L2 norm for difference to ext LMA
public int max_cycles = 10; // hard limit on full correlation/LMA cycles
public int max_LMA = 25; // hard limit on LMA iterations
public double max_rms = 2.0; // maximal RMS to consider adjustment to be a failure
// Debug and visualization // Debug and visualization
public boolean scene_is_ref_test= false; // correlate ref-2-ref for testing public boolean scene_is_ref_test= false; // correlate ref-2-ref for testing
...@@ -222,6 +149,74 @@ public class IntersceneMatchParameters { ...@@ -222,6 +149,74 @@ public class IntersceneMatchParameters {
public double min_strength = 0.08; public double min_strength = 0.08;
public int lowest_sky_row = 50;// appears that low - invalid, remove completely public int lowest_sky_row = 50;// appears that low - invalid, remove completely
// Some "AGC" to adjust how much to discard
public int margin = 1; // do not use tiles if their centers are closer to the image edge
public int sensor_mask_inter = -1; // bitmask of the sensors to use (-1 - all)
public boolean use_partial = true; // find motion vectors for individual pairs, false - for sum only
public boolean run_poly = false; // not yet implemented
public double centroid_radius = 4.0; //
public int n_recenter = 2; // when cosine window, re-center window this many times
// filtering motion vectors
// TD accumulation of the inter-scene correlations demonstrated artifacts (horizontally offset by 8 pixels
// false maximum that is sharper than the real one. Still not understood - maybe float precision related.
public double td_weight = 0.5; // mix correlations accumulated in TD with
public double pd_weight = 0.5; // correlations (post) accumulated in PD
public boolean td_nopd_only = false; // true; // only use TD accumulated data if no safe PD is available for the tile.
public double min_str_fpn = 0.2; // 0.25; // minimal correlation strength for all but TD-accumulated layer
public double min_str_sum_fpn = 0.5; // 0.8; // minimal correlation strength for TD-accumulated layer
public double min_str = 0.12; //18; // tiles w/o FPN: minimal correlation strength for all but TD-accumulated layer
public double min_str_sum = 0.2; // 0.33; // tiles w/o FPN: minimal correlation strength for TD-accumulated layer
public int min_neibs = 2; // minimal number of strong neighbors (> min_str)
public double weight_zero_neibs = 0.2; // Reduce weight for no-neib (1.0 for all 8)
public double half_disparity = 5.0; // Reduce weight twice for this disparity
public double half_avg_diff = 0.2; // when L2 of x,y difference from average of neibs - reduce twice
// Detect initial match
public double min_ref_str = 0.15; // 0.22; // For orientations: use only tiles of the reference scene DSI_MAIN is stronger
public int pix_step = 4; // Azimuth/tilt search step in pixels
public int search_rad = 10; // Search radius in steps
public double maybe_sum = 1.0; // minimal sum of strengths (will search for the best)
public double sure_sum = 50.0; // definitely good sum of strengths (no more search) too high, will be FOM-defined
public double maybe_avg = 0.01; // maybe average strength
public double sure_avg = 0.15; // 0.015; // sure average strength disabling (was 0.03)
public double max_search_rms = 1.5; // good - 0.34, so-so - 0.999
public double maybe_fom = 1.0; // good - 38, second good - 4.5
public double sure_fom = 12.0; // good - 38, second good - 4.5
// Reference scene disparity
public boolean use_combo_dsi = true; // use interscene DSI if available (instead of the single-scene)
public boolean use_lma_dsi = true; // only use reference DSI tiles that have LMA (strong) disparity
// Remove correlation caused by FPN
public boolean fpn_remove = true; // only use reference DSI tiles that have LMA (strong) disparity
public double fpn_max_offset = 8.0; // pix - ignore larger FPN offsets
public double fpn_radius = 0.75; // pix - zero around center
public boolean fpn_ignore_border = false; // only if fpn_mask != null - ignore tile if maximum touches fpn_mask
// Remove moving objects (goal is not to detect slightest movement, but to improve pose matching
public boolean mov_en = true; // enable detection/removal of the moving objects during pose matching
public double mov_sigma = 1.5; // pix - weighted-blur offsets before detection
// next two to prevent motion detection while errors are too big
public double mov_max_std = 0.5; // pix
public double mov_thresh_rel = 3.5; // .0; // exceed average error
public double mov_thresh_abs= 0.5; // sqrt(dx^2+dy^2) in moving areas
public double mov_clust_max = 1.5; // cluster maximum should exceed threshold this times
public int mov_grow = 4; // grow detected moving area
public boolean mov_show = true; // show debug images for movement detection
public int mov_debug_level = 1; // >0 verbose
//LMA parameters
public boolean [] adjust_atr = new boolean [] {true,true,true};
public boolean [] adjust_xyz = new boolean [] {true,true,true};
public double exit_change_atr = 1.0E-5;//rad, L2 norm for difference to ext LMA
public double exit_change_xyz = 1.0E-3;//meters, L2 norm for difference to ext LMA
public int max_cycles = 10; // hard limit on full correlation/LMA cycles
public int max_LMA = 25; // hard limit on LMA iterations
public double max_rms = 2.0; // maximal RMS to consider adjustment to be a failure
// equalization of the inter-scene correlations // equalization of the inter-scene correlations
public boolean eq_en = true;// equalize "important" FG tiles for better camera XYZ fitting public boolean eq_en = true;// equalize "important" FG tiles for better camera XYZ fitting
public int eq_stride_hor = 8; // half of a equalization supertile width public int eq_stride_hor = 8; // half of a equalization supertile width
...@@ -306,7 +301,8 @@ public class IntersceneMatchParameters { ...@@ -306,7 +301,8 @@ public class IntersceneMatchParameters {
public void dialogQuestions(GenericJTabbedDialog gd) { public void dialogQuestions(GenericJTabbedDialog gd) {
// gd.addMessage ("Scene parameters selection"); // gd.addMessage ("Scene parameters selection");
// gd.addTab ("Inter-Match", "Parameters for full-resolution (no decimation/macrotiles) scene matching");
gd.addTab ("Scene Series", "Processing os series of scene and multi-series sets");
gd.addMessage ("Build series options"); gd.addMessage ("Build series options");
gd.addCheckbox ("Force reference scene DSI calculation", this.force_ref_dsi, gd.addCheckbox ("Force reference scene DSI calculation", this.force_ref_dsi,
"Calculate reference scene DSI even if the file exists."); "Calculate reference scene DSI even if the file exists.");
...@@ -400,6 +396,150 @@ public class IntersceneMatchParameters { ...@@ -400,6 +396,150 @@ public class IntersceneMatchParameters {
gd.addNumericField("Maximal displayed range", this.range_max, 5,7,"m", gd.addNumericField("Maximal displayed range", this.range_max, 5,7,"m",
"Do not display extremely far objects."); "Do not display extremely far objects.");
gd.addMessage ("Debug and visialization parameters");
gd.addCheckbox ("Replace scene with reference scene", this.scene_is_ref_test,
"Correlate reference scene with itself for testing (may want to manually change scene_atr and scene_xyz in debug mode)");
gd.addCheckbox ("Render reference scene", this.render_ref,
"Render reference scene as a multi-layer (per-port) image");
gd.addCheckbox ("Render compared scene", this.render_scene,
"Render reference compared as a multi-layer (per-port) image");
gd.addCheckbox ("Pseudo-color render (does not work)", this.toRGB,
"Use pseudo-color palette for scene render - DOES NOT WORK - use ColorProcParameters");
gd.addCheckbox ("Show 2D correlations", this.show_2d_correlations,
"Show raw 2D correlations (per channel and combined)");
gd.addCheckbox ("Show motion vectors", this.show_motion_vectors,
"Show motion vectors and strengths per channel and combines, NaN-s are when strengths corresponding are below thresholds");
gd.addNumericField("Debug Level for interscene match", this.debug_level, 0,3,"",
"Debug Level for the above parameters: renders and raw correlations need >1, motion vectors > 0");
gd.addMessage ("Pairwise ERS testing");
gd.addCheckbox ("Test pairwise matching with ERS", this.test_ers,
"Test pairwise dispaly and pose correction to test ERS compensation");
gd.addNumericField("Test scene reference index", this.test_ers0, 0,3,"",
"Reference scene index in a scene sequence");
gd.addNumericField("Test scene other scene index", this.test_ers1, 0,3,"",
"Other scene index in a scene sequence (should have a very different angular/linear velocity component)");
gd.addTab("Fiter DSI","Filter DSI before use (interscene fitting, interscene accumulation, ML generation");
// gd.addMessage ("Depth map filtering parameters");
gd.addNumericField("Average lowest disparity neighbors", this.num_bottom, 0,3,"",
"Average this number of lowest disparity neighbors (of 8)");
gd.addNumericField("Number of filter iterations", this.num_passes, 0,3,"",
"Number of filter iterations");
gd.addNumericField("Maximal change to exit", this.max_change, 5,7,"pix",
"Maximal change to exit iterations");
gd.addNumericField("Minimal disparity", this.min_disparity, 5,7,"pix",
"Minimal acceptable disparity");
gd.addNumericField("Disparity range for symmetrical pull", this.max_sym_disparity, 5,7,"pix",
"For larger disparities undefined tiles are pull predominantly down (to average of lowest), "+
"but for small disparities (sky) pull is to average of all neighbors.");
gd.addNumericField("Minimal strength LMA", this.min_strength_lma, 5,7,"",
"Lower strength for LMA tiles - treat as non-LMA");
gd.addNumericField("Minimal strength to replace", this.min_strength_replace, 5,7,"",
"Minimal strength to replace (now not used)");
gd.addNumericField("Minimal strength to blur", this.min_strength_blur, 5,7,"",
"Minimal strength to blur (now not used)");
gd.addNumericField("Blur weak sigma", this.sigma, 5,7,"",
"Blur weak sigma");
gd.addNumericField("Number of blur passes", this.num_blur, 0,3,"",
"Number of blur passes");
gd.addNumericField("Disparity offset (not used)", this.disparity_corr, 5,7,"",
"for setInterTasks() - currently not used ");
gd.addNumericField("Outlier N-th from extreme", this.outliers_nth_fromextrem, 0,3,"",
"0 - use min/max, 1 - use second min/max, ... second from min/max - removes dual-tile clusters max/mins");
gd.addNumericField("Outliers tolerance absolute", this.outliers_tolerance_absolute, 5,7,"pix",
"Absolute difference from extreme neighbor");
gd.addNumericField("Outliers tolerance realtive", this.outliers_tolerance_relative, 5,7,"pix/pix",
"Add to tolerance as a fraction of absolute tile disparity");
gd.addNumericField("Maximal number of outlier iterations", this.outliers_max_iter, 0,3,"",
"Maximal number of iterations for removing outliers");
gd.addNumericField("Maximal outlier strength 2", this.outliers_max_strength2, 5,7,"",
"Maximal outlier strength for second pass filtering");
gd.addNumericField("Outlier N-th from extreme 2", this.outliers_nth_fromextrem2, 0,3,"",
"Second filter: 0 - use min/max, 1 - use second min/max, ... second from min/max - removes dual-tile clusters max/mins");
gd.addNumericField("Outliers tolerance absolute 2", this.outliers_tolerance_absolute2, 5,7,"",
"Absolute difference from extreme neighbor, second filter");
gd.addNumericField("Outliers tolerance realtive 2", this.outliers_tolerance_relative2, 5,7,"",
"Add to tolerance as a fraction of absolute tile disparity, second filter");
gd.addNumericField("Outliers LMA maximal strength", this.outliers_lma_max_strength, 5,7,"",
"Maximal LMA strength for an outlier");
gd.addNumericField("Outliers non-LMA maximal strength", this.outliers_max_strength, 5,7,"",
"Outliers non-LMA (centroid) maximal strength");
gd.addNumericField("Outliers from LMA max strength", this.outliers_from_lma_max_strength, 5,7,"",
"Non-LMA outliers from LMA neighbors maximal strength");
gd.addNumericField("Search for LMA radius", this.search_radius, 0,3,"tile",
"Search farther if no LMA tiles are found around this non-LMA tile");
gd.addCheckbox ("Remove non-LMA tile if no LMA near", this.remove_no_lma_neib,
"Remove non-LMA tile if no LMA one is found within specified radius");
gd.addNumericField("LMA difference positive", this.diff_from_lma_pos, 5,7,"",
"Maximal non-LMA tile positive difference from the LMA neighbor");
gd.addNumericField("LMA difference negative", this.diff_from_lma_neg, 5,7,"",
"Maximal non-LMA tile negative difference from the LMA neighbor");
gd.addNumericField("LMA outliers N-th from extreme", this.outliers_lma_nth_fromextrem, 0,3,"",
"0 - use min/max, 1 - use second min/max, ... ");
gd.addNumericField("Margin from the sensor FOV edge ", this.filter_margin, 0,3,"pix",
"Disregard tiles with centers closer to the sensor FoV in pixels");
gd.addMessage ("Removing weak tiles with insufficient matching neighbors");
gd.addNumericField("Neighbor disparity tolerance (absolute)",this.weak_tolerance_absolute, 5,7,"pix",
"Absolute disparity difference to be considered a neighbor");
gd.addNumericField("Neighbor disparity tolerance (relative)", this.weak_tolerance_relative, 5,7,"",
"Relative disparity difference to be considered a neighbor");
gd.addNumericField("Minimal matching neighbors", this.weak_min_neibs, 0,3,"",
"Minimal number of weak matching neighbors (at least one is needed if there are strong non-neighbors).");
gd.addNumericField("Minimal strength to be strong", this.strong_strength, 5,7,"",
"Minimal strength to be considered strong(not weak). LMA are also considered strong.");
gd.addNumericField("Minimal weak strength", this.weak_strength, 5,7,"",
"Weaker are removed unconditionally (not used now).");
gd.addTab("Sky","Featureless sky areas detection and filtering (LWIR only)");
gd.addMessage ("Temperature-related filtering (requires photometric calibration)");
gd.addNumericField("High limit of the scene coldest tile", this.sky_highest_min, 5,7,"",
"Sky is normally cold. If the (globally offset) minimal scene absolutre pixel value is above - no sky in the scene (debug images still show it)");
gd.addNumericField("Cold level fraction", this.cold_frac, 5,7,"",
"All tiles below this percentile are considered \"cold\".");
gd.addNumericField("Hot level fraction", this.hot_frac, 5,7,"",
"All tiles above this percentile are considered \"hot\".");
gd.addNumericField("Cold FOM scale", this.cold_scale, 5,7,"",
"Multiply (strength*spread) by this value (reduce), and linearly scale up to 1.0 for hot ones.");
gd.addMessage ("Generate seed tiles for the potential sky area");
gd.addNumericField("Seed FOM level", this.sky_seed, 5,7,"",
"Maximal FOM (strength*spread*temp_scale) level to seed sky area, temp_scale is generated from average pixel value "+
"at infinity and 3 above parameters");
gd.addNumericField("Seed maximal disparity", this.lma_seed, 5,7,"pix",
"Seed tiles should not have LMA-found disparity above this");
gd.addNumericField("Shrink sky seed", this.sky_shrink, 0,3,"",
"Shrink sky seed tiles to eliminate too small (false) clusters. One shrinks in hor/vert, 2 - with diagonals, ...");
gd.addNumericField("Seed rows", this.seed_rows, 0,3,"",
"Sky is above and normally should appear in the top image rows. Applies after shrinking.");
gd.addMessage ("Expand seed tiles");
gd.addNumericField("Expand FOM limit", this.sky_lim, 5,7,"",
"Expand while FOM is below this value (usually to a high-contrast skyline).");
gd.addNumericField("Expand extra", this.sky_expand_extra, 0,3,"",
"Additionally expand sky area after reaching threshold in the previous step.");
gd.addNumericField("Modify strength to be at least this", this.min_strength, 5,7,"",
"Input strength has some with zero values resulting in zero FOM. Make them at least this.");
gd.addNumericField("Lowest sky row", this.lowest_sky_row, 0,3,"",
"Last defense - if the detected sky area reaches near-bottom of the page - it is invalid, remove it (but keep in debug images)");
gd.addTab ("Inter-Match", "Parameters for full-resolution scene matching");
// gd.addTab("Interscene Equalization","Equalization of the interscene correlation confidence to improve camera X,Y,Z matching");
gd.addMessage ("Interscene match parameters"); gd.addMessage ("Interscene match parameters");
gd.addNumericField("Image margin", this.margin, 0,5,"pix", gd.addNumericField("Image margin", this.margin, 0,5,"pix",
"Do not use tiles if their centers are closer to the virtual image edge"); "Do not use tiles if their centers are closer to the virtual image edge");
...@@ -413,12 +553,6 @@ public class IntersceneMatchParameters { ...@@ -413,12 +553,6 @@ public class IntersceneMatchParameters {
"Calculate centroids after multiplication by a half-cosine window. All correlation data farther than this value from the center is ignored"); "Calculate centroids after multiplication by a half-cosine window. All correlation data farther than this value from the center is ignored");
gd.addNumericField("Refine centroids", this.n_recenter, 0,5,"", gd.addNumericField("Refine centroids", this.n_recenter, 0,5,"",
"Repeat centroids after moving the window center to the new centroid location this many times (0 - calculate once)"); "Repeat centroids after moving the window center to the new centroid location this many times (0 - calculate once)");
// gd.addMessage ("Filter tiles to use for scene poses");
// gd.addNumericField("DSI_MAIN minimal strength", this.min_ref_str, 5,7,"",
// "Match only tiles where DSI_MAIN is stronger than that (and has LMA).");
gd.addMessage ("Mixing TD and PD accumulation of 2d correlations"); gd.addMessage ("Mixing TD and PD accumulation of 2d correlations");
gd.addNumericField("TD-accumulated weight", this.td_weight, 5,7,"", gd.addNumericField("TD-accumulated weight", this.td_weight, 5,7,"",
"Mix argmax from TD-accumulated correlation."); "Mix argmax from TD-accumulated correlation.");
...@@ -426,7 +560,6 @@ public class IntersceneMatchParameters { ...@@ -426,7 +560,6 @@ public class IntersceneMatchParameters {
"Mix argmax from PD-accumulated correlation."); "Mix argmax from PD-accumulated correlation.");
gd.addCheckbox ("TD when no PD only", this.td_nopd_only, gd.addCheckbox ("TD when no PD only", this.td_nopd_only,
"Use argmax from TD only if PD data is not available for this tile."); "Use argmax from TD only if PD data is not available for this tile.");
gd.addMessage ("Filtering motion vectors"); gd.addMessage ("Filtering motion vectors");
gd.addNumericField("Minimal correlation strength (non-sum)", this.min_str, 5,7,"", gd.addNumericField("Minimal correlation strength (non-sum)", this.min_str, 5,7,"",
"Minimal correlation strength for individual correlation and for pixel-domain averaged one. Weeker tiles results are removed."); "Minimal correlation strength for individual correlation and for pixel-domain averaged one. Weeker tiles results are removed.");
...@@ -516,156 +649,26 @@ public class IntersceneMatchParameters { ...@@ -516,156 +649,26 @@ public class IntersceneMatchParameters {
"Adjust scene camera roll with LMA"); "Adjust scene camera roll with LMA");
gd.addCheckbox ("X", this.adjust_xyz[0], gd.addCheckbox ("X", this.adjust_xyz[0],
"Adjust scene camera X with LMA"); "Adjust scene camera X with LMA");
gd.addCheckbox ("Y", this.adjust_xyz[1], gd.addCheckbox ("Y", this.adjust_xyz[1],
"Adjust scene camera Y with LMA"); "Adjust scene camera Y with LMA");
gd.addCheckbox ("Z", this.adjust_xyz[2], gd.addCheckbox ("Z", this.adjust_xyz[2],
"Adjust scene camera Z with LMA"); "Adjust scene camera Z with LMA");
gd.addNumericField("Exit ATR change", this.exit_change_atr, 6,7,"pix",
"L2 of azimuth, tilt, roll change (in pixels at infinity) to exit fitting");
gd.addNumericField("Exit XYZ change", this.exit_change_xyz, 5,7,"m",
"L2 of linear scene camera position change (in meters) to exit fitting");
gd.addNumericField("Max full iterations", this.max_cycles, 0,3,"",
"Hard limit on interscene correlations plus LMA cycles");
gd.addNumericField("Max LMA iterations", this.max_LMA, 0,3,"",
"Hard limit on LMA iterations");
gd.addNumericField("Maximal RMS to fail", this.max_rms, 5,7,"pix",
"Maximal fitting RMS to consider fitting failure");
gd.addMessage ("Debug and visialization parameters");
gd.addCheckbox ("Replace scene with reference scene", this.scene_is_ref_test,
"Correlate reference scene with itself for testing (may want to manually change scene_atr and scene_xyz in debug mode)");
gd.addCheckbox ("Render reference scene", this.render_ref,
"Render reference scene as a multi-layer (per-port) image");
gd.addCheckbox ("Render compared scene", this.render_scene,
"Render reference compared as a multi-layer (per-port) image");
gd.addCheckbox ("Pseudo-color render (does not work)", this.toRGB,
"Use pseudo-color palette for scene render - DOES NOT WORK - use ColorProcParameters");
gd.addCheckbox ("Show 2D correlations", this.show_2d_correlations,
"Show raw 2D correlations (per channel and combined)");
gd.addCheckbox ("Show motion vectors", this.show_motion_vectors,
"Show motion vectors and strengths per channel and combines, NaN-s are when strengths corresponding are below thresholds");
gd.addNumericField("Debug Level for interscene match", this.debug_level, 0,3,"",
"Debug Level for the above parameters: renders and raw correlations need >1, motion vectors > 0");
gd.addMessage ("Pairwise ERS testing");
gd.addCheckbox ("Test pairwise matching with ERS", this.test_ers,
"Test pairwise dispaly and pose correction to test ERS compensation");
gd.addNumericField("Test scene reference index", this.test_ers0, 0,3,"",
"Reference scene index in a scene sequence");
gd.addNumericField("Test scene other scene index", this.test_ers1, 0,3,"",
"Other scene index in a scene sequence (should have a very different angular/linear velocity component)");
gd.addTab("Fiter DSI","Filter DSI before use (interscene fitting, interscene accumulation, ML generation");
// gd.addMessage ("Depth map filtering parameters");
gd.addNumericField("Average lowest disparity neighbors", this.num_bottom, 0,3,"",
"Average this number of lowest disparity neighbors (of 8)");
gd.addNumericField("Number of filter iterations", this.num_passes, 0,3,"",
"Number of filter iterations");
gd.addNumericField("Maximal change to exit", this.max_change, 5,7,"pix",
"Maximal change to exit iterations");
gd.addNumericField("Minimal disparity", this.min_disparity, 5,7,"pix",
"Minimal acceptable disparity");
gd.addNumericField("Disparity range for symmetrical pull", this.max_sym_disparity, 5,7,"pix",
"For larger disparities undefined tiles are pull predominantly down (to average of lowest), "+
"but for small disparities (sky) pull is to average of all neighbors.");
gd.addNumericField("Minimal strength LMA", this.min_strength_lma, 5,7,"",
"Lower strength for LMA tiles - treat as non-LMA");
gd.addNumericField("Minimal strength to replace", this.min_strength_replace, 5,7,"",
"Minimal strength to replace (now not used)");
gd.addNumericField("Minimal strength to blur", this.min_strength_blur, 5,7,"",
"Minimal strength to blur (now not used)");
gd.addNumericField("Blur weak sigma", this.sigma, 5,7,"",
"Blur weak sigma");
gd.addNumericField("Number of blur passes", this.num_blur, 0,3,"",
"Number of blur passes");
gd.addNumericField("Disparity offset (not used)", this.disparity_corr, 5,7,"",
"for setInterTasks() - currently not used ");
gd.addNumericField("Outlier N-th from extreme", this.outliers_nth_fromextrem, 0,3,"",
"0 - use min/max, 1 - use second min/max, ... second from min/max - removes dual-tile clusters max/mins");
gd.addNumericField("Outliers tolerance absolute", this.outliers_tolerance_absolute, 5,7,"pix",
"Absolute difference from extreme neighbor");
gd.addNumericField("Outliers tolerance realtive", this.outliers_tolerance_relative, 5,7,"pix/pix",
"Add to tolerance as a fraction of absolute tile disparity");
gd.addNumericField("Maximal number of outlier iterations", this.outliers_max_iter, 0,3,"",
"Maximal number of iterations for removing outliers");
gd.addNumericField("Maximal outlier strength 2", this.outliers_max_strength2, 5,7,"",
"Maximal outlier strength for second pass filtering");
gd.addNumericField("Outlier N-th from extreme 2", this.outliers_nth_fromextrem2, 0,3,"",
"Second filter: 0 - use min/max, 1 - use second min/max, ... second from min/max - removes dual-tile clusters max/mins");
gd.addNumericField("Outliers tolerance absolute 2", this.outliers_tolerance_absolute2, 5,7,"",
"Absolute difference from extreme neighbor, second filter");
gd.addNumericField("Outliers tolerance realtive 2", this.outliers_tolerance_relative2, 5,7,"",
"Add to tolerance as a fraction of absolute tile disparity, second filter");
gd.addNumericField("Outliers LMA maximal strength", this.outliers_lma_max_strength, 5,7,"",
"Maximal LMA strength for an outlier");
gd.addNumericField("Outliers non-LMA maximal strength", this.outliers_max_strength, 5,7,"",
"Outliers non-LMA (centroid) maximal strength");
gd.addNumericField("Outliers from LMA max strength", this.outliers_from_lma_max_strength, 5,7,"",
"Non-LMA outliers from LMA neighbors maximal strength");
gd.addNumericField("Search for LMA radius", this.search_radius, 0,3,"tile",
"Search farther if no LMA tiles are found around this non-LMA tile");
gd.addCheckbox ("Remove non-LMA tile if no LMA near", this.remove_no_lma_neib,
"Remove non-LMA tile if no LMA one is found within specified radius");
gd.addNumericField("LMA difference positive", this.diff_from_lma_pos, 5,7,"",
"Maximal non-LMA tile positive difference from the LMA neighbor");
gd.addNumericField("LMA difference negative", this.diff_from_lma_neg, 5,7,"",
"Maximal non-LMA tile negative difference from the LMA neighbor");
gd.addNumericField("LMA outliers N-th from extreme", this.outliers_lma_nth_fromextrem, 0,3,"",
"0 - use min/max, 1 - use second min/max, ... ");
gd.addNumericField("Margin from the sensor FOV edge ", this.filter_margin, 0,3,"pix",
"Disregard tiles with centers closer to the sensor FoV in pixels");
gd.addMessage ("Removing weak tiles with insufficient matching neighbors");
gd.addNumericField("Neighbor disparity tolerance (absolute)",this.weak_tolerance_absolute, 5,7,"pix",
"Absolute disparity difference to be considered a neighbor");
gd.addNumericField("Neighbor disparity tolerance (relative)", this.weak_tolerance_relative, 5,7,"",
"Relative disparity difference to be considered a neighbor");
gd.addNumericField("Minimal matching neighbors", this.weak_min_neibs, 0,3,"",
"Minimal number of weak matching neighbors (at least one is needed if there are strong non-neighbors).");
gd.addNumericField("Minimal strength to be strong", this.strong_strength, 5,7,"",
"Minimal strength to be considered strong(not weak). LMA are also considered strong.");
gd.addNumericField("Minimal weak strength", this.weak_strength, 5,7,"",
"Weaker are removed unconditionally (not used now).");
gd.addTab("Sky","Featureless sky areas detection and filtering (LWIR only)"); gd.addNumericField("Exit ATR change", this.exit_change_atr, 6,7,"pix",
gd.addMessage ("Temperature-related filtering (requires photometric calibration)"); "L2 of azimuth, tilt, roll change (in pixels at infinity) to exit fitting");
gd.addNumericField("High limit of the scene coldest tile", this.sky_highest_min, 5,7,"", gd.addNumericField("Exit XYZ change", this.exit_change_xyz, 5,7,"m",
"Sky is normally cold. If the (globally offset) minimal scene absolutre pixel value is above - no sky in the scene (debug images still show it)"); "L2 of linear scene camera position change (in meters) to exit fitting");
gd.addNumericField("Cold level fraction", this.cold_frac, 5,7,"",
"All tiles below this percentile are considered \"cold\".");
gd.addNumericField("Hot level fraction", this.hot_frac, 5,7,"", gd.addNumericField("Max full iterations", this.max_cycles, 0,3,"",
"All tiles above this percentile are considered \"hot\"."); "Hard limit on interscene correlations plus LMA cycles");
gd.addNumericField("Cold FOM scale", this.cold_scale, 5,7,"", gd.addNumericField("Max LMA iterations", this.max_LMA, 0,3,"",
"Multiply (strength*spread) by this value (reduce), and linearly scale up to 1.0 for hot ones."); "Hard limit on LMA iterations");
gd.addMessage ("Generate seed tiles for the potential sky area"); gd.addNumericField("Maximal RMS to fail", this.max_rms, 5,7,"pix",
gd.addNumericField("Seed FOM level", this.sky_seed, 5,7,"", "Maximal fitting RMS to consider fitting failure");
"Maximal FOM (strength*spread*temp_scale) level to seed sky area, temp_scale is generated from average pixel value "+
"at infinity and 3 above parameters");
gd.addNumericField("Seed maximal disparity", this.lma_seed, 5,7,"pix",
"Seed tiles should not have LMA-found disparity above this");
gd.addNumericField("Shrink sky seed", this.sky_shrink, 0,3,"",
"Shrink sky seed tiles to eliminate too small (false) clusters. One shrinks in hor/vert, 2 - with diagonals, ...");
gd.addNumericField("Seed rows", this.seed_rows, 0,3,"",
"Sky is above and normally should appear in the top image rows. Applies after shrinking.");
gd.addMessage ("Expand seed tiles");
gd.addNumericField("Expand FOM limit", this.sky_lim, 5,7,"",
"Expand while FOM is below this value (usually to a high-contrast skyline).");
gd.addNumericField("Expand extra", this.sky_expand_extra, 0,3,"",
"Additionally expand sky area after reaching threshold in the previous step.");
gd.addNumericField("Modify strength to be at least this", this.min_strength, 5,7,"",
"Input strength has some with zero values resulting in zero FOM. Make them at least this.");
gd.addNumericField("Lowest sky row", this.lowest_sky_row, 0,3,"",
"Last defense - if the detected sky area reaches near-bottom of the page - it is invalid, remove it (but keep in debug images)");
gd.addTab("Interscene Equalization","Equalization of the interscene correlation confidence to improve camera X,Y,Z matching"); gd.addMessage ("Interscene Equalization (Equalization of the interscene correlation confidence to improve camera X,Y,Z matching)");
gd.addCheckbox ("Enable equalization", this.eq_en, gd.addCheckbox ("Enable equalization", this.eq_en,
"Enable boosting of the weak but important interscene correlation tiles strength by equalizing average strength of the \"supertiles\""); "Enable boosting of the weak but important interscene correlation tiles strength by equalizing average strength of the \"supertiles\"");
gd.addMessage ("Equalization supertiles dimensions"); gd.addMessage ("Equalization supertiles dimensions");
...@@ -835,70 +838,10 @@ public class IntersceneMatchParameters { ...@@ -835,70 +838,10 @@ public class IntersceneMatchParameters {
this.range_min_strength = gd.getNextNumber(); this.range_min_strength = gd.getNextNumber();
this.range_max = gd.getNextNumber(); this.range_max = gd.getNextNumber();
this.margin = (int) gd.getNextNumber();
this.sensor_mask_inter= (int) gd.getNextNumber();
this.use_partial = gd.getNextBoolean();
this.run_poly = gd.getNextBoolean();
this.centroid_radius = gd.getNextNumber();
this.n_recenter = (int) gd.getNextNumber();
// this.min_ref_str = gd.getNextNumber();
this.td_weight = gd.getNextNumber();
this.pd_weight = gd.getNextNumber();
this.td_nopd_only = gd.getNextBoolean();
this.min_str = gd.getNextNumber();
this.min_str_fpn = gd.getNextNumber();
this.min_str_sum = gd.getNextNumber();
this.min_str_sum_fpn = gd.getNextNumber();
this.min_neibs = (int) gd.getNextNumber();
this.weight_zero_neibs = gd.getNextNumber();
this.half_disparity = gd.getNextNumber();
this.half_avg_diff = gd.getNextNumber();
this.min_ref_str = gd.getNextNumber();
this.pix_step = (int) gd.getNextNumber();
this.search_rad = (int) gd.getNextNumber();
this.maybe_sum = gd.getNextNumber();
this.sure_sum = gd.getNextNumber();
this.maybe_avg = gd.getNextNumber();
this.sure_avg = gd.getNextNumber();
this.max_search_rms = gd.getNextNumber();
this.maybe_fom = gd.getNextNumber();
this.sure_fom = gd.getNextNumber();
this.use_combo_dsi = gd.getNextBoolean();
this.use_lma_dsi = gd.getNextBoolean();
this.fpn_remove = gd.getNextBoolean();
this.fpn_max_offset = gd.getNextNumber();
this.fpn_radius = gd.getNextNumber();
this.fpn_ignore_border = gd.getNextBoolean();
this.mov_en = gd.getNextBoolean();
this.mov_sigma = gd.getNextNumber();
this.mov_max_std = gd.getNextNumber();
this.mov_thresh_rel = gd.getNextNumber();
this.mov_thresh_abs = gd.getNextNumber();
this.mov_clust_max = gd.getNextNumber();
this.mov_grow = (int) gd.getNextNumber();
this.mov_show = gd.getNextBoolean();
this.mov_debug_level = (int) gd.getNextNumber();
this.adjust_atr[0] = gd.getNextBoolean();
this.adjust_atr[1] = gd.getNextBoolean();
this.adjust_atr[2] = gd.getNextBoolean();
this.adjust_xyz[0] = gd.getNextBoolean();
this.adjust_xyz[1] = gd.getNextBoolean();
this.adjust_xyz[2] = gd.getNextBoolean();
this.exit_change_atr = gd.getNextNumber();
this.exit_change_xyz = gd.getNextNumber();
this.max_cycles = (int) gd.getNextNumber();
this.max_LMA = (int) gd.getNextNumber();
this.max_rms = gd.getNextNumber();
this.scene_is_ref_test = gd.getNextBoolean(); this.scene_is_ref_test = gd.getNextBoolean();
this.render_ref = gd.getNextBoolean(); this.render_ref = gd.getNextBoolean();
this.render_scene = gd.getNextBoolean(); this.render_scene = gd.getNextBoolean();
...@@ -959,6 +902,61 @@ public class IntersceneMatchParameters { ...@@ -959,6 +902,61 @@ public class IntersceneMatchParameters {
this.min_strength = gd.getNextNumber(); this.min_strength = gd.getNextNumber();
this.lowest_sky_row = (int) gd.getNextNumber(); this.lowest_sky_row = (int) gd.getNextNumber();
this.margin = (int) gd.getNextNumber();
this.sensor_mask_inter= (int) gd.getNextNumber();
this.use_partial = gd.getNextBoolean();
this.run_poly = gd.getNextBoolean();
this.centroid_radius = gd.getNextNumber();
this.n_recenter = (int) gd.getNextNumber();
this.td_weight = gd.getNextNumber();
this.pd_weight = gd.getNextNumber();
this.td_nopd_only = gd.getNextBoolean();
this.min_str = gd.getNextNumber();
this.min_str_fpn = gd.getNextNumber();
this.min_str_sum = gd.getNextNumber();
this.min_str_sum_fpn = gd.getNextNumber();
this.min_neibs = (int) gd.getNextNumber();
this.weight_zero_neibs = gd.getNextNumber();
this.half_disparity = gd.getNextNumber();
this.half_avg_diff = gd.getNextNumber();
this.min_ref_str = gd.getNextNumber();
this.pix_step = (int) gd.getNextNumber();
this.search_rad = (int) gd.getNextNumber();
this.maybe_sum = gd.getNextNumber();
this.sure_sum = gd.getNextNumber();
this.maybe_avg = gd.getNextNumber();
this.sure_avg = gd.getNextNumber();
this.max_search_rms = gd.getNextNumber();
this.maybe_fom = gd.getNextNumber();
this.sure_fom = gd.getNextNumber();
this.use_combo_dsi = gd.getNextBoolean();
this.use_lma_dsi = gd.getNextBoolean();
this.fpn_remove = gd.getNextBoolean();
this.fpn_max_offset = gd.getNextNumber();
this.fpn_radius = gd.getNextNumber();
this.fpn_ignore_border = gd.getNextBoolean();
this.mov_en = gd.getNextBoolean();
this.mov_sigma = gd.getNextNumber();
this.mov_max_std = gd.getNextNumber();
this.mov_thresh_rel = gd.getNextNumber();
this.mov_thresh_abs = gd.getNextNumber();
this.mov_clust_max = gd.getNextNumber();
this.mov_grow = (int) gd.getNextNumber();
this.mov_show = gd.getNextBoolean();
this.mov_debug_level = (int) gd.getNextNumber();
this.adjust_atr[0] = gd.getNextBoolean();
this.adjust_atr[1] = gd.getNextBoolean();
this.adjust_atr[2] = gd.getNextBoolean();
this.adjust_xyz[0] = gd.getNextBoolean();
this.adjust_xyz[1] = gd.getNextBoolean();
this.adjust_xyz[2] = gd.getNextBoolean();
this.exit_change_atr = gd.getNextNumber();
this.exit_change_xyz = gd.getNextNumber();
this.max_cycles = (int) gd.getNextNumber();
this.max_LMA = (int) gd.getNextNumber();
this.max_rms = gd.getNextNumber();
// equalization of the inter-scene correlations // equalization of the inter-scene correlations
this.eq_en = gd.getNextBoolean(); this.eq_en = gd.getNextBoolean();
this.eq_stride_hor = (int) gd.getNextNumber(); this.eq_stride_hor = (int) gd.getNextNumber();
...@@ -1114,69 +1112,6 @@ public class IntersceneMatchParameters { ...@@ -1114,69 +1112,6 @@ public class IntersceneMatchParameters {
properties.setProperty(prefix+"range_max", this.range_max+""); // double properties.setProperty(prefix+"range_max", this.range_max+""); // double
properties.setProperty(prefix+"margin", this.margin+""); // int
properties.setProperty(prefix+"sensor_mask_inter", this.sensor_mask_inter+""); // int
properties.setProperty(prefix+"use_partial", this.use_partial+""); // boolean
properties.setProperty(prefix+"run_poly", this.run_poly+""); // boolean
properties.setProperty(prefix+"centroid_radius", this.centroid_radius+""); // double
properties.setProperty(prefix+"n_recenter", this.n_recenter+""); // int
properties.setProperty(prefix+"min_ref_str", this.min_ref_str+""); // double
properties.setProperty(prefix+"td_weight", this.td_weight+""); // double
properties.setProperty(prefix+"pd_weight", this.pd_weight+""); // double
properties.setProperty(prefix+"td_nopd_only", this.td_nopd_only+""); // boolean
properties.setProperty(prefix+"min_str", this.min_str+""); // double
properties.setProperty(prefix+"min_str_fpn", this.min_str_fpn+""); // double
properties.setProperty(prefix+"min_str_sum", this.min_str_sum+""); // double
properties.setProperty(prefix+"min_str_sum_fpn", this.min_str_sum_fpn+""); // double
properties.setProperty(prefix+"min_neibs", this.min_neibs+""); // int
properties.setProperty(prefix+"weight_zero_neibs", this.weight_zero_neibs+""); // double
properties.setProperty(prefix+"half_disparity", this.half_disparity+""); // double
properties.setProperty(prefix+"half_avg_diff", this.half_avg_diff+""); // double
properties.setProperty(prefix+"pix_step", this.pix_step+""); // int
properties.setProperty(prefix+"search_rad", this.search_rad+""); // int
properties.setProperty(prefix+"maybe_sum", this.maybe_sum+""); // double
properties.setProperty(prefix+"sure_sum", this.sure_sum+""); // double
properties.setProperty(prefix+"maybe_avg", this.maybe_avg+""); // double
properties.setProperty(prefix+"sure_avg", this.sure_avg+""); // double
properties.setProperty(prefix+"max_search_rms", this.max_search_rms+""); // double
properties.setProperty(prefix+"maybe_fom", this.maybe_fom+""); // double
properties.setProperty(prefix+"sure_fom", this.sure_fom+""); // double
properties.setProperty(prefix+"use_combo_dsi", this.use_combo_dsi+""); // boolean
properties.setProperty(prefix+"use_lma_dsi", this.use_lma_dsi+""); // boolean
properties.setProperty(prefix+"fpn_remove", this.fpn_remove+""); // boolean
properties.setProperty(prefix+"fpn_max_offset", this.fpn_max_offset+""); // double
properties.setProperty(prefix+"fpn_radius", this.fpn_radius+""); // double
properties.setProperty(prefix+"fpn_ignore_border", this.fpn_ignore_border+""); // boolean
properties.setProperty(prefix+"mov_en", this.mov_en+""); // boolean
properties.setProperty(prefix+"mov_sigma", this.mov_sigma+""); // double
properties.setProperty(prefix+"mov_max_std", this.mov_max_std+""); // double
properties.setProperty(prefix+"mov_thresh_rel", this.mov_thresh_rel+""); // double
properties.setProperty(prefix+"mov_thresh_abs", this.mov_thresh_abs+""); // double
properties.setProperty(prefix+"mov_clust_max", this.mov_clust_max+""); // double
properties.setProperty(prefix+"mov_grow", this.mov_grow+""); // int
properties.setProperty(prefix+"mov_show", this.mov_show+""); // boolean
properties.setProperty(prefix+"mov_debug_level", this.mov_debug_level+""); // int
properties.setProperty(prefix+"adjust_atr_0", this.adjust_atr[0]+""); // boolean
properties.setProperty(prefix+"adjust_atr_1", this.adjust_atr[1]+""); // boolean
properties.setProperty(prefix+"adjust_atr_2", this.adjust_atr[2]+""); // boolean
properties.setProperty(prefix+"adjust_xyz_0", this.adjust_xyz[0]+""); // boolean
properties.setProperty(prefix+"adjust_xyz_1", this.adjust_xyz[1]+""); // boolean
properties.setProperty(prefix+"adjust_xyz_2", this.adjust_xyz[2]+""); // boolean
properties.setProperty(prefix+"exit_change_atr", this.exit_change_atr+""); // double
properties.setProperty(prefix+"exit_change_xyz", this.exit_change_xyz+""); // double
properties.setProperty(prefix+"max_cycles", this.max_cycles+""); // int
properties.setProperty(prefix+"max_LMA", this.max_LMA+""); // int
properties.setProperty(prefix+"max_rms", this.max_rms+""); // double
properties.setProperty(prefix+"scene_is_ref_test", this.scene_is_ref_test+""); // boolean properties.setProperty(prefix+"scene_is_ref_test", this.scene_is_ref_test+""); // boolean
properties.setProperty(prefix+"render_ref", this.render_ref+""); // boolean properties.setProperty(prefix+"render_ref", this.render_ref+""); // boolean
properties.setProperty(prefix+"render_scene", this.render_scene+""); // boolean properties.setProperty(prefix+"render_scene", this.render_scene+""); // boolean
...@@ -1235,6 +1170,61 @@ public class IntersceneMatchParameters { ...@@ -1235,6 +1170,61 @@ public class IntersceneMatchParameters {
properties.setProperty(prefix+"min_strength", this.min_strength+""); // double properties.setProperty(prefix+"min_strength", this.min_strength+""); // double
properties.setProperty(prefix+"lowest_sky_row", this.lowest_sky_row+""); // int properties.setProperty(prefix+"lowest_sky_row", this.lowest_sky_row+""); // int
properties.setProperty(prefix+"margin", this.margin+""); // int
properties.setProperty(prefix+"sensor_mask_inter", this.sensor_mask_inter+""); // int
properties.setProperty(prefix+"use_partial", this.use_partial+""); // boolean
properties.setProperty(prefix+"run_poly", this.run_poly+""); // boolean
properties.setProperty(prefix+"centroid_radius", this.centroid_radius+""); // double
properties.setProperty(prefix+"n_recenter", this.n_recenter+""); // int
properties.setProperty(prefix+"min_ref_str", this.min_ref_str+""); // double
properties.setProperty(prefix+"td_weight", this.td_weight+""); // double
properties.setProperty(prefix+"pd_weight", this.pd_weight+""); // double
properties.setProperty(prefix+"td_nopd_only", this.td_nopd_only+""); // boolean
properties.setProperty(prefix+"min_str", this.min_str+""); // double
properties.setProperty(prefix+"min_str_fpn", this.min_str_fpn+""); // double
properties.setProperty(prefix+"min_str_sum", this.min_str_sum+""); // double
properties.setProperty(prefix+"min_str_sum_fpn", this.min_str_sum_fpn+""); // double
properties.setProperty(prefix+"min_neibs", this.min_neibs+""); // int
properties.setProperty(prefix+"weight_zero_neibs", this.weight_zero_neibs+""); // double
properties.setProperty(prefix+"half_disparity", this.half_disparity+""); // double
properties.setProperty(prefix+"half_avg_diff", this.half_avg_diff+""); // double
properties.setProperty(prefix+"pix_step", this.pix_step+""); // int
properties.setProperty(prefix+"search_rad", this.search_rad+""); // int
properties.setProperty(prefix+"maybe_sum", this.maybe_sum+""); // double
properties.setProperty(prefix+"sure_sum", this.sure_sum+""); // double
properties.setProperty(prefix+"maybe_avg", this.maybe_avg+""); // double
properties.setProperty(prefix+"sure_avg", this.sure_avg+""); // double
properties.setProperty(prefix+"max_search_rms", this.max_search_rms+""); // double
properties.setProperty(prefix+"maybe_fom", this.maybe_fom+""); // double
properties.setProperty(prefix+"sure_fom", this.sure_fom+""); // double
properties.setProperty(prefix+"use_combo_dsi", this.use_combo_dsi+""); // boolean
properties.setProperty(prefix+"use_lma_dsi", this.use_lma_dsi+""); // boolean
properties.setProperty(prefix+"fpn_remove", this.fpn_remove+""); // boolean
properties.setProperty(prefix+"fpn_max_offset", this.fpn_max_offset+""); // double
properties.setProperty(prefix+"fpn_radius", this.fpn_radius+""); // double
properties.setProperty(prefix+"fpn_ignore_border", this.fpn_ignore_border+""); // boolean
properties.setProperty(prefix+"mov_en", this.mov_en+""); // boolean
properties.setProperty(prefix+"mov_sigma", this.mov_sigma+""); // double
properties.setProperty(prefix+"mov_max_std", this.mov_max_std+""); // double
properties.setProperty(prefix+"mov_thresh_rel", this.mov_thresh_rel+""); // double
properties.setProperty(prefix+"mov_thresh_abs", this.mov_thresh_abs+""); // double
properties.setProperty(prefix+"mov_clust_max", this.mov_clust_max+""); // double
properties.setProperty(prefix+"mov_grow", this.mov_grow+""); // int
properties.setProperty(prefix+"mov_show", this.mov_show+""); // boolean
properties.setProperty(prefix+"mov_debug_level", this.mov_debug_level+""); // int
properties.setProperty(prefix+"adjust_atr_0", this.adjust_atr[0]+""); // boolean
properties.setProperty(prefix+"adjust_atr_1", this.adjust_atr[1]+""); // boolean
properties.setProperty(prefix+"adjust_atr_2", this.adjust_atr[2]+""); // boolean
properties.setProperty(prefix+"adjust_xyz_0", this.adjust_xyz[0]+""); // boolean
properties.setProperty(prefix+"adjust_xyz_1", this.adjust_xyz[1]+""); // boolean
properties.setProperty(prefix+"adjust_xyz_2", this.adjust_xyz[2]+""); // boolean
properties.setProperty(prefix+"exit_change_atr", this.exit_change_atr+""); // double
properties.setProperty(prefix+"exit_change_xyz", this.exit_change_xyz+""); // double
properties.setProperty(prefix+"max_cycles", this.max_cycles+""); // int
properties.setProperty(prefix+"max_LMA", this.max_LMA+""); // int
properties.setProperty(prefix+"max_rms", this.max_rms+""); // double
properties.setProperty(prefix+"eq_en", this.eq_en+""); // boolean properties.setProperty(prefix+"eq_en", this.eq_en+""); // boolean
properties.setProperty(prefix+"eq_stride_hor", this.eq_stride_hor+""); // int properties.setProperty(prefix+"eq_stride_hor", this.eq_stride_hor+""); // int
properties.setProperty(prefix+"eq_stride_vert", this.eq_stride_vert+""); // int properties.setProperty(prefix+"eq_stride_vert", this.eq_stride_vert+""); // int
...@@ -1343,70 +1333,6 @@ public class IntersceneMatchParameters { ...@@ -1343,70 +1333,6 @@ public class IntersceneMatchParameters {
if (properties.getProperty(prefix+"margin")!=null) this.margin=Integer.parseInt(properties.getProperty(prefix+"margin"));
if (properties.getProperty(prefix+"sensor_mask_inter")!=null) this.sensor_mask_inter=Integer.parseInt(properties.getProperty(prefix+"sensor_mask_inter"));
if (properties.getProperty(prefix+"use_partial")!=null) this.use_partial=Boolean.parseBoolean(properties.getProperty(prefix+"use_partial"));
if (properties.getProperty(prefix+"run_poly")!=null) this.run_poly=Boolean.parseBoolean(properties.getProperty(prefix+"run_poly"));
if (properties.getProperty(prefix+"centroid_radius")!=null) this.centroid_radius=Double.parseDouble(properties.getProperty(prefix+"centroid_radius"));
if (properties.getProperty(prefix+"n_recenter")!=null) this.n_recenter=Integer.parseInt(properties.getProperty(prefix+"n_recenter"));
if (properties.getProperty(prefix+"min_ref_str")!=null) this.min_ref_str=Double.parseDouble(properties.getProperty(prefix+"min_ref_str"));
if (properties.getProperty(prefix+"td_weight")!=null) this.td_weight=Double.parseDouble(properties.getProperty(prefix+"td_weight"));
if (properties.getProperty(prefix+"pd_weight")!=null) this.pd_weight=Double.parseDouble(properties.getProperty(prefix+"pd_weight"));
if (properties.getProperty(prefix+"td_nopd_only")!=null) this.td_nopd_only=Boolean.parseBoolean(properties.getProperty(prefix+"td_nopd_only"));
if (properties.getProperty(prefix+"min_str")!=null) this.min_str=Double.parseDouble(properties.getProperty(prefix+"min_str"));
if (properties.getProperty(prefix+"min_str_fpn")!=null) this.min_str_fpn=Double.parseDouble(properties.getProperty(prefix+"min_str_fpn"));
if (properties.getProperty(prefix+"min_str_sum")!=null) this.min_str_sum=Double.parseDouble(properties.getProperty(prefix+"min_str_sum"));
if (properties.getProperty(prefix+"min_str_sum_fpn")!=null) this.min_str_sum_fpn=Double.parseDouble(properties.getProperty(prefix+"min_str_sum_fpn"));
if (properties.getProperty(prefix+"min_neibs")!=null) this.min_neibs=Integer.parseInt(properties.getProperty(prefix+"min_neibs"));
if (properties.getProperty(prefix+"weight_zero_neibs")!=null) this.weight_zero_neibs=Double.parseDouble(properties.getProperty(prefix+"weight_zero_neibs"));
if (properties.getProperty(prefix+"half_disparity")!=null) this.half_disparity=Double.parseDouble(properties.getProperty(prefix+"half_disparity"));
if (properties.getProperty(prefix+"half_avg_diff")!=null) this.half_avg_diff=Double.parseDouble(properties.getProperty(prefix+"half_avg_diff"));
if (properties.getProperty(prefix+"pix_step")!=null) this.pix_step=Integer.parseInt(properties.getProperty(prefix+"pix_step"));
if (properties.getProperty(prefix+"search_rad")!=null) this.search_rad=Integer.parseInt(properties.getProperty(prefix+"search_rad"));
if (properties.getProperty(prefix+"maybe_sum")!=null) this.maybe_sum=Double.parseDouble(properties.getProperty(prefix+"maybe_sum"));
if (properties.getProperty(prefix+"sure_sum")!=null) this.sure_sum=Double.parseDouble(properties.getProperty(prefix+"sure_sum"));
if (properties.getProperty(prefix+"maybe_avg")!=null) this.maybe_avg=Double.parseDouble(properties.getProperty(prefix+"maybe_avg"));
if (properties.getProperty(prefix+"sure_avg")!=null) this.sure_avg=Double.parseDouble(properties.getProperty(prefix+"sure_avg"));
if (properties.getProperty(prefix+"max_search_rms")!=null) this.max_search_rms=Double.parseDouble(properties.getProperty(prefix+"max_search_rms"));
if (properties.getProperty(prefix+"maybe_fom")!=null) this.maybe_fom=Double.parseDouble(properties.getProperty(prefix+"maybe_fom"));
if (properties.getProperty(prefix+"sure_fom")!=null) this.sure_fom=Double.parseDouble(properties.getProperty(prefix+"sure_fom"));
if (properties.getProperty(prefix+"use_combo_dsi")!=null) this.use_combo_dsi=Boolean.parseBoolean(properties.getProperty(prefix+"use_combo_dsi"));
if (properties.getProperty(prefix+"use_lma_dsi")!=null) this.use_lma_dsi=Boolean.parseBoolean(properties.getProperty(prefix+"use_lma_dsi"));
if (properties.getProperty(prefix+"fpn_remove")!=null) this.fpn_remove=Boolean.parseBoolean(properties.getProperty(prefix+"fpn_remove"));
if (properties.getProperty(prefix+"fpn_max_offset")!=null) this.fpn_max_offset=Double.parseDouble(properties.getProperty(prefix+"fpn_max_offset"));
if (properties.getProperty(prefix+"fpn_radius")!=null) this.fpn_radius=Double.parseDouble(properties.getProperty(prefix+"fpn_radius"));
if (properties.getProperty(prefix+"fpn_ignore_border")!=null) this.fpn_ignore_border=Boolean.parseBoolean(properties.getProperty(prefix+"fpn_ignore_border"));
if (properties.getProperty(prefix+"mov_en")!=null) this.mov_en=Boolean.parseBoolean(properties.getProperty(prefix+"mov_en"));
if (properties.getProperty(prefix+"mov_sigma")!=null) this.mov_sigma=Double.parseDouble(properties.getProperty(prefix+"mov_sigma"));
if (properties.getProperty(prefix+"mov_max_std")!=null) this.mov_max_std=Double.parseDouble(properties.getProperty(prefix+"mov_max_std"));
if (properties.getProperty(prefix+"mov_thresh_rel")!=null) this.mov_thresh_rel=Double.parseDouble(properties.getProperty(prefix+"mov_thresh_rel"));
if (properties.getProperty(prefix+"mov_thresh_abs")!=null) this.mov_thresh_abs=Double.parseDouble(properties.getProperty(prefix+"mov_thresh_abs"));
if (properties.getProperty(prefix+"mov_clust_max")!=null) this.mov_clust_max=Double.parseDouble(properties.getProperty(prefix+"mov_clust_max"));
if (properties.getProperty(prefix+"mov_grow")!=null) this.mov_grow=Integer.parseInt(properties.getProperty(prefix+"mov_grow"));
if (properties.getProperty(prefix+"mov_show")!=null) this.mov_show=Boolean.parseBoolean(properties.getProperty(prefix+"mov_show"));
if (properties.getProperty(prefix+"mov_debug_level")!=null) this.mov_debug_level=Integer.parseInt(properties.getProperty(prefix+"mov_debug_level"));
if (properties.getProperty(prefix+"adjust_atr_0")!=null) this.adjust_atr[0]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_atr_0"));
if (properties.getProperty(prefix+"adjust_atr_1")!=null) this.adjust_atr[1]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_atr_1"));
if (properties.getProperty(prefix+"adjust_atr_2")!=null) this.adjust_atr[2]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_atr_2"));
if (properties.getProperty(prefix+"adjust_xyz_0")!=null) this.adjust_xyz[0]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_xyz_0"));
if (properties.getProperty(prefix+"adjust_xyz_1")!=null) this.adjust_xyz[1]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_xyz_1"));
if (properties.getProperty(prefix+"adjust_xyz_2")!=null) this.adjust_xyz[2]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_xyz_2"));
if (properties.getProperty(prefix+"exit_change_atr")!=null) this.exit_change_atr=Double.parseDouble(properties.getProperty(prefix+"exit_change_atr"));
if (properties.getProperty(prefix+"exit_change_xyz")!=null) this.exit_change_xyz=Double.parseDouble(properties.getProperty(prefix+"exit_change_xyz"));
if (properties.getProperty(prefix+"max_cycles")!=null) this.max_cycles=Integer.parseInt(properties.getProperty(prefix+"max_cycles"));
if (properties.getProperty(prefix+"max_LMA")!=null) this.max_LMA=Integer.parseInt(properties.getProperty(prefix+"max_LMA"));
if (properties.getProperty(prefix+"max_rms")!=null) this.max_rms=Double.parseDouble(properties.getProperty(prefix+"max_rms"));
if (properties.getProperty(prefix+"scene_is_ref_test")!=null) this.scene_is_ref_test=Boolean.parseBoolean(properties.getProperty(prefix+"scene_is_ref_test")); if (properties.getProperty(prefix+"scene_is_ref_test")!=null) this.scene_is_ref_test=Boolean.parseBoolean(properties.getProperty(prefix+"scene_is_ref_test"));
if (properties.getProperty(prefix+"render_ref")!=null) this.render_ref=Boolean.parseBoolean(properties.getProperty(prefix+"render_ref")); if (properties.getProperty(prefix+"render_ref")!=null) this.render_ref=Boolean.parseBoolean(properties.getProperty(prefix+"render_ref"));
if (properties.getProperty(prefix+"render_scene")!=null) this.render_scene=Boolean.parseBoolean(properties.getProperty(prefix+"render_scene")); if (properties.getProperty(prefix+"render_scene")!=null) this.render_scene=Boolean.parseBoolean(properties.getProperty(prefix+"render_scene"));
...@@ -1417,7 +1343,6 @@ public class IntersceneMatchParameters { ...@@ -1417,7 +1343,6 @@ public class IntersceneMatchParameters {
if (properties.getProperty(prefix+"test_ers")!=null) this.test_ers=Boolean.parseBoolean(properties.getProperty(prefix+"test_ers")); if (properties.getProperty(prefix+"test_ers")!=null) this.test_ers=Boolean.parseBoolean(properties.getProperty(prefix+"test_ers"));
if (properties.getProperty(prefix+"test_ers0")!=null) this.test_ers0=Integer.parseInt(properties.getProperty(prefix+"test_ers0")); if (properties.getProperty(prefix+"test_ers0")!=null) this.test_ers0=Integer.parseInt(properties.getProperty(prefix+"test_ers0"));
if (properties.getProperty(prefix+"test_ers1")!=null) this.test_ers1=Integer.parseInt(properties.getProperty(prefix+"test_ers1")); if (properties.getProperty(prefix+"test_ers1")!=null) this.test_ers1=Integer.parseInt(properties.getProperty(prefix+"test_ers1"));
if (properties.getProperty(prefix+"num_bottom")!=null) this.num_bottom=Integer.parseInt(properties.getProperty(prefix+"num_bottom")); if (properties.getProperty(prefix+"num_bottom")!=null) this.num_bottom=Integer.parseInt(properties.getProperty(prefix+"num_bottom"));
if (properties.getProperty(prefix+"num_passes")!=null) this.num_passes=Integer.parseInt(properties.getProperty(prefix+"num_passes")); if (properties.getProperty(prefix+"num_passes")!=null) this.num_passes=Integer.parseInt(properties.getProperty(prefix+"num_passes"));
if (properties.getProperty(prefix+"max_change")!=null) this.max_change=Double.parseDouble(properties.getProperty(prefix+"max_change")); if (properties.getProperty(prefix+"max_change")!=null) this.max_change=Double.parseDouble(properties.getProperty(prefix+"max_change"));
...@@ -1465,6 +1390,61 @@ public class IntersceneMatchParameters { ...@@ -1465,6 +1390,61 @@ public class IntersceneMatchParameters {
if (properties.getProperty(prefix+"min_strength")!=null) this.min_strength=Double.parseDouble(properties.getProperty(prefix+"min_strength")); if (properties.getProperty(prefix+"min_strength")!=null) this.min_strength=Double.parseDouble(properties.getProperty(prefix+"min_strength"));
if (properties.getProperty(prefix+"lowest_sky_row")!=null) this.lowest_sky_row=Integer.parseInt(properties.getProperty(prefix+"lowest_sky_row")); if (properties.getProperty(prefix+"lowest_sky_row")!=null) this.lowest_sky_row=Integer.parseInt(properties.getProperty(prefix+"lowest_sky_row"));
if (properties.getProperty(prefix+"margin")!=null) this.margin=Integer.parseInt(properties.getProperty(prefix+"margin"));
if (properties.getProperty(prefix+"sensor_mask_inter")!=null) this.sensor_mask_inter=Integer.parseInt(properties.getProperty(prefix+"sensor_mask_inter"));
if (properties.getProperty(prefix+"use_partial")!=null) this.use_partial=Boolean.parseBoolean(properties.getProperty(prefix+"use_partial"));
if (properties.getProperty(prefix+"run_poly")!=null) this.run_poly=Boolean.parseBoolean(properties.getProperty(prefix+"run_poly"));
if (properties.getProperty(prefix+"centroid_radius")!=null) this.centroid_radius=Double.parseDouble(properties.getProperty(prefix+"centroid_radius"));
if (properties.getProperty(prefix+"n_recenter")!=null) this.n_recenter=Integer.parseInt(properties.getProperty(prefix+"n_recenter"));
if (properties.getProperty(prefix+"min_ref_str")!=null) this.min_ref_str=Double.parseDouble(properties.getProperty(prefix+"min_ref_str"));
if (properties.getProperty(prefix+"td_weight")!=null) this.td_weight=Double.parseDouble(properties.getProperty(prefix+"td_weight"));
if (properties.getProperty(prefix+"pd_weight")!=null) this.pd_weight=Double.parseDouble(properties.getProperty(prefix+"pd_weight"));
if (properties.getProperty(prefix+"td_nopd_only")!=null) this.td_nopd_only=Boolean.parseBoolean(properties.getProperty(prefix+"td_nopd_only"));
if (properties.getProperty(prefix+"min_str")!=null) this.min_str=Double.parseDouble(properties.getProperty(prefix+"min_str"));
if (properties.getProperty(prefix+"min_str_fpn")!=null) this.min_str_fpn=Double.parseDouble(properties.getProperty(prefix+"min_str_fpn"));
if (properties.getProperty(prefix+"min_str_sum")!=null) this.min_str_sum=Double.parseDouble(properties.getProperty(prefix+"min_str_sum"));
if (properties.getProperty(prefix+"min_str_sum_fpn")!=null) this.min_str_sum_fpn=Double.parseDouble(properties.getProperty(prefix+"min_str_sum_fpn"));
if (properties.getProperty(prefix+"min_neibs")!=null) this.min_neibs=Integer.parseInt(properties.getProperty(prefix+"min_neibs"));
if (properties.getProperty(prefix+"weight_zero_neibs")!=null) this.weight_zero_neibs=Double.parseDouble(properties.getProperty(prefix+"weight_zero_neibs"));
if (properties.getProperty(prefix+"half_disparity")!=null) this.half_disparity=Double.parseDouble(properties.getProperty(prefix+"half_disparity"));
if (properties.getProperty(prefix+"half_avg_diff")!=null) this.half_avg_diff=Double.parseDouble(properties.getProperty(prefix+"half_avg_diff"));
if (properties.getProperty(prefix+"pix_step")!=null) this.pix_step=Integer.parseInt(properties.getProperty(prefix+"pix_step"));
if (properties.getProperty(prefix+"search_rad")!=null) this.search_rad=Integer.parseInt(properties.getProperty(prefix+"search_rad"));
if (properties.getProperty(prefix+"maybe_sum")!=null) this.maybe_sum=Double.parseDouble(properties.getProperty(prefix+"maybe_sum"));
if (properties.getProperty(prefix+"sure_sum")!=null) this.sure_sum=Double.parseDouble(properties.getProperty(prefix+"sure_sum"));
if (properties.getProperty(prefix+"maybe_avg")!=null) this.maybe_avg=Double.parseDouble(properties.getProperty(prefix+"maybe_avg"));
if (properties.getProperty(prefix+"sure_avg")!=null) this.sure_avg=Double.parseDouble(properties.getProperty(prefix+"sure_avg"));
if (properties.getProperty(prefix+"max_search_rms")!=null) this.max_search_rms=Double.parseDouble(properties.getProperty(prefix+"max_search_rms"));
if (properties.getProperty(prefix+"maybe_fom")!=null) this.maybe_fom=Double.parseDouble(properties.getProperty(prefix+"maybe_fom"));
if (properties.getProperty(prefix+"sure_fom")!=null) this.sure_fom=Double.parseDouble(properties.getProperty(prefix+"sure_fom"));
if (properties.getProperty(prefix+"use_combo_dsi")!=null) this.use_combo_dsi=Boolean.parseBoolean(properties.getProperty(prefix+"use_combo_dsi"));
if (properties.getProperty(prefix+"use_lma_dsi")!=null) this.use_lma_dsi=Boolean.parseBoolean(properties.getProperty(prefix+"use_lma_dsi"));
if (properties.getProperty(prefix+"fpn_remove")!=null) this.fpn_remove=Boolean.parseBoolean(properties.getProperty(prefix+"fpn_remove"));
if (properties.getProperty(prefix+"fpn_max_offset")!=null) this.fpn_max_offset=Double.parseDouble(properties.getProperty(prefix+"fpn_max_offset"));
if (properties.getProperty(prefix+"fpn_radius")!=null) this.fpn_radius=Double.parseDouble(properties.getProperty(prefix+"fpn_radius"));
if (properties.getProperty(prefix+"fpn_ignore_border")!=null) this.fpn_ignore_border=Boolean.parseBoolean(properties.getProperty(prefix+"fpn_ignore_border"));
if (properties.getProperty(prefix+"mov_en")!=null) this.mov_en=Boolean.parseBoolean(properties.getProperty(prefix+"mov_en"));
if (properties.getProperty(prefix+"mov_sigma")!=null) this.mov_sigma=Double.parseDouble(properties.getProperty(prefix+"mov_sigma"));
if (properties.getProperty(prefix+"mov_max_std")!=null) this.mov_max_std=Double.parseDouble(properties.getProperty(prefix+"mov_max_std"));
if (properties.getProperty(prefix+"mov_thresh_rel")!=null) this.mov_thresh_rel=Double.parseDouble(properties.getProperty(prefix+"mov_thresh_rel"));
if (properties.getProperty(prefix+"mov_thresh_abs")!=null) this.mov_thresh_abs=Double.parseDouble(properties.getProperty(prefix+"mov_thresh_abs"));
if (properties.getProperty(prefix+"mov_clust_max")!=null) this.mov_clust_max=Double.parseDouble(properties.getProperty(prefix+"mov_clust_max"));
if (properties.getProperty(prefix+"mov_grow")!=null) this.mov_grow=Integer.parseInt(properties.getProperty(prefix+"mov_grow"));
if (properties.getProperty(prefix+"mov_show")!=null) this.mov_show=Boolean.parseBoolean(properties.getProperty(prefix+"mov_show"));
if (properties.getProperty(prefix+"mov_debug_level")!=null) this.mov_debug_level=Integer.parseInt(properties.getProperty(prefix+"mov_debug_level"));
if (properties.getProperty(prefix+"adjust_atr_0")!=null) this.adjust_atr[0]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_atr_0"));
if (properties.getProperty(prefix+"adjust_atr_1")!=null) this.adjust_atr[1]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_atr_1"));
if (properties.getProperty(prefix+"adjust_atr_2")!=null) this.adjust_atr[2]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_atr_2"));
if (properties.getProperty(prefix+"adjust_xyz_0")!=null) this.adjust_xyz[0]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_xyz_0"));
if (properties.getProperty(prefix+"adjust_xyz_1")!=null) this.adjust_xyz[1]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_xyz_1"));
if (properties.getProperty(prefix+"adjust_xyz_2")!=null) this.adjust_xyz[2]=Boolean.parseBoolean(properties.getProperty(prefix+"adjust_xyz_2"));
if (properties.getProperty(prefix+"exit_change_atr")!=null) this.exit_change_atr=Double.parseDouble(properties.getProperty(prefix+"exit_change_atr"));
if (properties.getProperty(prefix+"exit_change_xyz")!=null) this.exit_change_xyz=Double.parseDouble(properties.getProperty(prefix+"exit_change_xyz"));
if (properties.getProperty(prefix+"max_cycles")!=null) this.max_cycles=Integer.parseInt(properties.getProperty(prefix+"max_cycles"));
if (properties.getProperty(prefix+"max_LMA")!=null) this.max_LMA=Integer.parseInt(properties.getProperty(prefix+"max_LMA"));
if (properties.getProperty(prefix+"max_rms")!=null) this.max_rms=Double.parseDouble(properties.getProperty(prefix+"max_rms"));
if (properties.getProperty(prefix+"eq_en")!=null) this.eq_en=Boolean.parseBoolean(properties.getProperty(prefix+"eq_en")); if (properties.getProperty(prefix+"eq_en")!=null) this.eq_en=Boolean.parseBoolean(properties.getProperty(prefix+"eq_en"));
if (properties.getProperty(prefix+"eq_stride_hor")!=null) this.eq_stride_hor=Integer.parseInt(properties.getProperty(prefix+"eq_stride_hor")); if (properties.getProperty(prefix+"eq_stride_hor")!=null) this.eq_stride_hor=Integer.parseInt(properties.getProperty(prefix+"eq_stride_hor"));
if (properties.getProperty(prefix+"eq_stride_vert")!=null) this.eq_stride_vert=Integer.parseInt(properties.getProperty(prefix+"eq_stride_vert")); if (properties.getProperty(prefix+"eq_stride_vert")!=null) this.eq_stride_vert=Integer.parseInt(properties.getProperty(prefix+"eq_stride_vert"));
...@@ -1477,8 +1457,6 @@ public class IntersceneMatchParameters { ...@@ -1477,8 +1457,6 @@ public class IntersceneMatchParameters {
if (properties.getProperty(prefix+"eq_weight_scale")!=null) this.eq_weight_scale=Double.parseDouble(properties.getProperty(prefix+"eq_weight_scale")); if (properties.getProperty(prefix+"eq_weight_scale")!=null) this.eq_weight_scale=Double.parseDouble(properties.getProperty(prefix+"eq_weight_scale"));
if (properties.getProperty(prefix+"eq_level")!=null) this.eq_level=Double.parseDouble(properties.getProperty(prefix+"eq_level")); if (properties.getProperty(prefix+"eq_level")!=null) this.eq_level=Double.parseDouble(properties.getProperty(prefix+"eq_level"));
if (properties.getProperty(prefix+"stereo_merge")!=null) this.stereo_merge=Boolean.parseBoolean(properties.getProperty(prefix+"stereo_merge")); if (properties.getProperty(prefix+"stereo_merge")!=null) this.stereo_merge=Boolean.parseBoolean(properties.getProperty(prefix+"stereo_merge"));
if (properties.getProperty(prefix+"stereo_gap")!=null) this.stereo_gap=Integer.parseInt(properties.getProperty(prefix+"stereo_gap")); if (properties.getProperty(prefix+"stereo_gap")!=null) this.stereo_gap=Integer.parseInt(properties.getProperty(prefix+"stereo_gap"));
if (properties.getProperty(prefix+"stereo_intereye")!=null) this.stereo_intereye=Double.parseDouble(properties.getProperty(prefix+"stereo_intereye")); if (properties.getProperty(prefix+"stereo_intereye")!=null) this.stereo_intereye=Double.parseDouble(properties.getProperty(prefix+"stereo_intereye"));
...@@ -1587,68 +1565,9 @@ public class IntersceneMatchParameters { ...@@ -1587,68 +1565,9 @@ public class IntersceneMatchParameters {
imp.range_min_strength = this.range_min_strength; imp.range_min_strength = this.range_min_strength;
imp.range_max = this.range_max; imp.range_max = this.range_max;
imp.margin = this.margin;
imp.sensor_mask_inter = this.sensor_mask_inter;
imp.use_partial = this.use_partial;
imp.run_poly = this.run_poly;
imp.centroid_radius = this.centroid_radius;
imp.n_recenter = this.n_recenter;
imp.min_ref_str = this.min_ref_str;
imp.td_weight = this.td_weight;
imp.pd_weight = this.pd_weight;
imp.td_nopd_only = this.td_nopd_only;
imp.min_str = this.min_str;
imp.min_str_fpn = this.min_str_fpn;
imp.min_str_sum = this.min_str_sum;
imp.min_str_sum_fpn = this.min_str_sum_fpn;
imp.min_neibs = this.min_neibs;
imp.weight_zero_neibs = this.weight_zero_neibs;
imp.half_disparity = this.half_disparity;
imp.half_avg_diff = this.half_avg_diff;
imp.pix_step = this.pix_step;
imp.search_rad = this.search_rad;
imp.maybe_sum = this.maybe_sum;
imp.sure_sum = this.sure_sum;
imp.maybe_avg = this.maybe_avg;
imp.sure_avg = this.sure_avg;
imp.max_search_rms = this.max_search_rms;
imp.maybe_fom = this.maybe_fom;
imp.sure_fom = this.sure_fom;
imp.use_combo_dsi = this.use_combo_dsi;
imp.use_lma_dsi = this.use_lma_dsi;
imp.fpn_remove = this.fpn_remove;
imp.fpn_max_offset = this.fpn_max_offset;
imp.fpn_radius = this.fpn_radius;
imp.fpn_ignore_border = this.fpn_ignore_border;
imp.mov_en = this.mov_en;
imp.mov_sigma = this.mov_sigma;
imp.mov_max_std = this.mov_max_std;
imp.mov_thresh_rel = this.mov_thresh_rel;
imp.mov_thresh_abs = this.mov_thresh_abs;
imp.mov_clust_max = this.mov_clust_max;
imp.mov_grow = this.mov_grow;
imp.mov_show = this.mov_show;
imp.mov_debug_level = this.mov_debug_level;
imp.adjust_atr[0] = this.adjust_atr[0];
imp.adjust_atr[1] = this.adjust_atr[1];
imp.adjust_atr[2] = this.adjust_atr[2];
imp.adjust_xyz[0] = this.adjust_xyz[0];
imp.adjust_xyz[1] = this.adjust_xyz[1];
imp.adjust_xyz[2] = this.adjust_xyz[2];
imp.exit_change_atr = this.exit_change_atr;
imp.exit_change_xyz = this.exit_change_xyz;
imp.max_cycles = this.max_cycles;
imp.max_LMA = this.max_LMA;
imp.max_rms = this.max_rms;
imp.scene_is_ref_test = this.scene_is_ref_test; imp.scene_is_ref_test = this.scene_is_ref_test;
imp.render_ref = this.render_ref; imp.render_ref = this.render_ref;
imp.render_scene = this.render_scene; imp.render_scene = this.render_scene;
...@@ -1708,6 +1627,60 @@ public class IntersceneMatchParameters { ...@@ -1708,6 +1627,60 @@ public class IntersceneMatchParameters {
imp.min_strength = this.min_strength; imp.min_strength = this.min_strength;
imp.lowest_sky_row = this.lowest_sky_row; imp.lowest_sky_row = this.lowest_sky_row;
imp.margin = this.margin;
imp.sensor_mask_inter = this.sensor_mask_inter;
imp.use_partial = this.use_partial;
imp.run_poly = this.run_poly;
imp.centroid_radius = this.centroid_radius;
imp.n_recenter = this.n_recenter;
imp.min_ref_str = this.min_ref_str;
imp.td_weight = this.td_weight;
imp.pd_weight = this.pd_weight;
imp.td_nopd_only = this.td_nopd_only;
imp.min_str = this.min_str;
imp.min_str_fpn = this.min_str_fpn;
imp.min_str_sum = this.min_str_sum;
imp.min_str_sum_fpn = this.min_str_sum_fpn;
imp.min_neibs = this.min_neibs;
imp.weight_zero_neibs = this.weight_zero_neibs;
imp.half_disparity = this.half_disparity;
imp.half_avg_diff = this.half_avg_diff;
imp.pix_step = this.pix_step;
imp.search_rad = this.search_rad;
imp.maybe_sum = this.maybe_sum;
imp.sure_sum = this.sure_sum;
imp.maybe_avg = this.maybe_avg;
imp.sure_avg = this.sure_avg;
imp.max_search_rms = this.max_search_rms;
imp.maybe_fom = this.maybe_fom;
imp.sure_fom = this.sure_fom;
imp.use_combo_dsi = this.use_combo_dsi;
imp.use_lma_dsi = this.use_lma_dsi;
imp.fpn_remove = this.fpn_remove;
imp.fpn_max_offset = this.fpn_max_offset;
imp.fpn_radius = this.fpn_radius;
imp.fpn_ignore_border = this.fpn_ignore_border;
imp.mov_en = this.mov_en;
imp.mov_sigma = this.mov_sigma;
imp.mov_max_std = this.mov_max_std;
imp.mov_thresh_rel = this.mov_thresh_rel;
imp.mov_thresh_abs = this.mov_thresh_abs;
imp.mov_clust_max = this.mov_clust_max;
imp.mov_grow = this.mov_grow;
imp.mov_show = this.mov_show;
imp.mov_debug_level = this.mov_debug_level;
imp.adjust_atr[0] = this.adjust_atr[0];
imp.adjust_atr[1] = this.adjust_atr[1];
imp.adjust_atr[2] = this.adjust_atr[2];
imp.adjust_xyz[0] = this.adjust_xyz[0];
imp.adjust_xyz[1] = this.adjust_xyz[1];
imp.adjust_xyz[2] = this.adjust_xyz[2];
imp.exit_change_atr = this.exit_change_atr;
imp.exit_change_xyz = this.exit_change_xyz;
imp.max_cycles = this.max_cycles;
imp.max_LMA = this.max_LMA;
imp.max_rms = this.max_rms;
imp.eq_en = this.eq_en; imp.eq_en = this.eq_en;
imp.eq_stride_hor = this.eq_stride_hor; imp.eq_stride_hor = this.eq_stride_hor;
imp.eq_stride_vert = this.eq_stride_vert; imp.eq_stride_vert = this.eq_stride_vert;
......
...@@ -4666,6 +4666,8 @@ public class OpticalFlow { ...@@ -4666,6 +4666,8 @@ public class OpticalFlow {
threadsMax, threadsMax,
debugLevel-2); debugLevel-2);
} }
} else {
System.out.println("Using photometric calibration from scene "+quadCLTs[ref_index].getPhotometricScene());
} }
if (test_ers) { // only debug feature if (test_ers) { // only debug feature
......
...@@ -2276,8 +2276,8 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -2276,8 +2276,8 @@ public class QuadCLT extends QuadCLTCPU {
System.out.println("processCLTQuadCorrs(): processing "+getTotalFiles(set_channels)+" files ("+set_channels.length+" file sets) finished at "+ System.out.println("processCLTQuadCorrs(): processing "+getTotalFiles(set_channels)+" files ("+set_channels.length+" file sets) finished at "+
IJ.d2s(0.000000001*(System.nanoTime()-this.startTime),3)+" sec, --- Free memory3="+Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")"); IJ.d2s(0.000000001*(System.nanoTime()-this.startTime),3)+" sec, --- Free memory3="+Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")");
} }
@Deprecated
public static boolean calibratePhotometric( public static boolean calibratePhotometric( // not used
CLTParameters clt_parameters, CLTParameters clt_parameters,
final QuadCLT ref_scene, // now - may be null - for testing if scene is rotated ref final QuadCLT ref_scene, // now - may be null - for testing if scene is rotated ref
final double min_strength, final double min_strength,
...@@ -2505,6 +2505,7 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -2505,6 +2505,7 @@ public class QuadCLT extends QuadCLTCPU {
double [] avg_pix = new double [len]; double [] avg_pix = new double [len];
double [] offsets = new double[dpixels.length]; double [] offsets = new double[dpixels.length];
double [] scales = new double[dpixels.length]; double [] scales = new double[dpixels.length];
double [] scales2 = new double[dpixels.length];
double s0 = 0.0; double s0 = 0.0;
double sx= 0.0; double sx= 0.0;
double sx2 = 0.0; double sx2 = 0.0;
...@@ -2512,7 +2513,17 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -2512,7 +2513,17 @@ public class QuadCLT extends QuadCLTCPU {
double [] sxy = new double[num_sens]; double [] sxy = new double[num_sens];
boolean [] good_pix = new boolean[len]; boolean [] good_pix = new boolean[len];
double [][] pa_coeff = new double[num_sens][]; double [][] pa_coeff = new double[num_sens][];
double min_abs_a = 1E-9;
Arrays.fill(good_pix, true); Arrays.fill(good_pix, true);
double [] offs_old = ref_scene.getLwirOffsets();
double [] scales_old = ref_scene.getLwirScales();
double [] scales2_old = ref_scene.getLwirScales2();
double [] offs_new = new double [num_sens];
double [] scales_new = new double [num_sens];
double [] scales2_new = new double [num_sens];
for (int nref = 0; nref < num_refines; nref++) { for (int nref = 0; nref < num_refines; nref++) {
Arrays.fill(avg_pix, 0.0); Arrays.fill(avg_pix, 0.0);
int num_good = 0; int num_good = 0;
...@@ -2527,77 +2538,74 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -2527,77 +2538,74 @@ public class QuadCLT extends QuadCLTCPU {
} }
} }
double [][] pa_data = new double [num_good][2]; double [][] pa_data = new double [num_good][2];
double [][] raw = new double [num_sens][len];
for (int nsens = 0; nsens < num_sens; nsens++) { for (int nsens = 0; nsens < num_sens; nsens++) {
Arrays.fill(raw[nsens],Double.NaN); // debug only
int indx = 0; int indx = 0;
for (int i = 0; i < len; i++) if (good_pix[i]){ for (int i = 0; i < len; i++) if (good_pix[i]){
pa_data[indx][0] = dpixels[nsens][i]; double A0 = scales2_old[nsens];
double B0 = scales_old[nsens];
double C0 = offs_old[nsens];
double a = A0;
double b = (B0 - 2 * C0 * A0);
double c = (C0*C0*A0 -C0 * B0 - dpixels[nsens][i]);
double p = -c/b;
if (Math.abs(a) >= min_abs_a) {
p= (-b + Math.sqrt(b*b - 4 * a * c))/(2 * a);
}
raw[nsens][i] = p;
pa_data[indx][0] = p; // dpixels[nsens][i];
pa_data[indx][1] = avg_pix[i]; pa_data[indx][1] = avg_pix[i];
indx++; indx++;
} }
// quadratic // quadratic
pa_coeff[nsens] =(new PolynomialApproximation(0)).polynomialApproximation1d(pa_data, quadratic ? 2 : 1); pa_coeff[nsens] =(new PolynomialApproximation(0)).polynomialApproximation1d(pa_data, quadratic ? 2 : 1);
double a = pa_coeff[nsens][2];
double b = pa_coeff[nsens][1];
double c = pa_coeff[nsens][0];
double A = a;
double C = -c/b;
if (Math.abs(a) >= min_abs_a) {
C = (-b + Math.sqrt(b*b - 4*a*c))/(2 * a);
} }
double B = 2 * C * a + b;
scales2_new[nsens] = A;
scales_new [nsens] = B;
offs_new[nsens] = C;
}
if (debug) { if (debug) {
System.out.println("calibratePhotometric() nref="+nref); System.out.println("calibratePhotometric() nref="+nref);
/*
System.out.println(String.format("%3s %8s %8s %8s",
"chn"," c "," b ", " 1e6*a "));
for (int n = 0; n < num_sens; n++) { for (int n = 0; n < num_sens; n++) {
System.out.println(String.format("%2d: %8.4f %8.6f %8.6f", n,pa_coeff[n][0],pa_coeff[n][1], 1e6*pa_coeff[n][2])); System.out.println(String.format("%2d: %8.4f %8.6f %8.6f", n,pa_coeff[n][0],pa_coeff[n][1], 1e6*pa_coeff[n][2]));
} }
System.out.println(); System.out.println();
double [][] diffs = new double [num_sens][len]; */
for (int n = 0; n < num_sens; n++) { System.out.println(String.format("%3s %10s %8s %8s %10s %8s %8s",
Arrays.fill(diffs[n], Double.NaN); // "chn"," c "," b ", " 1e6*a "));
} "chn"," offs0 ","scale0 ", "scale20"," offs "," scale ", " scale2"));
for (int i = 0; i < len; i++) if (good_pix[i]) { // if (!Double.isNaN(avg_pix[i])){
for (int n = 0; n < num_sens; n++) { for (int n = 0; n < num_sens; n++) {
// diffs[n][i] = dpixels[n][i] - (scales[n] * avg_pix[i] + offsets[n]); System.out.println(String.format("%2d: %10.4f %8.5f %8.5f %10.4f %8.5f %8.5f",
diffs[n][i] = -(avg_pix[i] - pa_coeff[n][2] * dpixels[n][i] * dpixels[n][i] - pa_coeff[n][1] * dpixels[n][i] - pa_coeff[n][0]); n,offs_old[n],scales_old[n], 1e6*scales2_old[n],
} offs_new[n],scales_new[n], 1e6*scales2_new[n]));
}
(new ShowDoubleFloatArrays()).showArrays( // out of boundary 15
diffs,
width,
height,
true,
"photometric-quad-err"+nref);
} }
System.out.println();
Arrays.fill(offsets,0.0);
Arrays.fill(scales,0.0);
s0 = 0.0;
sx= 0.0;
sx2 = 0.0;
Arrays.fill(sy,0.0);
Arrays.fill(sxy,0.0);
for (int i = 0; i < len; i++) if (good_pix[i]) { // !Double.isNaN(avg_pix[i])){
s0 += 1.0;
sx += avg_pix[i];
sx2 += avg_pix[i] * avg_pix[i];
for (int n = 0; n < num_sens; n++) {
sy[n] += dpixels[n][i];
sxy[n] += dpixels[n][i] * avg_pix[i];
}
}
for (int n = 0; n < num_sens; n++) {
double d = s0 * sx2 + sx * sy[n];
scales[n] = (sxy[n] * s0 + sy[n] * sy[n]) / d;
offsets[n] = (sy[n] * sx2 -sxy[n]*sx) / d;
}
if (debug) {
System.out.println("calibratePhotometric() nref="+nref);
for (int n = 0; n < num_sens; n++) {
System.out.println(String.format("%2d: %8.4f %8.6f", n,offsets[n],scales[n]));
}
System.out.println();
double [][] diffs = new double [num_sens][len]; double [][] diffs = new double [num_sens][len];
for (int n = 0; n < num_sens; n++) { for (int n = 0; n < num_sens; n++) {
Arrays.fill(diffs[n], Double.NaN); Arrays.fill(diffs[n], Double.NaN);
} }
for (int i = 0; i < len; i++) if (good_pix[i]) { // if (!Double.isNaN(avg_pix[i])){ for (int i = 0; i < len; i++) if (good_pix[i]) { // if (!Double.isNaN(avg_pix[i])){
for (int n = 0; n < num_sens; n++) { for (int n = 0; n < num_sens; n++) {
diffs[n][i] = dpixels[n][i] - (scales[n] * avg_pix[i] + offsets[n]); double poffs = raw[n][i] - offs_new[n];
diffs[n][i] = -(avg_pix[i] -
(poffs * scales_new[n] + poffs*poffs*scales2_new[n]));
} }
} }
(new ShowDoubleFloatArrays()).showArrays( // out of boundary 15 (new ShowDoubleFloatArrays()).showArrays( // out of boundary 15
...@@ -2605,14 +2613,13 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -2605,14 +2613,13 @@ public class QuadCLT extends QuadCLTCPU {
width, width,
height, height,
true, true,
"photometric-err"+nref); "photometric-quad-err"+nref);
// dpix_orig[n] = dpixels[n].clone();
double [][] corrected = new double [num_sens][len]; double [][] corrected = new double [num_sens][len];
for (int n = 0; n < num_sens; n++) { for (int n = 0; n < num_sens; n++) {
Arrays.fill(corrected[n], Double.NaN); Arrays.fill(corrected[n], Double.NaN);
for (int i = 0; i < len; i++) if (!Double.isNaN(dpixels[n][i])){ for (int i = 0; i < len; i++) if (!Double.isNaN(dpixels[n][i])){
corrected[n][i] = (dpixels[n][i] - offsets[n])/scales[n]; double poffs = raw[n][i] - offs_new[n];
corrected[n][i] = (poffs * scales_new[n] + poffs*poffs*scales2_new[n]);
} }
} }
...@@ -2621,15 +2628,16 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -2621,15 +2628,16 @@ public class QuadCLT extends QuadCLTCPU {
width, width,
height, height,
true, true,
"photometric-corr"+nref); "photometric-quad-corr"+nref);
} }
//max_diff //max_diff
if (nref < (num_refines-1)) { if (nref < (num_refines-1)) {
for (int i = 0; i < len; i++) if (good_pix[i]) { // !Double.isNaN(avg_pix[i])){ for (int i = 0; i < len; i++) if (good_pix[i]) { // !Double.isNaN(avg_pix[i])){
for (int n = 0; n < num_sens; n++) { for (int n = 0; n < num_sens; n++) {
double diff = Math.abs(dpixels[n][i] - (scales[n] * avg_pix[i] + offsets[n])); double poffs = raw[n][i] - offs_new[n];
double diff = Math.abs(avg_pix[i] -
(poffs * scales_new[n] + poffs*poffs*scales2_new[n]));
if (diff > max_diff) { if (diff > max_diff) {
// dpixels[n][i] = Double.NaN;
good_pix[i] = false; good_pix[i] = false;
break; break;
} }
...@@ -2637,22 +2645,12 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -2637,22 +2645,12 @@ public class QuadCLT extends QuadCLTCPU {
} }
} }
} }
double [] offsets_old = ref_scene.getLwirOffsets();
double [] scales_old = ref_scene.getLwirScales();
double [] scales2_old = ref_scene.getLwirScales2();
double [] offsets_new = new double[num_sens];
double [] scales_new = new double[num_sens];
double [] scales2_new = new double[num_sens];
for (int n = 0; n < num_sens; n++) {
scales_new[n] = scales_old[n]/scales[n];
offsets_new[n] = offsets_old[n] + offsets[n] / scales_old[n];
}
System.out.println("calibratePhotometric() Updated calibration:"); System.out.println("calibratePhotometric() Updated calibration:");
for (int n = 0; n < num_sens; n++) { for (int n = 0; n < num_sens; n++) {
System.out.println(String.format("%2d: %8.4f %8.6f %8.6f", n,offsets_new[n],scales_new[n], scales2_new[n])); System.out.println(String.format("%2d: %10.4f %8.6f %8.6f", n,offs_new[n],scales_new[n], 1E6*scales2_new[n]));
} }
System.out.println(); System.out.println();
ref_scene.setLwirOffsets (offsets_new); ref_scene.setLwirOffsets (offs_new);
ref_scene.setLwirScales (scales_new); ref_scene.setLwirScales (scales_new);
ref_scene.setLwirScales2 (scales2_new); ref_scene.setLwirScales2 (scales2_new);
return true; return true;
......
...@@ -151,6 +151,7 @@ public class QuadCLTCPU { ...@@ -151,6 +151,7 @@ public class QuadCLTCPU {
boolean new_image_data = false; boolean new_image_data = false;
boolean [][] saturation_imp = null; // (near) saturated pixels or null boolean [][] saturation_imp = null; // (near) saturated pixels or null
boolean is_aux = false; boolean is_aux = false;
String photometric_scene = null;
double [] lwir_offsets = null; // per image subtracted values double [] lwir_offsets = null; // per image subtracted values
double [] lwir_scales = null; // per image scales double [] lwir_scales = null; // per image scales
double [] lwir_scales2 = null; // per image quadratic scales double [] lwir_scales2 = null; // per image quadratic scales
...@@ -264,6 +265,8 @@ public class QuadCLTCPU { ...@@ -264,6 +265,8 @@ public class QuadCLTCPU {
if (qParent.saturation_imp != null) this.saturation_imp = qParent.saturation_imp.clone(); // each camera will be re-written, not just modified, so shallow copy if (qParent.saturation_imp != null) this.saturation_imp = qParent.saturation_imp.clone(); // each camera will be re-written, not just modified, so shallow copy
this.is_aux = qParent.is_aux; this.is_aux = qParent.is_aux;
// this.is_mono = qParent.is_mono; // this.is_mono = qParent.is_mono;
this.photometric_scene = qParent.photometric_scene;
this.lwir_offsets = ErsCorrection.clone1d(qParent.lwir_offsets); this.lwir_offsets = ErsCorrection.clone1d(qParent.lwir_offsets);
this.lwir_scales = ErsCorrection.clone1d(qParent.lwir_scales); this.lwir_scales = ErsCorrection.clone1d(qParent.lwir_scales);
this.lwir_scales2 = ErsCorrection.clone1d(qParent.lwir_scales2); this.lwir_scales2 = ErsCorrection.clone1d(qParent.lwir_scales2);
...@@ -1807,13 +1810,20 @@ public class QuadCLTCPU { ...@@ -1807,13 +1810,20 @@ public class QuadCLTCPU {
} else { } else {
lwir_offset = Double.NaN; lwir_offset = Double.NaN;
} }
this.photometric_scene = getImageName();
}
public String getPhotometricScene() {
return this.photometric_scene;
} }
public void setLwirScales(double [] scales) { public void setLwirScales(double [] scales) {
lwir_scales = scales; // will need to update properties! lwir_scales = scales; // will need to update properties!
this.photometric_scene = getImageName();
} }
public void setLwirScales2(double [] scales2) { public void setLwirScales2(double [] scales2) {
lwir_scales2 = scales2; // will need to update properties! lwir_scales2 = scales2; // will need to update properties!
this.photometric_scene = getImageName();
} }
public double [] getColdHot() { // USED in lwir public double [] getColdHot() { // USED in lwir
...@@ -2018,7 +2028,9 @@ public class QuadCLTCPU { ...@@ -2018,7 +2028,9 @@ public class QuadCLTCPU {
properties.setProperty(prefix+"lwir_scales2", properties.setProperty(prefix+"lwir_scales2",
IntersceneMatchParameters.doublesToString(this.lwir_scales2)); IntersceneMatchParameters.doublesToString(this.lwir_scales2));
} }
if (this.photometric_scene != null) {
properties.setProperty(prefix+"photometric_scene", this.photometric_scene);
}
} }
...@@ -2066,6 +2078,10 @@ public class QuadCLTCPU { ...@@ -2066,6 +2078,10 @@ public class QuadCLTCPU {
properties.setProperty(this_prefix+"lwir_scales2", properties.setProperty(this_prefix+"lwir_scales2",
IntersceneMatchParameters.doublesToString(this.lwir_scales2)); IntersceneMatchParameters.doublesToString(this.lwir_scales2));
} }
if (other_properties.getProperty(other_prefix+"photometric_scene")!=null) {
this.photometric_scene= (String) other_properties.getProperty(other_prefix+"photometric_scene");
properties.setProperty(this_prefix+"photometric_scene", this.photometric_scene);
}
/* /*
...@@ -2190,9 +2206,9 @@ public class QuadCLTCPU { ...@@ -2190,9 +2206,9 @@ public class QuadCLTCPU {
this.lwir_scales2= IntersceneMatchParameters.StringToDoubles( this.lwir_scales2= IntersceneMatchParameters.StringToDoubles(
properties.getProperty(prefix+"lwir_scales2"),0); properties.getProperty(prefix+"lwir_scales2"),0);
} }
if (properties.getProperty(prefix+"photometric_scene")!=null) {
this.photometric_scene= (String) properties.getProperty(prefix+"photometric_scene");
}
} }
public void setKernelImageFile(ImagePlus img_kernels){ // not used in lwir public void setKernelImageFile(ImagePlus img_kernels){ // not used in lwir
......
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