double [][] dbg_2d_corrs = ImageDtt.corr_partial_dbg( // not used in lwir
new double [][][] {corr_tiles_pd}, // final double [][][] corr_data, // [layer][tile][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
cuasMotion.tilesX, // final int tilesX,
corr_size, //final int corr_size, // 15
clt_parameters.corr_border_contrast, // final double border_contrast,
double lma_arms = clt_parameters.imp.cuas_lma_arms; // = 0.06; // Maximal absolute RMS, sufficient for any amplitude
double lma_rrms = clt_parameters.imp.cuas_lma_rrms; // = 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
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
for (int i = 0; i < target_frac.length; i++) {
if (clt_parameters.imp.cuas_target_frac[i].length >= 2) {
gd.addNumericField("Number of pairs", corr_pairs, 0, 3, "", "The number of correlation pairs to accumulate.");
gd.addNumericField("Pairs offset", corr_offset, 0, 3, "scenes", "Offset between the correlation pairs");
gd.addNumericField("Pre-correlation running average", precorr_ra, 0,3,"scenes", "Smoothing input data by running average before correlation for motion vectors calculations. Target extraction wil still use individual scenes.");
gd.addNumericField("Correlation step after RA", corr_ra_step, 0,3,"scenes", "Decimate correlations after running average");
gd.addCheckbox ("Smooth weights", smooth, "Apply cosine weights when averaging a sequence of correlation pairs.");
gd.addCheckbox ("Half scan step", half_step, "Reduce step for motion detection = offset/2, if false = offset.");
gd.addNumericField("Fat zero", fat_zero, 7, 10, "", "Fat zero for TD->PD conversion");
gd.addNumericField("Local max range", max_range, 0,3,"", "While filtering local correlation maximums: 1 - 3x3 neighbors, 2 - 5x5 ones.");
gd.addNumericField("Number of enhancement cycles", num_cycles, 0,3,"","Number of cycles of testing and removing bad targets from compoetition with weaker neighbors.");
gd.addNumericField("Target radius", target_radius, 5,8,"pix","Target radius, also used to calculate fraction of totals inside (windowed) to all positive values.");
gd.addNumericField("Minimal target strength", target_strength, 5,8,"","Minimal value of the target image.");
gd.addStringField ("Fraction for strengths", IntersceneMatchParameters.double2dToString(target_frac), 100,
"Variable number of (strength, fraction) pairs separated by \":\". Each pair of strength, minimal fraction is separated by \",\".");
gd.addCheckbox ("Target not on the tile edge", no_border, "Exclude targets with centers on the edge of 16x16 tiles.");
String [] slice_titles= new String [num_corr_samples];
for (int nscan = 0; nscan < num_corr_samples; nscan++) {
int frame_cent = start_frame + corr_inc * nscan + seq_length/2; // debug only
slice_titles[nscan] = imp_sel.getStack().getSliceLabel(frame_cent+1+first_corr); // wrong! should be imp_sel.getStack().getSliceLabel(frame_cent+1+first_corr)
System.out.println("Failed to motion vectors from "+path_vf);
continue;
}
if (remove_isolated) {
removeShortTargetSequences(
clt_parameters, // CLTParameters clt_parameters,
batch_mode, // final boolean batch_mode,
parentCLT, // QuadCLT parentCLT, //
vf_sequence, // final double [][][] target_sequence,
cuasMotion, // final CuasMotion cuasMotion,
slice_titles, // String [] slice_titles,
debugLevel); // final int debugLevel)
}
generateExtractFilterMovingTargets( // move parameters to clt_parameters
clt_parameters, // CLTParameters 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,
parentCLT, // QuadCLT parentCLT, //
// three arrays needed
fpixels, // final float [][] fpixels,
vf_sequence, // final double [][][] vf_sequence, // center tiles (not extended), null /non-null only
// frame0, // final int frame0, // for vector_field[0] // source scene corresponding to the first sequence
cuasMotion, // final CuasMotion cuasMotion,
null, // UasLogReader uasLogReader,
scene_titles, // String [] scene_titles, // recreate slice_titles from scene titles?
slice_titles, // String [] slice_titles,
debugLevel); // final int debugLevel)
continue;
}
processMovingTargets(
clt_parameters, // CLTParameters clt_parameters,
batch_mode, // final boolean batch_mode,
parentCLT, // QuadCLT parentCLT, //
fpixels, // final float [][] fpixels,
null, // String [] scene_titles, // recreate slice_titles from scene titles?
scene_titles, // String [] scene_titles, // recreate slice_titles from scene titles?
debugLevel); // final int debugLevel)
continue;
} // while (true) {
}
*/
publicstaticvoidprintStats(
Strings,
booleanall,
...
...
@@ -1797,245 +1139,7 @@ public class CuasMotion {
// fills out additional fields in target_coords
publicstaticvoidgetEffectiveStrengthLMA(
finaldouble[][][]target_sequence,// modifies certain fields (scores)
finaldoubletarget_strength,
finaldouble[][]target_frac,// pairs - strength, minimal fraction for that strength
finaldoublelma_rms,// = 1.5; // Maximal RMS (should always match, regardless if A)
finaldoublelma_arms,// = 0.06; // Maximal absolute RMS (should match one of cuas_lma_arms OR cuas_lma_rrms (0.484)
finaldoublelma_rrms,// = 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
finaldoublelma_mina,// = 1.0; // Minimal A (amplitude)
finaldoublelma_maxr,// = 5.0; // Minimal K (overshoot) = 3.0
finaldoublelma_minr1,// = 1.0; // Minimal R1 (radius of positive peak)
finaldoublelma_mink,// = 0.0; // Minimal K (overshoot) = 1.0
finaldoublelma_maxk,// = 5.0; // Minimal K (overshoot) = 3.0
finaldoublelma_a2a,
finaldoublemax_mismatch,
finaldoublegood_mismatch,//do not add to score if worse
finalbooleanfail_mismatch,
finaldoublelma_horizon,// horizon as maximal pixel Y
finalinttilesX){
// if centroid maximum is safely good, ignore lma_a2a ratio
finaldoubleSAFE_CENT_MX=3*target_strength;// Find a more elegant solution
finalintnum_seq=target_sequence.length;
finalintnum_tiles=target_sequence[0].length;
// final double center_scale = 0.5*Math.PI/GPUTileProcessor.DTT_SIZE;