Commit bbeda27e authored by Andrey Filippov's avatar Andrey Filippov

docs: Add Gemini notes on NaN disparity handling upon correlation failure

parent d260d3de
...@@ -19,3 +19,16 @@ Verify if `execCorr2D_normalize` (or the downstream CPU equivalent if GPU falls ...@@ -19,3 +19,16 @@ Verify if `execCorr2D_normalize` (or the downstream CPU equivalent if GPU falls
--- ---
### [2026-04-24] Missing Peak Fallback (Gemini)
**Location:** `CuasRanging.java`, method: `rangeSingleTarget()`
**Observation:**
If the integrated correlation fails (e.g., peak drowned out by the potential double-normalization bug), `disp_diff` evaluates to `NaN`. Because `use_non_lma` is `false`, it doesn't fall back to Center-of-Mass (CM) disparity. The method returns `null`, abruptly aborting the refinement loop for that segment.
This causes the outer calling function to potentially log or retain `0.0` or `NaN` for `RSLT_GDISPARITY` (Global Disparity), rather than properly recording a failed integration or utilizing the un-refined initial disparity.
**Action Required:**
Check if returning `null` on failed refinement is the intended behavior, or if the system should persist the initial (single-frame) disparity into the `RSLT_GDISPARITY` field rather than zeroing it out when integration fails.
---
...@@ -1037,6 +1037,12 @@ public class CuasRanging { ...@@ -1037,6 +1037,12 @@ public class CuasRanging {
disp_diff = disparity_map[ImageDtt.DISPARITY_INDEX_CM][ref_tile]; disp_diff = disparity_map[ImageDtt.DISPARITY_INDEX_CM][ref_tile];
str = disparity_map[ImageDtt.DISPARITY_INDEX_CM+1][ref_tile]; str = disparity_map[ImageDtt.DISPARITY_INDEX_CM+1][ref_tile];
} }
/*
* [Gemini Note, 2026-04-24]: If correlation fails (e.g. due to double-normalization destroying the peak),
* disp_diff is NaN. If use_non_lma is false, disp_diff remains NaN, and the function returns null here,
* meaning the loop exits. This causes target[CuasMotionLMA.RSLT_GDISPARITY] to likely retain a
* zero/NaN value depending on caller initialization.
*/
if (Double.isNaN(disp_diff)) { if (Double.isNaN(disp_diff)) {
System.out.println ("rangeSingleTarget(): Failed to range target #"+target_id+" for sequence "+ first_seq+" ("+ref_tileX+":"+ref_tileY+")."); System.out.println ("rangeSingleTarget(): Failed to range target #"+target_id+" for sequence "+ first_seq+" ("+ref_tileX+":"+ref_tileY+").");
return null; return null;
......
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