Commit a86749dc authored by Andrey Filippov's avatar Andrey Filippov

Debugging for low-contrast targets

parent 7b258199
...@@ -263,8 +263,9 @@ public class CuasMotion { ...@@ -263,8 +263,9 @@ public class CuasMotion {
private final GPUTileProcessor gpuTileProcessor; private final GPUTileProcessor gpuTileProcessor;
private CLTParameters clt_parameters=null; private CLTParameters clt_parameters=null;
private QuadCLT parentCLT = null; private QuadCLT parentCLT = null;
private double [] noise_map = null; private double [] noise_map = null;
private double [] noise_map8 = null;
private int debugLevel = 0; private int debugLevel = 0;
private GpuQuad gpuQuad = null; private GpuQuad gpuQuad = null;
private ImageDtt image_dtt = null; private ImageDtt image_dtt = null;
...@@ -285,6 +286,10 @@ public class CuasMotion { ...@@ -285,6 +286,10 @@ public class CuasMotion {
public double [] getNoiseMap () { public double [] getNoiseMap () {
return noise_map; return noise_map;
} }
public double [] getNoiseMap8 () {
return noise_map8;
}
public UasLogReader getUasLogReader() { public UasLogReader getUasLogReader() {
return uasLogReader; return uasLogReader;
...@@ -413,7 +418,7 @@ public class CuasMotion { ...@@ -413,7 +418,7 @@ public class CuasMotion {
gpu_max_height = tilesY * GPUTileProcessor.DTT_SIZE; gpu_max_height = tilesY * GPUTileProcessor.DTT_SIZE;
corr_offset = clt_parameters.imp.cuas_corr_offset; corr_offset = clt_parameters.imp.cuas_corr_offset;
corr_pairs = clt_parameters.imp.cuas_corr_pairs; corr_pairs = clt_parameters.imp.cuas_corr_pairs;
double scale_window = clt_parameters.imp.cuas_scale_wnd = 2.0; //; When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15) double scale_window = clt_parameters.imp.cuas_scale_wnd; // = 2.0; //; When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15)
// int start_frame = 0; // int start_frame = 0;
int num_corr_samples = (scene_titles.length - getSeqLength() - start_frame) / getCorrInc(); int num_corr_samples = (scene_titles.length - getSeqLength() - start_frame) / getCorrInc();
...@@ -511,6 +516,9 @@ public class CuasMotion { ...@@ -511,6 +516,9 @@ public class CuasMotion {
noise_map = getNoiseMap( noise_map = getNoiseMap(
scale_window, // final double scale_window, // 1.0->8, 2.0 - 16. scale_window, // final double scale_window, // 1.0->8, 2.0 - 16.
fpixels_avg); // final float [] fpixels_avg) fpixels_avg); // final float [] fpixels_avg)
noise_map8 = getNoiseMap(
1.0, // final double scale_window, // 1.0->8, 2.0 - 16.
fpixels_avg); // final float [] fpixels_avg)
return; return;
} }
...@@ -1748,7 +1756,7 @@ public class CuasMotion { ...@@ -1748,7 +1756,7 @@ public class CuasMotion {
return effective_strength; return effective_strength;
} }
/*
private static void setBadHorizon( private static void setBadHorizon(
final double [][][] target_sequence, final double [][][] target_sequence,
final double horizon_y, final double horizon_y,
...@@ -1778,6 +1786,45 @@ public class CuasMotion { ...@@ -1778,6 +1786,45 @@ public class CuasMotion {
ImageDtt.startAndJoin(threads); ImageDtt.startAndJoin(threads);
} }
} }
*/
private static void setBadHorizon(
final double [][][] target_sequence,
final double horizon_y, // <0 - do not filter by horizon
final double [] noise8, // null - do not filter by noise
final double noise_max,
final int tilesX){
final int num_seq = target_sequence.length;
final int num_tiles = target_sequence[0].length;
final int tilesY = num_tiles/tilesX;
final int ihorizon = (horizon_y > 0) ?( (int) Math.ceil(horizon_y/GPUTileProcessor.DTT_SIZE)) : -1; // tiles with tileY >= ihorizon are removed
final int ntile_horizon = (ihorizon > 0) ? (ihorizon * tilesX) : num_tiles;
if ((ihorizon > 0) || (noise8 != null)){
final Thread[] threads = ImageDtt.newThreadArray();
final AtomicInteger ai = new AtomicInteger(0);
for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() {
public void run() {
for (int nSeq = ai.getAndIncrement(); nSeq < num_seq; nSeq = ai.getAndIncrement()) {
if (noise8 != null) {
for (int ntile = 0; ntile < ntile_horizon; ntile++) if (noise8[ntile] > noise_max) {
target_sequence[nSeq][ntile] = null;
}
}
if (ihorizon > 0) {
for (int tileY = ihorizon; tileY < tilesY; tileY++) {
int ntile = tileY*tilesX;
for (int tileX = 0; tileX < tilesX; tileX++) {
target_sequence[nSeq][ntile++] = null;
}
}
}
}
}
};
}
ImageDtt.startAndJoin(threads);
}
}
private static double getEffectiveStrengthMV( private static double getEffectiveStrengthMV(
...@@ -2026,8 +2073,8 @@ public class CuasMotion { ...@@ -2026,8 +2073,8 @@ public class CuasMotion {
final int corr_pairs_ref = (int) Math.round(2 * half_accum_range * recalc_mv_boost); final int corr_pairs_ref = (int) Math.round(2 * half_accum_range * recalc_mv_boost);
// Hard-coded debug selectors: set >= 0 to enable per-scan/per-tile visualisation // Hard-coded debug selectors: set >= 0 to enable per-scan/per-tile visualisation
final int dbg_nseq = 41; // 157; // -(116); // 57; // 20; // -1; final int dbg_nseq = 40; // 41; // 157; // -(116); // 57; // 20; // -1;
final int dbg_tile = 50+38*80; // 55+38*80; // -(17 + 33*80); // 48+32*80; // 50+38*80; // -1; final int dbg_tile = 52+38*80; // 50+38*80; // 55+38*80; // -(17 + 33*80); // 48+32*80; // 50+38*80; // -1;
// Pre-compute integer-pixel raised-cosine mask kernel once (shared across all nseq) // Pre-compute integer-pixel raised-cosine mask kernel once (shared across all nseq)
final int r1i = (int) Math.ceil(recalc_mv_r1); final int r1i = (int) Math.ceil(recalc_mv_r1);
...@@ -2206,7 +2253,7 @@ public class CuasMotion { ...@@ -2206,7 +2253,7 @@ public class CuasMotion {
if (target == null || Double.isNaN(target[CuasMotionLMA.RSLT_X])) continue; if (target == null || Double.isNaN(target[CuasMotionLMA.RSLT_X])) continue;
if (vector_field[ntile] == null) continue; if (vector_field[ntile] == null) continue;
if (ntile == dbg_tile && debugLevel >= 0) { if (ntile == dbg_tile && debugLevel >= 0) {
System.out.printf("refineMotionVectors(): nseq=%3d ntile=%4d before: VX=%9.4f VY=%9.4f delta: dVX=%8.4f dVY=%8.4f% after: VX1=%9.4f VY1=%9.4f%", System.out.printf("refineMotionVectors(): nseq=%3d ntile=%4d before: VX=%9.4f VY=%9.4f delta: dVX=%8.4f dVY=%8.4f after: VX1=%9.4f VY1=%9.4f\n",
nseq, ntile, nseq, ntile,
target[CuasMotionLMA.RSLT_VX], target[CuasMotionLMA.RSLT_VY], target[CuasMotionLMA.RSLT_VX], target[CuasMotionLMA.RSLT_VY],
vector_field[ntile][INDX_VX], vector_field[ntile][INDX_VY], vector_field[ntile][INDX_VX], vector_field[ntile][INDX_VY],
...@@ -2218,7 +2265,7 @@ public class CuasMotion { ...@@ -2218,7 +2265,7 @@ public class CuasMotion {
} }
} }
// Debug: CORR2D overview — one slice per keyframe, same layout as *CORR2D.tiff // Debug: CORR2D overview — one slice per keyframe, same layout as *CORR2D.tiff
if (show_dbg && corr2d_ref != null) { if (show_dbg && (corr2d_ref != null) && (dbg_iter_index<= max_index_dbg)) {
final int corr_size = 2 * GPUTileProcessor.DTT_SIZE - 1; // 15 final int corr_size = 2 * GPUTileProcessor.DTT_SIZE - 1; // 15
String[] slice_titles_ref = new String[targets_nonoverlap.length]; String[] slice_titles_ref = new String[targets_nonoverlap.length];
for (int i = 0; i < targets_nonoverlap.length; i++) { for (int i = 0; i < targets_nonoverlap.length; i++) {
...@@ -2635,21 +2682,7 @@ public class CuasMotion { ...@@ -2635,21 +2682,7 @@ public class CuasMotion {
// final int erase = 1; //NaN // final int erase = 1; //NaN
for (int nseq = 0; nseq < target_sequence.length; nseq++) { for (int nseq = 0; nseq < target_sequence.length; nseq++) {
/*
// from getTargetsFromCorr2d()
int corr_pairs_scaled = (int) Math.round(corr_pairs*boost_pairs);
if (boost_pairs > 1) {
frame0 -= (int) Math.round((corr_pairs * (boost_pairs - 1))/ 2);
}
int frame1 = frame0 + corr_offset;
// int frame_cent = frame0 + seq_length/2; // debug only
int frame_cent = frame0 + corr_offset/2; // debug only
String suffix_param = "-"+frame_cent+"-"+corr_offset+"-"+corr_pairs;
String dbg_suffix = (title != null) ? (title+suffix_param) : null;
*/
int frame_center = frame0 + nseq * frame_step; int frame_center = frame0 + nseq * frame_step;
boolean fits = (frame_center >= half_range_boosted) && (frame_center < (fpixels.length - half_range_boosted)); boolean fits = (frame_center >= half_range_boosted) && (frame_center < (fpixels.length - half_range_boosted));
double [] window = fits? window_full: window_full.clone(); double [] window = fits? window_full: window_full.clone();
if (!fits) { if (!fits) {
...@@ -7213,16 +7246,19 @@ public class CuasMotion { ...@@ -7213,16 +7246,19 @@ public class CuasMotion {
boolean smooth = clt_parameters.imp.cuas_smooth; // true; boolean smooth = clt_parameters.imp.cuas_smooth; // true;
boolean half_step = clt_parameters.imp.cuas_half_step; // true; boolean half_step = clt_parameters.imp.cuas_half_step; // true;
double [][] target_frac = new double [clt_parameters.imp.cuas_target_frac.length][2]; double [][] target_frac = new double [clt_parameters.imp.cuas_target_frac.length][2];
double noisemax8 = clt_parameters. imp.cuas_noisemax8;
double target_horizon= clt_parameters.imp.cuas_horizon; double target_horizon= clt_parameters.imp.cuas_horizon;
double input_range = clt_parameters.imp.cuas_input_range; // 5; double input_range = clt_parameters.imp.cuas_input_range; // 5;
boolean corr2d_save_show = clt_parameters.imp.cuas_2d_save_show; //true; boolean corr2d_save_show = clt_parameters.imp.cuas_2d_save_show; //true;
boolean intermed_low = clt_parameters.imp.cuas_intermed_low; //true; boolean intermed_low = clt_parameters.imp.cuas_intermed_low; //true;
boolean intermed_high = clt_parameters.imp.cuas_intermed_high; //true; boolean intermed_high = clt_parameters.imp.cuas_intermed_high; //true;
boolean cuas_gaussian_ra = clt_parameters.imp.cuas_gaussian_ra; // use gaussian temporal Gaussian instead of running average boolean cuas_gaussian_ra = clt_parameters.imp.cuas_gaussian_ra; // use gaussian temporal Gaussian instead of running average
// slow_mode // slow_mode
int slow_scale_samples = slow_mode ? clt_parameters.imp.cuas_mul_samples : 1; // multiply number of samples int slow_scale_samples = slow_mode ? clt_parameters.imp.cuas_mul_samples : 1; // multiply number of samples
int slow_scale_offset = slow_mode ? clt_parameters.imp.cuas_mul_offset : 1; // multiply offset int slow_scale_offset = slow_mode ? clt_parameters.imp.cuas_mul_offset : 1; // multiply offset
for (int i = 0; i < target_frac.length; i++) { for (int i = 0; i < target_frac.length; i++) {
if (clt_parameters.imp.cuas_target_frac[i].length >= 2) { if (clt_parameters.imp.cuas_target_frac[i].length >= 2) {
target_frac[i][0] = clt_parameters.imp.cuas_target_frac[i][0]; target_frac[i][0] = clt_parameters.imp.cuas_target_frac[i][0];
...@@ -7349,40 +7385,42 @@ public class CuasMotion { ...@@ -7349,40 +7385,42 @@ public class CuasMotion {
parentCLT.saveImagePlusInModelDirectory(imp_initial_boosted); parentCLT.saveImagePlusInModelDirectory(imp_initial_boosted);
} }
// combine motions // combine motions
combineSlowBoosted( combineSlowBoosted(
target_sequence, // final double [][][] target_sequence, target_sequence, // final double [][][] target_sequence,
target_sequence_boost, // final double [][][] target_boosted, target_sequence_boost, // final double [][][] target_boosted,
boost_pairs, // final double boost_slow, // 4.0; boost_pairs, // final double boost_slow, // 4.0;
boost_mv_lim, // final double boost_mv_lim, 1.5-1.8 boost_mv_lim, // final double boost_mv_lim, 1.5-1.8
boost_mstr, // final double boost_mstr, boost_mstr, // final double boost_mstr,
boost_xstr, // final double boost_xstr, // 0.2 boost_xstr, // final double boost_xstr, // 0.2
debugLevel); // final int debugLevel) debugLevel); // final int debugLevel)
if (corr2d_save_show) { // may be read to re-process with vector field if (corr2d_save_show) { // may be read to re-process with vector field
int corr_size = 2 * GPUTileProcessor.DTT_SIZE -1; int corr_size = 2 * GPUTileProcessor.DTT_SIZE -1;
double [][] dbg_2d_corrs_boosted = ImageDtt.corr_partial_dbg( // not used in lwir double [][] dbg_2d_corrs_boosted = ImageDtt.corr_partial_dbg( // not used in lwir
corr2d_boosted, // final double [][][] corr_data, // [layer][tile][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate corr2d_boosted, // final double [][][] corr_data, // [layer][tile][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
cuasMotion.tilesX, // final int tilesX, cuasMotion.tilesX, // final int tilesX,
corr_size, //final int corr_size, // 15 corr_size, //final int corr_size, // 15
clt_parameters.corr_border_contrast, // final double border_contrast, clt_parameters.corr_border_contrast, // final double border_contrast,
debugLevel); // final int globalDebugLevel) debugLevel); // final int globalDebugLevel)
ImagePlus imp_corr2d = ShowDoubleFloatArrays.makeArrays( ImagePlus imp_corr2d = ShowDoubleFloatArrays.makeArrays(
dbg_2d_corrs_boosted, // double[][] pixels, dbg_2d_corrs_boosted, // double[][] pixels,
cuasMotion.tilesX * (corr_size + 1), cuasMotion.tilesX * (corr_size + 1),
cuasMotion.tilesY * (corr_size + 1), cuasMotion.tilesY * (corr_size + 1),
model_prefix+"-CORR2D-BOOSTED"+boost_pairs, // -OFFS"+corr_offset+"-PAIRS"+corr_pairs, // String title, model_prefix+"-CORR2D-BOOSTED"+boost_pairs, // -OFFS"+corr_offset+"-PAIRS"+corr_pairs, // String title,
slice_titles); slice_titles);
if (!batch_mode) { if (!batch_mode) {
imp_corr2d.show(); imp_corr2d.show();
}
parentCLT.saveImagePlusInModelDirectory(imp_corr2d); // ImagePlus imp)
} }
parentCLT.saveImagePlusInModelDirectory(imp_corr2d); // ImagePlus imp)
}
} }
setBadHorizon( setBadHorizon(
target_sequence, // final double [][][] target_sequence, target_sequence, // final double [][][] target_sequence,
target_horizon, // final double horizon_y, target_horizon, // final double horizon_y,
cuasMotion.getNoiseMap8(), // final double [] noise8, // null - do not filter by noise
noisemax8, // final double noise_max,
cuasMotion.tilesX); // final int tilesX) cuasMotion.tilesX); // final int tilesX)
// After this target_sequence should not be null-ed, failure status should only change from NaN to 0/>0 values // After this target_sequence should not be null-ed, failure status should only change from NaN to 0/>0 values
...@@ -7599,7 +7637,7 @@ public class CuasMotion { ...@@ -7599,7 +7637,7 @@ public class CuasMotion {
boolean fail_mismatch = clt_parameters. imp.cuas_fail_mismatch; // Fail on high mismatch early (when calculating scores); boolean fail_mismatch = clt_parameters. imp.cuas_fail_mismatch; // Fail on high mismatch early (when calculating scores);
double offcenter = clt_parameters. imp.cuas_offcenter; double offcenter = clt_parameters. imp.cuas_offcenter;
double noisemax = clt_parameters. imp.cuas_noisemax; double noisemax = clt_parameters. imp.cuas_noisemax;
double noisemax8 = clt_parameters. imp.cuas_noisemax8;
double target_horizon= clt_parameters.imp.cuas_horizon; double target_horizon= clt_parameters.imp.cuas_horizon;
// Handling overall target scores // Handling overall target scores
...@@ -8049,6 +8087,14 @@ public class CuasMotion { ...@@ -8049,6 +8087,14 @@ public class CuasMotion {
double recalc_mv_boost = clt_parameters.imp.cuas_recalc_mv_boost; double recalc_mv_boost = clt_parameters.imp.cuas_recalc_mv_boost;
double recalc_mv_r0 = clt_parameters.imp.cuas_recalc_mv_r0; double recalc_mv_r0 = clt_parameters.imp.cuas_recalc_mv_r0;
double recalc_mv_r1 = clt_parameters.imp.cuas_recalc_mv_r1; double recalc_mv_r1 = clt_parameters.imp.cuas_recalc_mv_r1;
lma_rrms = clt_parameters.imp.cuas_lma_rrms2; // = 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
lma_mina = clt_parameters.imp.cuas_lma_mina2; // = 1.0; // Minimal A (amplitude)
if (debugLevel > -4) {
System.out.println("Updated for the centered pass lma_rrms="+lma_rrms);
System.out.println("Updated for the centered pass lma_mina="+lma_mina);
}
// second pass, using non-centered targets // second pass, using non-centered targets
int niter_lim = niter+ num_cycles; int niter_lim = niter+ num_cycles;
int iter_show1 = iter_show + niter; int iter_show1 = iter_show + niter;
...@@ -8061,7 +8107,7 @@ public class CuasMotion { ...@@ -8061,7 +8107,7 @@ public class CuasMotion {
cuasMotion.tilesX); // int tilesX) { cuasMotion.tilesX); // int tilesX) {
parentCLT.saveImagePlusInModelDirectory(imp_mv_strength); parentCLT.saveImagePlusInModelDirectory(imp_mv_strength);
} }
int niter0 = niter; // for debugging, so (niter - niter0) will start from 0
for (; niter < niter_lim; niter++) { for (; niter < niter_lim; niter++) {
boolean good_only= false; boolean good_only= false;
boolean show_empty = true; // false; // show scenes with no (valid) targets boolean show_empty = true; // false; // show scenes with no (valid) targets
...@@ -8178,8 +8224,8 @@ public class CuasMotion { ...@@ -8178,8 +8224,8 @@ public class CuasMotion {
half_accum_range, // int half_accum_range, half_accum_range, // int half_accum_range,
smooth, // boolean smooth, smooth, // boolean smooth,
corr_offset, // int corr_offset, corr_offset, // int corr_offset,
niter, // int dbg_iter_index, niter - niter0, // int dbg_iter_index,
debugLevel); // int debugLevel) -1); // debugLevel); // int debugLevel)
} }
double [][][] extended_scan = extendMotionScan( double [][][] extended_scan = extendMotionScan(
targets_nonoverlap, // final double [][][] motion_scan, targets_nonoverlap, // final double [][][] motion_scan,
...@@ -8420,7 +8466,7 @@ public class CuasMotion { ...@@ -8420,7 +8466,7 @@ public class CuasMotion {
if (intermed_low) { // targets_good now has if (intermed_low) { // targets_good now has
ImagePlus imp_good = showTargetSequence( ImagePlus imp_good = showTargetSequence(// tried 80*64*243815 slices
target_sequence_multi, // double [][][] vector_fields_sequence, target_sequence_multi, // double [][][] vector_fields_sequence,
slice_titles, // String [] titles, // all slices*frames titles or just slice titles or null slice_titles, // String [] titles, // all slices*frames titles or just slice titles or null
model_prefix+"-ROUND_TWO",// String title, model_prefix+"-ROUND_TWO",// String title,
......
...@@ -255,7 +255,12 @@ public class CuasRanging { ...@@ -255,7 +255,12 @@ public class CuasRanging {
cuasMotion.getTilesY(), // int height, cuasMotion.getTilesY(), // int height,
center_CLT.getImageName()+"-NOISE-MAP"); //String [] titles) center_CLT.getImageName()+"-NOISE-MAP"); //String [] titles)
center_CLT.saveImagePlusInModelDirectory(imp_noise_map); // ImagePlus imp) center_CLT.saveImagePlusInModelDirectory(imp_noise_map); // ImagePlus imp)
ImagePlus imp_noise_map8 = ShowDoubleFloatArrays.makeArrays(
cuasMotion.getNoiseMap8(), // float[][] pixels,
cuasMotion.getTilesX(), // int width,
cuasMotion.getTilesY(), // int height,
center_CLT.getImageName()+"-NOISE-MAP8"); //String [] titles)
center_CLT.saveImagePlusInModelDirectory(imp_noise_map8); // ImagePlus imp)
} }
......
...@@ -872,8 +872,12 @@ min_str_neib_fpn 0.35 ...@@ -872,8 +872,12 @@ min_str_neib_fpn 0.35
// CUAS Motion LMA filter parameters // CUAS Motion LMA filter parameters
public double cuas_lma_rms = 1.5; // 1.5; // Maximal RMS (should always match, regardless if A) public double cuas_lma_rms = 1.5; // 1.5; // Maximal RMS (should always match, regardless if A)
public double cuas_lma_arms = 0.37; // 0.06; // Maximal absolute RMS (should match one of cuas_lma_arms OR cuas_lma_rrms (0.484) public double cuas_lma_arms = 0.37; // 0.06; // Maximal absolute RMS (should match one of cuas_lma_arms OR cuas_lma_rrms (0.484)
public double cuas_lma_rrms = 0.28; // 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A) public double cuas_lma_rrms = 0.5; // 0.35; // 0.28; // 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
public double cuas_lma_mina = 0.4; // 1.0; // Minimal A (amplitude) = 1.0 (< 2.0) public double cuas_lma_rrms2 = 0.35; // 0.28; // 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
public double cuas_lma_mina = 0.25; // 0.4; // 1.0; // Minimal A (amplitude) = 1.0 (< 2.0)
public double cuas_lma_mina2 = 0.4; // 1.0; // Minimal A (amplitude) = 1.0 (< 2.0)
public double cuas_lma_pre_mina = 0.5; // scale cuas_lma_mina to filter initial candidates (if there are > one of them) public double cuas_lma_pre_mina = 0.5; // scale cuas_lma_mina to filter initial candidates (if there are > one of them)
public int cuas_min_keep = 2; // keep at least this number of candidates before using cuas_lma_pre_mina filter public int cuas_min_keep = 2; // keep at least this number of candidates before using cuas_lma_pre_mina filter
...@@ -913,6 +917,7 @@ min_str_neib_fpn 0.35 ...@@ -913,6 +917,7 @@ min_str_neib_fpn 0.35
public double cuas_offcenter = 0.6; // maximal off-center relative to the tile size (0.5 - how it was, +/-4 pix) public double cuas_offcenter = 0.6; // maximal off-center relative to the tile size (0.5 - how it was, +/-4 pix)
public double cuas_scale_wnd = 2.0; // When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15). public double cuas_scale_wnd = 2.0; // When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15).
public double cuas_noisemax = 10.0; // when (max-min) of a 16-pixel tile exceeds this, do not fail on far offcenter public double cuas_noisemax = 10.0; // when (max-min) of a 16-pixel tile exceeds this, do not fail on far offcenter
public double cuas_noisemax8 = 50.0; // when (max-min) of a 8-pixel tile exceeds this, do not consider it
public boolean cuas_fail_mismatch = false; // fail high mismatch early public boolean cuas_fail_mismatch = false; // fail high mismatch early
public boolean cuas_ignore_mismatch = false; // calculate mismatch but do not remove public boolean cuas_ignore_mismatch = false; // calculate mismatch but do not remove
...@@ -2847,9 +2852,13 @@ min_str_neib_fpn 0.35 ...@@ -2847,9 +2852,13 @@ min_str_neib_fpn 0.35
"Maximal RMS for target that should match always, regardless of the amplitude."); "Maximal RMS for target that should match always, regardless of the amplitude.");
gd.addNumericField("Maximal sufficient RMS", this.cuas_lma_arms, 5,8,"", gd.addNumericField("Maximal sufficient RMS", this.cuas_lma_arms, 5,8,"",
"Maximal sufficient RMS for target. Satisfying any of the sufficient or relative is enough"); "Maximal sufficient RMS for target. Satisfying any of the sufficient or relative is enough");
gd.addNumericField("Maximal relative RMS", this.cuas_lma_rrms, 5,8,"", gd.addNumericField("Maximal relative RMS, first pass", this.cuas_lma_rrms, 5,8,"",
"Maximal relative (to amplitude) RMS for target. Satisfying any of the absolute and relative is sufficient"); "Maximal relative (to amplitude) RMS for target. Satisfying any of the absolute and relative is sufficient");
gd.addNumericField("Minimal target amplitude", this.cuas_lma_mina, 5,8,"", gd.addNumericField("Maximal relative RMS, centered", this.cuas_lma_rrms2, 5,8,"",
"Maximal relative (to amplitude) RMS for target. Satisfying any of the absolute and relative is sufficient");
gd.addNumericField("Minimal target amplitude, first pass", this.cuas_lma_mina, 5,8,"",
"Filter out weak targets.");
gd.addNumericField("Minimal target amplitude, centered", this.cuas_lma_mina2, 5,8,"",
"Filter out weak targets."); "Filter out weak targets.");
gd.addNumericField("Scale minimal amplitude", this.cuas_lma_pre_mina, 5,8,"", gd.addNumericField("Scale minimal amplitude", this.cuas_lma_pre_mina, 5,8,"",
"Scale cuas_lma_mina to filter initial candidates (if there are > one of them)."); "Scale cuas_lma_mina to filter initial candidates (if there are > one of them).");
...@@ -2918,8 +2927,10 @@ min_str_neib_fpn 0.35 ...@@ -2918,8 +2927,10 @@ min_str_neib_fpn 0.35
"Maximal relative offset of the maximum as a fraction of ther tile size (0.5 -> +/-4 pix)."); "Maximal relative offset of the maximum as a fraction of ther tile size (0.5 -> +/-4 pix).");
gd.addNumericField("Scale min/max search window", this.cuas_scale_wnd, 5,8,"", gd.addNumericField("Scale min/max search window", this.cuas_scale_wnd, 5,8,"",
"When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15)."); "When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15).");
gd.addNumericField("\"Maximal variations for \"far\" failures.", this.cuas_noisemax, 5,8,"", gd.addNumericField("Maximal variations for \"far\" failures.", this.cuas_noisemax, 5,8,"",
"When (max-min) of a 16-pixel tile exceeds this, do not fail on far offcenter."); "When (max-min) of a 16-pixel tile exceeds this, do not fail on far offcenter.");
gd.addNumericField("Maximal pixel variation in a sky tile", this.cuas_noisemax8, 5,8,"",
"When (max-min) of a 8-pixel tile exceeds this, do not use it (terrain background).");
gd.addCheckbox ("Fail mismatch early", this.cuas_fail_mismatch, gd.addCheckbox ("Fail mismatch early", this.cuas_fail_mismatch,
"Fail after score calculation if there is not match both before and after."); "Fail after score calculation if there is not match both before and after.");
...@@ -4450,7 +4461,9 @@ min_str_neib_fpn 0.35 ...@@ -4450,7 +4461,9 @@ min_str_neib_fpn 0.35
this.cuas_lma_rms = gd.getNextNumber(); this.cuas_lma_rms = gd.getNextNumber();
this.cuas_lma_arms = gd.getNextNumber(); this.cuas_lma_arms = gd.getNextNumber();
this.cuas_lma_rrms = gd.getNextNumber(); this.cuas_lma_rrms = gd.getNextNumber();
this.cuas_lma_rrms2 = gd.getNextNumber();
this.cuas_lma_mina = gd.getNextNumber(); this.cuas_lma_mina = gd.getNextNumber();
this.cuas_lma_mina2 = gd.getNextNumber();
this.cuas_lma_pre_mina = gd.getNextNumber(); this.cuas_lma_pre_mina = gd.getNextNumber();
this.cuas_min_keep = (int) gd.getNextNumber(); this.cuas_min_keep = (int) gd.getNextNumber();
...@@ -4488,6 +4501,7 @@ min_str_neib_fpn 0.35 ...@@ -4488,6 +4501,7 @@ min_str_neib_fpn 0.35
this.cuas_offcenter = gd.getNextNumber(); this.cuas_offcenter = gd.getNextNumber();
this.cuas_scale_wnd = gd.getNextNumber(); this.cuas_scale_wnd = gd.getNextNumber();
this.cuas_noisemax = gd.getNextNumber(); this.cuas_noisemax = gd.getNextNumber();
this.cuas_noisemax8 = gd.getNextNumber();
this.cuas_fail_mismatch = gd.getNextBoolean(); this.cuas_fail_mismatch = gd.getNextBoolean();
this.cuas_ignore_mismatch = gd.getNextBoolean(); this.cuas_ignore_mismatch = gd.getNextBoolean();
...@@ -5756,7 +5770,9 @@ min_str_neib_fpn 0.35 ...@@ -5756,7 +5770,9 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_lma_rms", this.cuas_lma_rms+""); // double properties.setProperty(prefix+"cuas_lma_rms", this.cuas_lma_rms+""); // double
properties.setProperty(prefix+"cuas_lma_arms", this.cuas_lma_arms+""); // double properties.setProperty(prefix+"cuas_lma_arms", this.cuas_lma_arms+""); // double
properties.setProperty(prefix+"cuas_lma_rrms", this.cuas_lma_rrms+""); // double properties.setProperty(prefix+"cuas_lma_rrms", this.cuas_lma_rrms+""); // double
properties.setProperty(prefix+"cuas_lma_rrms2", this.cuas_lma_rrms2+""); // double
properties.setProperty(prefix+"cuas_lma_mina", this.cuas_lma_mina+""); // double properties.setProperty(prefix+"cuas_lma_mina", this.cuas_lma_mina+""); // double
properties.setProperty(prefix+"cuas_lma_mina2", this.cuas_lma_mina2+""); // double
properties.setProperty(prefix+"cuas_lma_pre_mina", this.cuas_lma_pre_mina+""); // double properties.setProperty(prefix+"cuas_lma_pre_mina", this.cuas_lma_pre_mina+""); // double
properties.setProperty(prefix+"cuas_min_keep", this.cuas_min_keep+""); // int properties.setProperty(prefix+"cuas_min_keep", this.cuas_min_keep+""); // int
...@@ -5794,6 +5810,7 @@ min_str_neib_fpn 0.35 ...@@ -5794,6 +5810,7 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_offcenter", this.cuas_offcenter+""); // double properties.setProperty(prefix+"cuas_offcenter", this.cuas_offcenter+""); // double
properties.setProperty(prefix+"cuas_scale_wnd", this.cuas_scale_wnd+""); // double properties.setProperty(prefix+"cuas_scale_wnd", this.cuas_scale_wnd+""); // double
properties.setProperty(prefix+"cuas_noisemax", this.cuas_noisemax+""); // double properties.setProperty(prefix+"cuas_noisemax", this.cuas_noisemax+""); // double
properties.setProperty(prefix+"cuas_noisemax8", this.cuas_noisemax8+""); // double
properties.setProperty(prefix+"cuas_fail_mismatch", this.cuas_fail_mismatch+""); // boolean properties.setProperty(prefix+"cuas_fail_mismatch", this.cuas_fail_mismatch+""); // boolean
properties.setProperty(prefix+"cuas_ignore_mismatch", this.cuas_ignore_mismatch+"");// boolean properties.setProperty(prefix+"cuas_ignore_mismatch", this.cuas_ignore_mismatch+"");// boolean
...@@ -7004,7 +7021,9 @@ min_str_neib_fpn 0.35 ...@@ -7004,7 +7021,9 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_lma_rms")!=null) this.cuas_lma_rms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_rms")); if (properties.getProperty(prefix+"cuas_lma_rms")!=null) this.cuas_lma_rms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_rms"));
if (properties.getProperty(prefix+"cuas_lma_arms")!=null) this.cuas_lma_arms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_arms")); if (properties.getProperty(prefix+"cuas_lma_arms")!=null) this.cuas_lma_arms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_arms"));
if (properties.getProperty(prefix+"cuas_lma_rrms")!=null) this.cuas_lma_rrms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_rrms")); if (properties.getProperty(prefix+"cuas_lma_rrms")!=null) this.cuas_lma_rrms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_rrms"));
if (properties.getProperty(prefix+"cuas_lma_rrms2")!=null) this.cuas_lma_rrms2=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_rrms2"));
if (properties.getProperty(prefix+"cuas_lma_mina")!=null) this.cuas_lma_mina=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_mina")); if (properties.getProperty(prefix+"cuas_lma_mina")!=null) this.cuas_lma_mina=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_mina"));
if (properties.getProperty(prefix+"cuas_lma_mina2")!=null) this.cuas_lma_mina2=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_mina2"));
if (properties.getProperty(prefix+"cuas_lma_pre_mina")!=null) this.cuas_lma_pre_mina=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_pre_mina")); if (properties.getProperty(prefix+"cuas_lma_pre_mina")!=null) this.cuas_lma_pre_mina=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_pre_mina"));
if (properties.getProperty(prefix+"cuas_min_keep")!=null) this.cuas_min_keep=Integer.parseInt(properties.getProperty(prefix+ "cuas_min_keep")); if (properties.getProperty(prefix+"cuas_min_keep")!=null) this.cuas_min_keep=Integer.parseInt(properties.getProperty(prefix+ "cuas_min_keep"));
...@@ -7039,6 +7058,7 @@ min_str_neib_fpn 0.35 ...@@ -7039,6 +7058,7 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_offcenter")!=null) this.cuas_offcenter=Double.parseDouble(properties.getProperty(prefix+"cuas_offcenter")); if (properties.getProperty(prefix+"cuas_offcenter")!=null) this.cuas_offcenter=Double.parseDouble(properties.getProperty(prefix+"cuas_offcenter"));
if (properties.getProperty(prefix+"cuas_scale_wnd")!=null) this.cuas_scale_wnd=Double.parseDouble(properties.getProperty(prefix+"cuas_scale_wnd")); if (properties.getProperty(prefix+"cuas_scale_wnd")!=null) this.cuas_scale_wnd=Double.parseDouble(properties.getProperty(prefix+"cuas_scale_wnd"));
if (properties.getProperty(prefix+"cuas_noisemax")!=null) this.cuas_noisemax=Double.parseDouble(properties.getProperty(prefix+"cuas_noisemax")); if (properties.getProperty(prefix+"cuas_noisemax")!=null) this.cuas_noisemax=Double.parseDouble(properties.getProperty(prefix+"cuas_noisemax"));
if (properties.getProperty(prefix+"cuas_noisemax8")!=null) this.cuas_noisemax8=Double.parseDouble(properties.getProperty(prefix+"cuas_noisemax8"));
if (properties.getProperty(prefix+"cuas_fail_mismatch")!=null) this.cuas_fail_mismatch=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_fail_mismatch")); if (properties.getProperty(prefix+"cuas_fail_mismatch")!=null) this.cuas_fail_mismatch=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_fail_mismatch"));
if (properties.getProperty(prefix+"cuas_ignore_mismatch")!=null) this.cuas_ignore_mismatch=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_ignore_mismatch")); if (properties.getProperty(prefix+"cuas_ignore_mismatch")!=null) this.cuas_ignore_mismatch=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_ignore_mismatch"));
...@@ -8265,7 +8285,9 @@ min_str_neib_fpn 0.35 ...@@ -8265,7 +8285,9 @@ min_str_neib_fpn 0.35
imp.cuas_lma_rms = this.cuas_lma_rms; imp.cuas_lma_rms = this.cuas_lma_rms;
imp.cuas_lma_arms = this.cuas_lma_arms; imp.cuas_lma_arms = this.cuas_lma_arms;
imp.cuas_lma_rrms = this.cuas_lma_rrms; imp.cuas_lma_rrms = this.cuas_lma_rrms;
imp.cuas_lma_rrms2 = this.cuas_lma_rrms2;
imp.cuas_lma_mina = this.cuas_lma_mina; imp.cuas_lma_mina = this.cuas_lma_mina;
imp.cuas_lma_mina2 = this.cuas_lma_mina2;
imp.cuas_lma_pre_mina = this.cuas_lma_pre_mina; imp.cuas_lma_pre_mina = this.cuas_lma_pre_mina;
imp.cuas_min_keep = this.cuas_min_keep; imp.cuas_min_keep = this.cuas_min_keep;
...@@ -8300,6 +8322,7 @@ min_str_neib_fpn 0.35 ...@@ -8300,6 +8322,7 @@ min_str_neib_fpn 0.35
imp.cuas_offcenter = this.cuas_offcenter; imp.cuas_offcenter = this.cuas_offcenter;
imp.cuas_scale_wnd = this.cuas_scale_wnd; imp.cuas_scale_wnd = this.cuas_scale_wnd;
imp.cuas_noisemax = this.cuas_noisemax; imp.cuas_noisemax = this.cuas_noisemax;
imp.cuas_noisemax8 = this.cuas_noisemax8;
imp.cuas_fail_mismatch = this.cuas_fail_mismatch; imp.cuas_fail_mismatch = this.cuas_fail_mismatch;
imp.cuas_ignore_mismatch = this.cuas_ignore_mismatch; imp.cuas_ignore_mismatch = this.cuas_ignore_mismatch;
......
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