Skip to content

Moh native float experiment#3

Merged
dmitriy-myz merged 2 commits into
moh-opencv-cleanupfrom
moh-native-float-experiment
Jun 11, 2026
Merged

Moh native float experiment#3
dmitriy-myz merged 2 commits into
moh-opencv-cleanupfrom
moh-native-float-experiment

Conversation

@dmitriy-myz

Copy link
Copy Markdown
Owner

No description provided.

dmitriy-myz and others added 2 commits June 11, 2026 10:58
Replace the bit-exact x86 fixed-point emulation in the MoH feature
pipeline with readable native Python/NumPy float math, to test whether a
non-byte-exact template still enrolls and matches on the 06cb:00a2 sensor.

- DoH front-end: real exp-Gaussian + central-diff/[1,2,1] kernels, float
  separable convolution; response rescaled by a fitted RESP_SCALE=17.04 so
  the existing NMS thresholds (t_lo/t_hi) stay valid.
- subpix: numpy.linalg.solve 2x2 Newton step (was Cramer/SAR).
- orientation: math.atan2 + plain binning (was fast_atan2 magic polys).
- descriptor: float cos/sin rotation + plain window sums.
- Dropped: _s32/_sar32/_imul32/_idiv32, EXP_TABLE, COS_Q16/SIN_Q16,
  gauss_tap, build_3tap, the atan2/angle-bin magic, and ~430 lines of dead
  RE scaffold (Minutia/FrameContext/orchestrate/EnrollmentSession/stage_*).
- Byte-format/framing (serialize_v30_section, merge, scaffold, TID,
  envelope) and all public signatures are unchanged.

1659 -> 671 lines. Verified: imports, end-to-end extract_frame_native +
native_template (23136B envelope, TID round-trips). Calibration in
dev/calib_resp_scale.py; design in docs/superpowers/specs/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Drop the now-unused logging import/binding (its only consumer,
  extract_features, was removed in the float rewrite).
- Comment desc_sample_rotate's off-tile 0.0 gradient fill (natural-units
  equivalent of the DLL's mid-gray; flat extension => zero gradient).
- Add tests/test_moh_native_smoke.py: guards the chip-parsed framing path
  (keypoint bounds, v30 record layout, 23136B envelope, TID round-trip,
  subpix rejection) without pinning byte-exact output.
- Remove the brainstorming design doc.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dmitriy-myz dmitriy-myz merged commit 480788c into moh-opencv-cleanup Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant