Commit 0868da8a authored by Andrey Filippov's avatar Andrey Filippov

Claude: Demote INDX_VX/VY/STRENGTH/FRAC to method-local constants

These four constants described the layout of TDCorrTile.getMismatchVector()
return values and had no business being class-level statics in CuasMotion.
Moved to local scope in the two methods that use them: getTargetsFromCorr2d
and refineMotionVectors.
Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent 115acc78
...@@ -46,10 +46,6 @@ public class CuasMotion { ...@@ -46,10 +46,6 @@ public class CuasMotion {
final public static String CLEAN_SUFFIX = "-CLEAN"; final public static String CLEAN_SUFFIX = "-CLEAN";
final static public int MAX_ALT_TARGETS = 100; // convenient to be power of 10 final static public int MAX_ALT_TARGETS = 100; // convenient to be power of 10
final static private int INDX_VX = 0;
final static private int INDX_VY = 1;
final static private int INDX_STRENGTH = 2;
final static private int INDX_FRAC = 3;
final static public String LEGEND_TITLE = "Legend"; final static public String LEGEND_TITLE = "Legend";
final static public String[] ICON_DESCRIPTIONS = { final static public String[] ICON_DESCRIPTIONS = {
"Identified UAS", "Identified UAS",
...@@ -1933,13 +1929,15 @@ public class CuasMotion { ...@@ -1933,13 +1929,15 @@ public class CuasMotion {
fat_zero * scale_fat_zero, // *scale_fat_zero, // final double gpu_fat_zero, fat_zero * scale_fat_zero, // *scale_fat_zero, // final double gpu_fat_zero,
debugLevel); // final int debug_level debugLevel); // final int debug_level
// Indices into TDCorrTile.getMismatchVector() result {vx, vy, strength, fraction} // By Claude on 05/08/2026
final int INDX_VX = 0, INDX_VY = 1, INDX_STRENGTH = 2, INDX_FRAC = 3;
double [][] vector_field = TDCorrTile.getMismatchVector( // full tiles in gpu (512*512) double [][] vector_field = TDCorrTile.getMismatchVector( // full tiles in gpu (512*512)
corr_tiles_pd, // final double[][] tiles, corr_tiles_pd, // final double[][] tiles,
rstr, // double rmax, rstr, // double rmax,
cent_radius, // final double centroid_radius, // 0 - all same weight, > 0 cosine(PI/2*sqrt(dx^2+dy^2)/rad) cent_radius, // final double centroid_radius, // 0 - all same weight, > 0 cosine(PI/2*sqrt(dx^2+dy^2)/rad)
n_recenter, // final int n_recenter); // re-center window around new maximum. 0 -no refines (single-pass) n_recenter, // final int n_recenter); // re-center window around new maximum. 0 -no refines (single-pass)
true); // final boolean calc_fraction ){ // calculate fraction inside center circle true); // final boolean calc_fraction ){ // calculate fraction inside center circle
for (int ntile = 0; ntile < num_tiles; ntile++) if (vector_field[ntile] != null){ for (int ntile = 0; ntile < num_tiles; ntile++) if (vector_field[ntile] != null){
double [] target = CuasMotionLMA.getEmpty(); double [] target = CuasMotionLMA.getEmpty();
// Store the raw displacement over one correlation-pair separation // Store the raw displacement over one correlation-pair separation
...@@ -2169,6 +2167,8 @@ public class CuasMotion { ...@@ -2169,6 +2167,8 @@ public class CuasMotion {
corr2d_ref[nseq] = corr_tiles_pd; corr2d_ref[nseq] = corr_tiles_pd;
} }
// Indices into TDCorrTile.getMismatchVector() result {vx, vy, strength, fraction} // By Claude on 05/08/2026
final int INDX_VX = 0, INDX_VY = 1;
double[][] vector_field = TDCorrTile.getMismatchVector( double[][] vector_field = TDCorrTile.getMismatchVector(
corr_tiles_pd, corr_tiles_pd,
-rstr, // rmax < 0: no relative-strength filter (same convention as getTargetsFromCorr2d) -rstr, // rmax < 0: no relative-strength filter (same convention as getTargetsFromCorr2d)
......
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