Commit e4e65e23 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: CuasRender - disparity defined for ALL tiles (conditionDisparityCuas)

Per Andrey: the sky has nothing to match but is the BACKGROUND FOR DRONES -
it must render (at infinity), NaN acceptable only outside the image.

Root of the NaN tiles in -CUAS-RT-RENDER: use_lma_dsi=true selected the LMA
DSI slice, which is NaN wherever the LMA did not fit (the whole sky) ->
tiles dropped from the task list. The plain slice has no NaN but carries
garbage (crazy < -1 tiles in the sky, negatives near the sign post).

Fix: NEW static QuadCLT-free conditionDisparityCuas() (the legacy
conditionInitialDS takes a QuadCLT instance - out per the RT rules):
plain slice 0, NaN -> 0.0 (infinity), negatives -> 0.0. testRenderSequence
now uses it unconditionally (not gated by use_lma_dsi - that gate is for
the pose measurement, not rendering).

Verified: mvn -DskipTests clean package OK.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 48c93f00
......@@ -66,6 +66,27 @@ import ij.ImageStack;
public class CuasRender {
public static final double [] ZERO3 = {0.0, 0.0, 0.0};
/**
* CUAS disparity conditioning for RENDERING (static, QuadCLT-free - the legacy
* conditionInitialDS takes a QuadCLT instance and is out per the RT rules).
* Requirements (Andrey 2026-07-05): disparity must be DEFINED FOR ALL TILES - the
* sky has nothing to match but is the background for drones, so it renders at
* infinity (disparity 0); NaN is acceptable only outside the image. The raw plain
* DSI slice has no NaN but carries garbage (crazy tiles < -1 in the sky, negatives
* near high-contrast posts) - all non-physical: clamp to >= 0.
* @param disparity plain disparity (slice 0 of -INTER-INTRA-LMA), NOT the LMA slice
* (which is NaN wherever the LMA did not fit - the whole sky)
* @return conditioned copy: NaN -> 0.0 (infinity), negatives -> 0.0
*/
public static double [] conditionDisparityCuas(final double [] disparity) {
final double [] cond = new double [disparity.length];
for (int i = 0; i < disparity.length; i++) {
final double d = disparity[i];
cond[i] = (Double.isNaN(d) || (d < 0.0)) ? 0.0 : d;
}
return cond;
}
/**
* Render ONE scene (already ingested to the GPU by CuasConditioning.conditionSceneToGpu)
* on the virtual-camera uniform grid at the given (borrowed or fitted) pose.
......@@ -221,12 +242,14 @@ public class CuasRender {
final QuadCLT [] quadCLTs,
final int debugLevel) {
final int margin = clt_parameters.imp.margin;
final boolean use_lma_dsi = clt_parameters.imp.use_lma_dsi;
final boolean is_aux = center_CLT.isAux();
final double [][] center_dsi = center_CLT.dsi;
final double [] disparity = center_dsi[is_aux ? TwoQuadCLT.DSI_DISPARITY_AUX : TwoQuadCLT.DSI_DISPARITY_MAIN];
final double [] disparity_lma = center_dsi[is_aux ? TwoQuadCLT.DSI_DISPARITY_AUX_LMA : TwoQuadCLT.DSI_DISPARITY_MAIN_LMA];
final double [] center_disparity = (use_lma_dsi && (disparity_lma != null)) ? disparity_lma : disparity;
// RENDERING disparity: the PLAIN slice conditioned to be defined for ALL tiles
// (sky = infinity/0). Deliberately NOT gated by use_lma_dsi: the LMA slice is NaN
// wherever the LMA did not fit (the whole sky) and would drop those tiles from the
// render. By Claude on 07/05/2026, per Andrey.
final double [] center_disparity = conditionDisparityCuas(
center_dsi[is_aux ? TwoQuadCLT.DSI_DISPARITY_AUX : TwoQuadCLT.DSI_DISPARITY_MAIN]);
final ErsCorrection ers_center = center_CLT.getErsCorrection();
final ImageDtt image_dtt = new ImageDtt(
center_CLT.getNumSensors(),
......
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