Skip to content

Load real camera calibration from camera_para.dat (ARParam)#41

Draft
kalwalt wants to merge 1 commit into
webarkit:devfrom
kalwalt:feat/camera-para-dat-loading
Draft

Load real camera calibration from camera_para.dat (ARParam)#41
kalwalt wants to merge 1 commit into
webarkit:devfrom
kalwalt:feat/camera-para-dat-loading

Conversation

@kalwalt

@kalwalt kalwalt commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary (DRAFT / exploratory)

Adds optional loading of real camera calibration from an ArtoolkitX
camera_para.dat (ARParam) buffer, instead of the synthetic 70°-FOV defaults.

  • WebARKitCamera::loadCameraParamFromBuffer: arParamLoadFromBuffer
    arParamChangeSize(w,h) → fill K (first 3 cols of the 3×4 mat) + distortion
    (v4: k1,k2,p1,p2,k3=0; v5: copied directly).
  • WebARKitTracker::loadCameraParam: refresh m_camMatrix, m_distortionCoeff
    and m_cameraProjectionMatrix from the loaded ARParam.

Requires the minimal AR param sources to be compiled (done downstream in
webarkit-testing makem.js: paramFile.c, paramChangeSize.c, ARUtil/log.c).

Verified

End-to-end via the webarkit-testing static Teblid example: the projection
switches to the real fx/fy + a non-zero principal-point offset (proof the real
calibration is applied); tracking is unaffected.

Status

Exploratory / draft. Orthogonal to the orientation-handedness issue (#35)
this improves the lens model but does not fix the mirror. Opening for
record/discussion; may not be merged as-is.

Refs: #35

…ram)

Load real camera calibration from an ArtoolkitX camera_para.dat buffer
instead of the synthetic 70-degree-FOV defaults:

- WebARKitCamera::loadCameraParamFromBuffer: arParamLoadFromBuffer ->
  arParamChangeSize(w,h) -> fill intrinsic matrix (K = first 3 columns of the
  calibrated 3x4 mat) and distortion (v4: k1,k2,p1,p2,k3=0; v5: copied direct).
- WebARKitTracker::loadCameraParam: refresh m_camMatrix, m_distortionCoeff and
  the GL projection (m_cameraProjectionMatrix) from the loaded ARParam.

Verified end-to-end downstream: the projection changes to the real calibration
(fx/fy + non-zero principal-point offset) and tracking is unaffected.

Refs: webarkit#35

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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