Skip to content

feat(wasm): finalize calib3d bindings and tests#55

Merged
kalwalt merged 11 commits into
devfrom
feature/wasm-calib3d
May 9, 2026
Merged

feat(wasm): finalize calib3d bindings and tests#55
kalwalt merged 11 commits into
devfrom
feature/wasm-calib3d

Conversation

@kalwalt
Copy link
Copy Markdown
Member

@kalwalt kalwalt commented May 9, 2026

Description

This PR finalizes the WASM bindings for the calib3d module, enabling camera calibration and 3D geometry processing in WebAssembly environments.

Key Additions & Fixes

  • WASM Bindings: Successfully bound solvePnP, solvePnPRansac, findHomography, and rodrigues for JS/TS environments.
  • SolvePnPMethod: Corrected the enum mapping to match the core SolvePnPMethod variants.
  • Type-Safety: Implemented as_matrix_f64_mut in DynamicMatrix to allow safe, mutable memory access across the FFI boundary for Matrix<f64>.
  • Testing: Reconfigured and updated crates/wasm/tests/web.rs to validate calib3d functionalities using the Node.js test environment, constructing synthetic tests with non-coplanar points for numerical stability.
  • Documentation: Updated crates/wasm/README.md to indicate coverage of the calib3d module.

Closes #53

Copilot AI and others added 10 commits May 7, 2026 13:41
Agent-Logs-Url: https://github.com/webarkit/purecv/sessions/38005598-60bc-4ebd-967c-f0aa8ac3425f

Co-authored-by: kalwalt <1275858+kalwalt@users.noreply.github.com>
- Add robust error handling and strict flag checks in PnP
- Enforce 6-point minimum bounds for DLT PnP
- Normalize reprojection thresholds by focal lengths
- Improve singular matrix handling in undistort_points
- Add tests covering SVD, homography, and PnP functionality

Closes #51
- Fix SolvePnPMethod enum mapping for WASM bindings
- Provide type-safe access via DynamicMatrix enhancements
- Enable and update Node.js-based WASM integration tests
- Suppress too_many_arguments clippy warnings on exported WASM functions
- Update crates/wasm/README.md with new calib3d coverage
@kalwalt kalwalt self-assigned this May 9, 2026
@kalwalt kalwalt added documentation Improvements or additions to documentation enhancement New feature or request rust-code rust Pull requests that update rust code wasm tests calib3d-module labels May 9, 2026
@kalwalt kalwalt merged commit 67710d7 into dev May 9, 2026
3 checks passed
@kalwalt kalwalt deleted the feature/wasm-calib3d branch May 9, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calib3d-module documentation Improvements or additions to documentation enhancement New feature or request rust Pull requests that update rust code rust-code tests wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants