Commit f40ebaa0 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: rename tile-selection calibration -POSE-RT-MAXDXY -> -POSE-RT-TILE-CALIB

Per Andrey: the name must make it obvious this is a CALIBRATION file that has
to be preserved with the model (reliable_tiles are derived from it). New saves
use -POSE-RT-TILE-CALIB; the old -POSE-RT-MAXDXY is still read as a fallback,
so existing model dirs keep working. Tooltips/comments updated.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent a65cd04a
......@@ -77,6 +77,11 @@ import ij.process.FloatProcessor;
*/
public class CuasPoseRT {
public static final double [] ZERO3 = {0.0, 0.0, 0.0};
// Tile-selection CALIBRATION file (name says so - it must be PRESERVED with the model:
// per-tile max-over-scenes residual, NaN = unusable; reliable_tiles are derived from it).
// Renamed from -POSE-RT-MAXDXY per Andrey 07/05/2026; old name still read as fallback.
public static final String TILE_CALIB_SUFFIX = "-POSE-RT-TILE-CALIB";
public static final String TILE_CALIB_SUFFIX_OLD = "-POSE-RT-MAXDXY";
// Per-scene measurement characterization slices of the -POSE-RT-HYPER stack
// (z = scenes, t = components, matching the renderSceneSequence make_hyper convention).
// dx,dy,strength from coord_motion[1] (vector_XYS); the eigen four from coord_motion[2]
......@@ -97,7 +102,7 @@ public class CuasPoseRT {
/**
* Derive the tile selection from the per-tile max-residual calibration array
* (-POSE-RT-MAXDXY: max over scenes of measured dxy; NaN = unusable - either not
* (-POSE-RT-TILE-CALIB: max over scenes of measured dxy; NaN = unusable - either not
* selected/measured or NaN in at least one scene, always rejected). Stages (all
* scale-free, no absolute pixel constants):
* 1 - robust outlier gate: keep finite values <= median + k_nmad*NMAD of the
......@@ -287,13 +292,16 @@ public class CuasPoseRT {
System.out.println("CuasPoseRT.testPoseSequence(): num_reliable="+num_reliable+
" (strength > "+min_str+")");
}
// Automatic FPN-style calibration reuse: if -POSE-RT-MAXDXY exists (and not forced to
// Automatic FPN-style calibration reuse: if -POSE-RT-TILE-CALIB exists (and not forced to
// recalc), derive the selection from it (per-tile max residual; NMAD outlier gate +
// rank-N budget) and AND with the strength mask - a filtered run. Otherwise run FULL
// (all strength-selected tiles) and generate the calibration at the end.
boolean full_selection = true; // MAXDXY calibration is (re)saved only from a full-selection run
final ImagePlus imp_max = clt_parameters.imp.curt_pose_recalc ? null :
center_CLT.readImagePlusFromModelDirectory("-POSE-RT-MAXDXY");
boolean full_selection = true; // the tile calibration is (re)saved only from a full-selection run
ImagePlus imp_max = clt_parameters.imp.curt_pose_recalc ? null :
center_CLT.readImagePlusFromModelDirectory(TILE_CALIB_SUFFIX);
if ((imp_max == null) && !clt_parameters.imp.curt_pose_recalc) { // legacy name fallback
imp_max = center_CLT.readImagePlusFromModelDirectory(TILE_CALIB_SUFFIX_OLD);
}
if (imp_max != null) {
final float [] fmax = (float []) imp_max.getProcessor().getPixels();
final boolean [] filt = deriveSelection(
......@@ -308,11 +316,11 @@ public class CuasPoseRT {
if (reliable_ref[i]) num_filt++;
}
full_selection = false;
System.out.println("CuasPoseRT.testPoseSequence(): reusing -POSE-RT-MAXDXY calibration, filtered to "+
System.out.println("CuasPoseRT.testPoseSequence(): reusing "+TILE_CALIB_SUFFIX+" calibration, filtered to "+
num_filt+" tiles (of "+num_reliable+" by strength)");
} else {
System.out.println("CuasPoseRT.testPoseSequence(): "+
(clt_parameters.imp.curt_pose_recalc ? "curt_pose_recalc ON" : "-POSE-RT-MAXDXY not found")+
(clt_parameters.imp.curt_pose_recalc ? "curt_pose_recalc ON" : TILE_CALIB_SUFFIX+" not found")+
" - FULL run, will generate the calibration");
}
final double [][] pXpYD_center = OpticalFlow.transformToScenePxPyD(
......@@ -579,7 +587,7 @@ public class CuasPoseRT {
new FloatProcessor(tilesX, tilesY, frel));
center_CLT.saveImagePlusInModelDirectory(null, imp_rel); // title as filename
}
// -POSE-RT-MAXDXY calibration: per-tile max-over-scenes residual, +inf where any
// -POSE-RT-TILE-CALIB calibration (was -POSE-RT-MAXDXY): per-tile max-over-scenes residual, +inf where any
// scene was NaN (auto-reject and mergeable across runs by simple max), NaN where
// not selected/measured. Saved only from a FULL-selection run so a filtered run
// never shrinks the calibration coverage. The derived boolean selection is also
......@@ -601,7 +609,7 @@ public class CuasPoseRT {
fmax[i] = (has_nan || !has) ? Float.NaN : mx;
}
center_CLT.saveImagePlusInModelDirectory(null, new ImagePlus(
center_CLT.getImageName()+"-POSE-RT-MAXDXY", new FloatProcessor(tilesX, tilesY, fmax)));
center_CLT.getImageName()+TILE_CALIB_SUFFIX, new FloatProcessor(tilesX, tilesY, fmax)));
final boolean [] keep = deriveSelection(
fmax,
tilesX,
......
......@@ -1131,7 +1131,7 @@ min_str_neib_fpn 0.35
public double curt_pose_str = 1.0; // reliable-tile strength threshold over the combo-DSI strength for the pose test tile selection (1.0 ~ old getReliableTiles population). // By Claude on 07/03/2026
public double curt_pose_dxy_k = 0.75; // tile-selection outlier gate: keep tiles with max-over-scenes residual <= median + k*NMAD of the finite per-tile maxes (scale-free - adapts to footage quality/sequence length; NaN-in-any-scene = +inf, always rejected). <=0 - skip the gate. // By Claude on 07/04/2026
public int curt_pose_num_tiles = 150; // tile-selection compute budget: after the gate, keep this many BEST (smallest max-residual) tiles; threshold-free rank - always yields the best available population. <=0 - no cap. // By Claude on 07/04/2026
public boolean curt_pose_recalc = false; // force a FULL-selection pose run that regenerates the -POSE-RT-MAXDXY calibration even if it exists. Default (false): automatic FPN-style reuse - if -POSE-RT-MAXDXY exists, derive the selection from it (NMAD gate + rank-N) and use it; if not, run full and generate it. // By Claude on 07/04/2026
public boolean curt_pose_recalc = false; // force a FULL-selection pose run that regenerates the -POSE-RT-TILE-CALIB calibration even if it exists. Default (false): automatic FPN-style reuse - if -POSE-RT-TILE-CALIB exists, derive the selection from it (NMAD gate + rank-N) and use it; if not, run full and generate it. // By Claude on 07/04/2026
public boolean curt_pose_raw = false; // phase A2 ingest: per scene read RAW /jp4/, condition with the current calibration (CuasConditioning: rowcol + photometric + FPN) and FORCE-upload straight to the GPU, bypassing the QuadCLT prepared image_data (which carries the old broken Photogrammetric Calibration). Judge by own dstored quality, not agreement with phase A. // By Claude on 07/05/2026
//=== LoG prefilter ===
public double curt_psf_radius = 1.0; // sensor PSF radius for LoG pre-filter
......@@ -3431,7 +3431,7 @@ min_str_neib_fpn 0.35
gd.addNumericField("Pose test number of best tiles", this.curt_pose_num_tiles, 0,7,"", // By Claude on 07/04/2026
"After the gate keep this many best (smallest max-residual) tiles - the RT compute budget. <=0 - no cap.");
gd.addCheckbox ("Pose test force recalc calibration", this.curt_pose_recalc, // By Claude on 07/04/2026
"Force a FULL pose run that regenerates -POSE-RT-MAXDXY even if it exists. Default OFF = automatic reuse: use the calibration if present (filtered run), else run full and generate it.");
"Force a FULL pose run that regenerates -POSE-RT-TILE-CALIB even if it exists. Default OFF = automatic reuse: use the calibration if present (filtered run), else run full and generate it.");
gd.addCheckbox ("Pose test raw-jp4 ingest (A2)", this.curt_pose_raw, // By Claude on 07/05/2026
"Per scene: read RAW /jp4/, condition with the CURRENT calibration (rowcol+photometric+FPN, CuasConditioning) and force-upload straight to the GPU, bypassing the prepared image_data (old broken Photogrammetric Calibration).");
......
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