booleangenerate_output=clt_parameters.imp.cuas_generate;// generate and save targets Tiff and/or video files
booleanclean_video=clt_parameters.imp.cuas_clean_video;//true;// save video without any debug information for targets, output in TIFF files. False - same output for video and TIFFs
/// boolean generate_output =clt_parameters.imp.cuas_generate; // generate and save targets Tiff and/or video files
/// boolean clean_video = clt_parameters.imp.cuas_clean_video; //true;// save video without any debug information for targets, output in TIFF files. False - same output for video and TIFFs
Stringreuse_path=clt_parameters.imp.cuas_reuse_path;// ""; // either suffix (all parameters the same) or the full path (contains "/")
double[][][]targets_nonconflict=null;
intseq_length=corr_offset+corr_pairs;
...
...
@@ -10136,6 +10191,7 @@ public class CuasMotion {
}
setTargets(targets_nonconflict);
/*
if (generate_output) {
generateExtractFilterMovingTargets( // move parameters to clt_parameters
false, // final boolean video_pass, // if clt_parameters.cuas_clean_video=true, video_pass=0 - output TIFFS, but no video. If video_pass==1 - only video with no debug
...
...
@@ -10155,6 +10211,7 @@ public class CuasMotion {
System.out.println("Output images/videos with detected targets is disabled by \"Generate and save detected targets\" parameter, skipping it.");
doublecuas_initial_disparity=clt_parameters.imp.cuas_initial_disparity;// 1.0; // Start correlation with this disparity (in addition to infinity) after reset
doublecuas_infinity=clt_parameters.imp.cuas_infinity;// 0.63; // disparity at infinity for targets
booleangenerate_output=clt_parameters.imp.cuas_generate;// generate and save targets Tiff and/or video files
booleanclean_video=clt_parameters.imp.cuas_clean_video;//true;// save video without any debug information for targets, output in TIFF files. False - same output for video and TIFFs
cuasMotion.generateExtractFilterMovingTargets(// move parameters to clt_parameters
false,// final boolean video_pass, // if clt_parameters.cuas_clean_video=true, video_pass=0 - output TIFFS, but no video. If video_pass==1 - only video with no debug
batch_mode,// final boolean batch_mode,
fpixels,// final float [][] fpixels,
targets,// _nonconflict, // final double [][][] vf_sequence, // center tiles (not extended), null /non-null only
debugLevel);// final int debugLevel)
if(clean_video){
cuasMotion.generateExtractFilterMovingTargets(// move parameters to clt_parameters
true,// final boolean video_pass, // if clt_parameters.cuas_clean_video=true, video_pass=0 - output TIFFS, but no video. If video_pass==1 - only video with no debug
batch_mode,// final boolean batch_mode,
fpixels,// final float [][] fpixels,
targets,// _nonconflict, // final double [][][] vf_sequence, // center tiles (not extended), null /non-null only
debugLevel);// final int debugLevel)
}
}else{
System.out.println("Output images/videos with detected targets is disabled by \"Generate and save detected targets\" parameter, skipping it.");
rangeTargets(
targets,//final double [][][] targets, // centers
// rng_combine, // final int rng_combine,
log_ranging,// final boolean log_ranging,
rng_vfy,// final boolean rng_vfy, // Generate/save ranging verification images (per-sensor and combined rendering from the same data)
sb.append("cuas_min_max_ac = "+clt_parameters.imp.cuas_min_max_ac+"\n");// 0.175; // 0.14; // LWIR16: 0.01 maximal of a and C coefficients minimum (measures sharpest point/line)
sb.append("cuas_min_min_ac = "+clt_parameters.imp.cuas_min_min_ac+"\n");// LWIR16: 0.007 minimal of a and C coefficients minimum (measures sharpest point)
sb.append("cuas_reset_disparity = "+clt_parameters.imp.cuas_reset_disparity+"\n");// reset target disparities from infinity
sb.append("cuas_initial_disparity= "+clt_parameters.imp.cuas_initial_disparity+"\n");// Start correlation with this disparity (in addition to infinity) after reset
sb.append("cuas_infinity = "+clt_parameters.imp.cuas_infinity+"\n");// disparity at infinity for targets
sb.append("cuas_rng_niterate = "+clt_parameters.imp.cuas_rng_niterate+"\n");// number of disparity iterations
sb.append("cuas_rng_diff = "+clt_parameters.imp.cuas_rng_diff+"\n");// exit when disparity difference is smaller
sb.append("cuas_max_disp_diff = "+clt_parameters.imp.cuas_max_disp_diff+"\n");// Maximal disparity difference during last change to consider disparity valid
sb.append("cuas_min_disp_str = "+clt_parameters.imp.cuas_min_disp_str+"\n");// Minimal disparity strength to consider disparity valid
sb.append("cuas_rng_limit = "+clt_parameters.imp.cuas_rng_limit+"\n");// Maximal displayed distance to target
image_dtt.clt_process_tl_correlations(// convert to pixel domain and process correlations already prepared in fcorr_td and/or fcorr_combo_td
imgdtt_params,// clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
...
...
@@ -1257,16 +1411,16 @@ public class CuasRanging {
accum_weights,// float [][][] num_acc, // number of accumulated tiles [tilesY][tilesX][pair] (or null)
null,// dcorr_weight, // double [] dcorr_weight, // alternative to num_acc, compatible with CPU processing (only one non-zero enough)
// clt_parameters.getGpuFatZero(center_CLT.isMonochrome()), // final double gpu_fat_zero, // clt_parameters.getGpuFatZero(is_mono);absolute == 30.0
// clt_parameters.getGpuFatZero(center_CLT.isMonochrome()), // final double gpu_fat_zero, // clt_parameters.getGpuFatZero(is_mono);absolute == 30.0
rng_fz,// final double gpu_fat_zero, // clt_parameters.getGpuFatZero(is_mono);absolute == 30.0
image_dtt.transform_size-1,// final int gpu_corr_rad, // = transform_size - 1 ?
// The tp_tasks data should be decoded from GPU to get coordinates
// The tp_tasks data should be decoded from GPU to get coordinates
tp_tasks_ref[0],// final TpTask [] tp_tasks, // data from the reference frame - will be applied to LMW for the integrated correlations
null,// final double [][] far_fgbg, // null, or [nTile]{disp(fg)-disp(bg), str(fg)-str(bg)} hints for LMA FG/BG split
center_CLT.getErsCorrection().getRXY(false),// final double [][] rXY, // from geometryCorrection
// next both can be nulls
null,// final double [][][][] clt_corr_out, // sparse (by the first index) [type][tilesY][tilesX][(2*transform_size-1)*(2*transform_size-1)] or null
// combo will be added as extra pair if mcorr_comb_width > 0 and clt_corr_out has a slot for it
// combo will be added as extra pair if mcorr_comb_width > 0 and clt_corr_out has a slot for it
// to be converted to float
dcorr_tiles,// final double [][][] dcorr_tiles, // [tile][pair][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
// When clt_mismatch is non-zero, no far objects extraction will be attempted
...
...
@@ -1275,7 +1429,7 @@ public class CuasRanging {
disparity_map,// final double [][] disparity_map, // [8][tilesY][tilesX], only [6][] is needed on input or null - do not calculate
null,// final double [][] ddnd, // data for LY. SHould be either null or [num_sensors][]
clt_parameters.correlate_lma,// final boolean run_lma, // calculate LMA, false - CM only
// define combining of all 2D correlation pairs for CM (LMA does not use them)
// define combining of all 2D correlation pairs for CM (LMA does not use them)
imgdtt_params.mcorr_comb_width,//final int mcorr_comb_width, // combined correlation tile width (set <=0 to skip combined correlations)
imgdtt_params.mcorr_comb_height,//final int mcorr_comb_height, // combined correlation tile full height
imgdtt_params.mcorr_comb_offset,//final int mcorr_comb_offset, // combined correlation tile height offset: 0 - centered (-height/2 to height/2), height/2 - only positive (0 to height)
...
...
@@ -1290,7 +1444,7 @@ public class CuasRanging {
dcorr_tiles,// double [][][] dcorr_tiles,// [tile][sparse, correlation pair][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
fclt_corr);// float [][][] fclt_corr) // new float [tilesX * tilesY][][] or null
// if (show_accumulated_correlations || (accum_2d_corr != null)){ // -1
// if (show_accumulated_correlations || (accum_2d_corr != null)){ // -1
if(show_corr||(accum_2d_corr!=null)){// -1
float[][]accum_2d_img=ImageDtt.corr_partial_dbg(// not used in lwir
fclt_corr,// final float [][][] fcorr_data, // [tile][pair][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
...
...
@@ -1338,7 +1492,6 @@ public class CuasRanging {
finalintnseq,
finalintdseq,
finalintdebugLevel){
// final double radius = clt_parameters.imp.cuas_rng_radius;
publicdoublecuas_invert_tolerance=0.001;// Finish enhancing when last change was lower than
...
...
@@ -702,7 +702,7 @@ min_str_neib_fpn 0.35
publicdoublecuas_multi_strength=0.45;// maximal strength to use multi-tile DSI
publicdoublecuas_reliable_str=0.8;// use for relaible tiles if INTER-INTRA-LMA is available, not just DSI_MAIN
publicdoublecuas_fat_zero=25.0;// phase correlation fat zero
publicdoublecuas_fat_zero=50.0;// phase correlation fat zero
publicdoublecuas_cent_radius=3.0;// centroids center radius
publicintcuas_n_recenter=2;// when cosine window, re-center window these many times
publicdoublecuas_rstr=0.01;// minimal phase correlation maximums relative to max str
...
...
@@ -736,18 +736,18 @@ min_str_neib_fpn 0.35
publicdoublecuas_sky_threshold=0.9;// minimal value of the sky mask where target is possible
publicdouble[]cuas_sky_offset={0.0,0.0};// add to coordinates when looking for the mask value
publicdoublecuas_lmax_fraction=0.6;// Check if local maximum is separated from the surrounding by this fraction of the maximum value
publicdoublecuas_lmax_fraction=0.55;// Check if local maximum is separated from the surrounding by this fraction of the maximum value
publicdoublecuas_lmax_hack_ridge=0.45;// Hack for ridges: remove horizontal streaks, where average(abs()) for the line exceeds fraction of abs max 0.32-good, 0.55 - bad
publicdoublecuas_lmax_radius=3.5;// 4.5; // look inside ((int)cuas_lmax_radius) * 2 + 1 square for the local maximum isolation
publicdoublecuas_lmax_radius=4.5;// 4.5; // look inside ((int)cuas_lmax_radius) * 2 + 1 square for the local maximum isolation
publicbooleancuas_lmax_zero=false;// true; // zero all data outside this radius from the maximum
publicdoublecuas_centered_radius=3.5;// in centered mode (target placed at [8,8] - zero out data outside peripheral areas, keep 0.5 at the radius
publicdoublecuas_centered_blur=0.5;// relative transition radius range (for 0.5 the mask inside (1-0.5) radius will be 1.0, outside (1+0.5) radius will be 0
publicdoublecuas_duplicate_tolerance=2.0;// (pix) Remove weaker maximums closer than this to a stronger one
publicdoublecuas_target_radius=3.0;// target centroids center radius
publicdoublecuas_target_strength=0.8;// target centroids center radius
publicbooleancuas_no_border=true;// exclude targets with centers on the 16x16 tile edges
// CUAS Motion LMA parameters
publicdoublecuas_lma_sigma=2.5;
...
...
@@ -768,25 +768,25 @@ min_str_neib_fpn 0.35
publicintcuas_num_iter=20;
// CUAS Motion LMA filter parameters
publicdoublecuas_lma_rms=2.5;// 1.5; // Maximal RMS (should always match, regardless if A)
publicdoublecuas_lma_arms=0.4;// 0.06; // Maximal absolute RMS (should match one of cuas_lma_arms OR cuas_lma_rrms (0.484)
publicdoublecuas_lma_rrms=0.2;// 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
publicdoublecuas_lma_mina=0.7;// 1.0; // Minimal A (amplitude) = 1.0 (< 2.0)
publicdoublecuas_lma_rms=1.5;// 1.5; // Maximal RMS (should always match, regardless if A)
publicdoublecuas_lma_arms=0.37;// 0.06; // Maximal absolute RMS (should match one of cuas_lma_arms OR cuas_lma_rrms (0.484)
publicdoublecuas_lma_rrms=0.28;// 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
publicdoublecuas_lma_mina=0.4;// 1.0; // Minimal A (amplitude) = 1.0 (< 2.0)
publicdoublecuas_lma_pre_mina=0.5;// scale cuas_lma_mina to filter initial candidates (if there are > one of them)
publicintcuas_min_keep=2;// keep at least this number of candidates before using cuas_lma_pre_mina filter
publicdoublecuas_lma_maxr=5.0;// Maximal R (radius) =5.0 (> 3.8)
publicdoublecuas_lma_minr1=1.0;// Minimal R1 (radius of positive peak)
publicdoublecuas_lma_maxr=7.0;// Maximal R (radius) =5.0 (> 3.8)
publicdoublecuas_lma_minr1=0.75;// Minimal R1 (radius of positive peak)
publicdoublecuas_lma_mink=0.0;// Minimal K (overshoot) = 0.0 (<0.007)
publicdoublecuas_lma_maxk=5.0;// Maximal K (overshoot) = 5.0 (>3.8)
publicdoublecuas_lma_a2a=0.7;// Minimal ratio of the maximal pixel to the amplitude
publicdoublecuas_lma_a2a=0.5;// Minimal ratio of the maximal pixel to the amplitude
publicdoublecuas_slow_ra=50.0;// running averaging for slow targets
publicdoublecuas_slow_score=1.0;// scale scores for slow target mode
publicdoublecuas_score_mv=0.0;// minimal score for the motion vectors
publicdoublecuas_score_lma=0.0;// minimal score for the target LMA
publicdoublecuas_score_lma=1.6;// minimal score for the target LMA
publicdoublecuas_factor_lim=5.0;// limit each individual score factor
publicdoublecuas_factor_pow=1.0;// raise score factor to this power before combining
publicdouble[]cuas_score_coeff={1.0,0.05,0.7,1.5,2.0,1.0,1.0};//weights of amplitude, RMSE and RMSE/amplitude, center, mismatch, match_length, travel
...
...
@@ -797,22 +797,23 @@ min_str_neib_fpn 0.35
publicbooleancuas_isolated=true;// remove targets that do not have neighbors before/after
publicintcuas_min_seq=3;// minimal number of consecutive key frames for the same target
publicintcuas_enough_seq=5;// number of consecutive key frames considered good regardless of individual scores (maybe add minimal travel in pixels)?
publicdoublecuas_seq_travel=3.0;// minimal diagonal of the bounding box that includes sequence to be considered "cuas_enough_seq". Filtering out atmospheric fluctuations
publicintcuas_min_seq_fl=2;// minimal number of consecutive key frames for the same target that includes first or last key frame
publicintcuas_min_seq=5;// minimal number of consecutive key frames for the same target
publicintcuas_enough_seq=10;// number of consecutive key frames considered good regardless of individual scores (maybe add minimal travel in pixels)?
publicdoublecuas_seq_travel=2.5;// minimal diagonal of the bounding box that includes sequence to be considered "cuas_enough_seq". Filtering out atmospheric fluctuations
publicintcuas_min_seq_fl=4;// minimal number of consecutive key frames for the same target that includes first or last key frame
// public boolean cuas_remove_2seq = true; // Remove 2-long target sequences consisting of 2 consecutive key frames
// public boolean cuas_remove_2seq_all=true; // Remove 2-long first/last target sequences
publicdoublecuas_max_mismatch=2.0;// maximal position error between consecutive scene sequences
publicdoublecuas_good_mismatch=0.4;// maximal position error between consecutive scene sequences that adds to the score
publicdoublecuas_good_mismatch=1.0;// maximal position error between consecutive scene sequences that adds to the score
publicdoublecuas_slow_fast_mismatch=1.5;// allow larger mismatch between slow and fast
publicdoublecuas_match_len_pwr=0.5;// raise matching length to this power for calculating score
publicbooleancuas_fail_mismatch=false;// fail high mismatch early
publicbooleancuas_ignore_mismatch=false;// calculate mismatch but do not remove
// May be obsolete by now as there is an image mask of the sky.
publicbooleancuas_by_horizon=true;// remove targets that are below horizon
publicdoublecuas_horizon=390.0;// maximal Y - position of the sky
publicdoublecuas_horizon=380.0;// maximal Y - position of the sky
publicdoublecuas_mask_width=9;
publicdoublecuas_mask_blur=3;
...
...
@@ -829,14 +830,14 @@ min_str_neib_fpn 0.35
publicbooleancuas_targets=true;// enable targets generation together with the source UM images
publicintcuas_iter_show=1;// Maximal enhancement iteration to show intermediate result (0 - none)
publicintcuas_iter_show=0;// 1; // Maximal enhancement iteration to show intermediate result (0 - none)
publicbooleancuas_intermed_low=true;// save intermediate vector fields and target coordinates from the LMA (80x64 layers)
publicbooleancuas_intermed_high=true;// save pixel-resolution accumulated images (640x512)
publicbooleancuas_intermed_giga=false;// save huge (gigabyte) intermediate files
publicbooleancuas_debug_more=false;// save/show more images
publicbooleancuas_debug_more=true;// save/show more images
publicbooleancuas_generate=true;// generate and save targets Tiff and/or video files
publicbooleancuas_save_mono=true;// save 32-bit monochrome target+backgrounds Tiffs (before optional scaling)
publicbooleancuas_save_mono=false;// save 32-bit monochrome target+backgrounds Tiffs (before optional scaling)
publicbooleancuas_save_color=true;// save color rendered images (same as videos)
publicbooleancuas_save_video=true;// save color rendered images (same as videos)
publicbooleancuas_clean_video=true;// save video without any debug information for targets, output in TIFF files. False - same output for video and TIFFs
...
...
@@ -844,10 +845,14 @@ min_str_neib_fpn 0.35
publicbooleancuas_annotate=true;// save color rendered images (same as videos)
publicbooleancuas_annotate_uas=true;// indicate uas from log if available
publicintcuas_py0=386;// pixel with known elevation
publicdoublecuas_az0=201.5;// degrees for cuas_px0;
publicdoublecuas_el0=0.0;// degrees for cuas_px0;
publicbooleancuas_show_disp=true;// Show disparity (corrected) near target (not in clean)
publicbooleancuas_show_rng=true;// Show distance to target (range) in meters
publicbooleancuas_show_inf=true;// Show distance greater than max (or negativce) as infinity
publicbooleancuas_show_inf_gt=true;// Use ">max" instead of infinity symbol
publicbooleancuas_show_true_rng=true;// show true range (from the flight log)
// ranging parameters
publicbooleancuas_smooth_omegas=true;// Recalculate omegas from continuing targets positions
publicbooleancuas_rng_um=true;// apply UM to images for ranging (assumed true)
publicbooleancuas_rng_um_all=false;// Unsharp mask all images (after FPN and Row/Col), unchecked - when needed. Checked faster, but original data is lost.
publicdoublecuas_rng_um_sigma=2;// unsharp mask sigma for ranging images
publicbooleancuas_rng_um2=false;// apply UM to images twice
publicdoublecuas_rng_um_sigma=1.5;// unsharp mask sigma for ranging images
publicbooleancuas_rng_um2=true;// apply UM to images twice
publicdoublecuas_rng_um_weight=1.0;// unsharp mask weight for ranging images
publicbooleancuas_rng_coswnd=true;// Use cosine scenes window (false - rectangular)
publicintcuas_rng_combine=8;// combine multiple scenes before intrascene correlation
publicdoublecuas_rng_radius0=3.5;// mask out data outside peripheral areas, keep 0.5 at the radius - first iteration
publicdoublecuas_rng_radius=2.0;// mask out data outside peripheral areas, keep 0.5 at the radius - next iteration
publicbooleancuas_rng_coswnd=false;// Use cosine scenes window (false - rectangular)
publicintcuas_rng_combine=2;// combine multiple scenes before intrascene correlation
publicdoublecuas_rng_radius0=3.0;// mask out data outside peripheral areas, keep 0.5 at the radius - first iteration
publicdoublecuas_rng_radius=2.5;// mask out data outside peripheral areas, keep 0.5 at the radius - next iteration
publicdoublecuas_rng_blur=0.5;// relative transition radius range (for 0.5 the mask inside (1-0.5) radius will be 1.0, outside (1+0.5) radius will be 0
publicdoublecuas_rng_fz=1000.0;// Fat zero in target ranging mode
publicdoublecuas_rng_scale=8.0;// Scale alt_data to use same strength as for normal ranging because targets
publicdoublecuas_rng_fz=30.0;// Fat zero in target ranging mode
publicdoublecuas_rng_scale=8.0;// Scale alt_data to use same strength as for normal ranging because targets
// will overwrite ImageDttParameters
publicbooleancuas_dual_pass=true;// First pass - do not adjust disparity
publicbooleancuas_disp_only2=true;// Disparity only on second pass (keep scales and shape - some CUAS where failing on second pass)
publicbooleancuas_disp_only2=false;// Disparity only on second pass (keep scales and shape - some CUAS where failing on second pass)
publicbooleancuas_lma_bypass=false;// Bypass solution tests, OK weak
publicintcuas_mcorr_sel=3;// all pairs and diagonals (as was for non-cuas ranging)
publicintcuas_mcorr_sel_lma=1;// all pairs (will use all selected by cuas_mcorr_sel)
publicintcuas_mcorr_sel=3;// all pairs and diagonals (as was for non-cuas ranging)
publicintcuas_mcorr_sel_lma=3;// all pairs (will use all selected by cuas_mcorr_sel)
publicdoublecuas_max_rel_rms=1.2;// maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
...
...
@@ -887,25 +896,25 @@ min_str_neib_fpn 0.35
publicdoublecuas_min_min_ac=0.003;// LWIR16: 0.007 minimal of a and C coefficients minimum (measures sharpest point)
publicbooleancuas_reset_disparity=true;// reset target disparities from infinity
publicdoublecuas_infinity=0.68;// disparity at infinity for targets
publicdoublecuas_initial_disparity=1.0;// Start correlation with this disparity (in addition to infinity) after reset
publicdoublecuas_infinity=0.63;// disparity at infinity for targets