doublelma_rrms2=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)
doublelma_rrms2=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)
doublelma_mina2=clt_parameters.imp.cuas_lma_mina2;// = 1.0; // Minimal A (amplitude)
doublelma_mina2=clt_parameters.imp.cuas_lma_mina2;// = 1.0; // Minimal A (amplitude)
...
@@ -8231,7 +8259,8 @@ public class CuasMotion {
...
@@ -8231,7 +8259,8 @@ public class CuasMotion {
if(accum_boosted){
if(accum_boosted){
// Andrey 05/05/2026 moved here (earlier) so shiftAndRenderAccumulate() will use updated motion vector
// Andrey 05/05/2026 moved here (earlier) so shiftAndRenderAccumulate() will use updated motion vector
// By Claude on 05/05/2026 — re-correlate with spatial mask around known target
// By Claude on 05/05/2026 — re-correlate with spatial mask around known target
if(recalc_mv){
if(recalc_mv_num>0){
intcorr_offset_scale=(int)Math.round(recalc_mv_boost);// TODO: promote to config or derive from other params
refineMotionVectors(
refineMotionVectors(
clt_parameters,// CLTParameters clt_parameters,
clt_parameters,// CLTParameters clt_parameters,
batch_mode,// boolean batch_mode,
batch_mode,// boolean batch_mode,
...
@@ -8246,8 +8275,32 @@ public class CuasMotion {
...
@@ -8246,8 +8275,32 @@ 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,
recalc_mv_icorr,// int corr_offset_scale,
0,// double mv_diff_max, // if > 0, fail for high MV correction
"-first",// String dbg_suffix,
niter-niter0,// int dbg_iter_index,
debugLevel);// -1); // debugLevel); // int debugLevel)
if(recalc_mv_num>1){
refineMotionVectors(// just testing conversion
clt_parameters,// CLTParameters clt_parameters,
batch_mode,// boolean batch_mode,
cuasMotion,// CuasMotion cuasMotion,
recalc_mv_boost,// double recalc_mv_boost,
recalc_mv_r0f,// double recalc_mv_r0,
recalc_mv_r1f,// double recalc_mv_r1,
fpixels_refine,// By Claude on 05/07/2026: LPF'd with precorr_ra (was fpixels_tum)
publicstaticfinalintRSLT_FL_RANGE=59;// flight log range (meters)
publicstaticfinalintRSLT_FL_RANGE=60;// flight log range (meters)
publicstaticfinalintRSLT_INFINITY=60;// disparity at infinity used for range calculation
publicstaticfinalintRSLT_INFINITY=61;// disparity at infinity used for range calculation
publicstaticfinalintRSLT_TARGET_ID=61;// unique target id for the whole sequence of segments. 1 is reserved for the UAS
publicstaticfinalintRSLT_TARGET_ID=62;// unique target id for the whole sequence of segments. 1 is reserved for the UAS
publicstaticfinalintRSLT_VEL_AWAY=62;// axial velocity (positive - away), range derivative (m/s), calculated from the difference to the previous/next series range
publicstaticfinalintRSLT_VEL_AWAY=63;// axial velocity (positive - away), range derivative (m/s), calculated from the difference to the previous/next series range
publicstaticfinalintRSLT_VEL_RIGHT=63;// lateral velocity, right ( calculated from angular and RSLT_GRANGE
publicstaticfinalintRSLT_VEL_RIGHT=64;// lateral velocity, right ( calculated from angular and RSLT_GRANGE
publicstaticfinalintRSLT_VEL_UP=64;// lateral velocity, up ( calculated from angular and RSLT_GRANGE
publicstaticfinalintRSLT_VEL_UP=65;// lateral velocity, up ( calculated from angular and RSLT_GRANGE
publicstaticfinalintRSLT_RANGE_LIN=65;// range linear interpolated using previous/next series if the same target is present there
publicstaticfinalintRSLT_RANGE_LIN=66;// range linear interpolated using previous/next series if the same target is present there
publicintcuas_num_cycles=25;// number of cycles of testing and removing bad targets // will get out earlier
publicintcuas_num_cycles=25;// number of cycles of testing and removing bad targets // will get out earlier
// Recalculate Motion Vectors before centered \"tracking camera\"
// Recalculate Motion Vectors before centered \"tracking camera\"
publicbooleancuas_recalc_mv=true;// Recalculate motion vectors before centered targets accumulation by masking far-from target areas
publicbooleancuas_recalc_mv=true;// Recalculate motion vectors before centered targets accumulation by masking far-from target areas
publicintcuas_recalc_mv_num=2;// Number of recalculations of the motion vectors before centered targets accumulation by masking far-from target areas
publicdoublecuas_recalc_mv_boost=4.0;// Scale default number of correlation pairs for motion vectors calculation
publicdoublecuas_recalc_mv_boost=4.0;// Scale default number of correlation pairs for motion vectors calculation
publicdoublecuas_recalc_mv_r0=2.0;// Masking window parameters: for r <= r0, w = 1.0
publicdoublecuas_recalc_mv_corr=4.0;// Scale corr_offset for refinement pass (will use (int)Math.round()
publicdoublecuas_recalc_mv_r1=6.0;// Masking window parameters: for r >= r1, w = 0.0, r0<r<r1: w = 0.5*(cos(PI*(r-r0)/(r1-r0))+1)
publicdoublecuas_recalc_mv_r0=2.0;// Masking window parameters: for r <= r0, w = 1.0, first (coarse) pass
publicdoublecuas_recalc_mv_r1=6.0;// Masking window parameters: for r >= r1, w = 0.0, r0<r<r1: w = 0.5*(cos(PI*(r-r0)/(r1-r0))+1), first (coarse) pass
publicdoublecuas_recalc_mv_r0f=1.5;// Masking window parameters: for r <= r0, w = 1.0, second (narrow) pass
publicdoublecuas_recalc_mv_r1f=4.0;// Masking window parameters: for r >= r1, w = 0.0, r0<r<r1: w = 0.5*(cos(PI*(r-r0)/(r1-r0))+1), second (narrow) pass
publicdoublecuas_recalc_mv_max2=0.2;// Maximal Vx,Vy corection for the fine pass (only if cuas_recalc_mv_num >= 2)
publicintcuas_mul_samples=3;// multiply number of samples in slow mode
publicintcuas_mul_samples=3;// multiply number of samples in slow mode
publicintcuas_mul_offset=5;// multiply correlation offset in slow mode
publicintcuas_mul_offset=5;// multiply correlation offset in slow mode
...
@@ -2749,14 +2754,24 @@ min_str_neib_fpn 0.35
...
@@ -2749,14 +2754,24 @@ min_str_neib_fpn 0.35
"Number of cycles of testing and removing bad targets from compoetition with weaker neighbors.");
"Number of cycles of testing and removing bad targets from compoetition with weaker neighbors.");
gd.addMessage("=== Recalculate Motion Vectors before centered \"tracking camera\" ===");
gd.addMessage("=== Recalculate Motion Vectors before centered \"tracking camera\" ===");
// if (properties.getProperty(prefix+"cuas_recalc_mv")!=null) this.cuas_recalc_mv=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_recalc_mv"));