Skip to content

Wire camera_para.dat loading (real camera calibration)#34

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

Wire camera_para.dat loading (real camera calibration)#34
kalwalt wants to merge 1 commit into
devfrom
feat/camera-para-dat-loading

Conversation

@kalwalt

@kalwalt kalwalt commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary (DRAFT / exploratory)

End-to-end wiring to load real camera calibration from camera_para.dat into
the static Teblid example. Depends on webarkit/WebARKitLib#41.

  • tools/makem.js: compile the minimal AR param sources (paramFile.c,
    paramChangeSize.c, ARUtil/log.c) needed by arParamLoadFromBuffer.
  • emscripten/WebARKitJS + bindings.cpp: expose WebARKit::loadCameraParam(bytes).
  • src/WebARKitController.js: loadCameraParam(buffer) wrapper.
  • examples/worker_threejs.js: optional loadCameraParam from the initTracker
    message (guarded — no effect on other examples).
  • examples/threejs_static_image_worker_ES6.js: fetch data/camera_para.dat
    and pass it.
  • examples/data/camera_para.dat: sample calibration; rebuilt build/ + dist/;
    submodule bumped.

Verified

Console shows loadCameraParam: real camera_para.dat loaded, the projection
switches to the real fx/fy + non-zero principal-point offset, and tracking is
unaffected (cube still renders).

Status & caveats

  • Exploratory / draft. Orthogonal to the orientation issue (WebARKitLib#35);
    improves the lens model but does not fix the mirror, so likely not merged as-is.
  • The example file also still contains in-progress orientation work (the
    found() Y-row + Z-column correction, markerFrame, and debug cube/axes).
  • Submodule pointer references the fork branch (WebARKitLib#41); it must merge
    first for the pointer to resolve on canonical.

Refs: webarkit/WebARKitLib#35, webarkit/WebARKitLib#41

End-to-end real-camera-calibration loading for the static example:
- tools/makem.js: compile the minimal AR param files (paramFile.c,
  paramChangeSize.c, ARUtil/log.c) needed by arParamLoadFromBuffer.
- emscripten/WebARKitJS + bindings: expose WebARKit::loadCameraParam(bytes).
- src/WebARKitController.js: loadCameraParam(buffer) wrapper.
- examples/worker_threejs.js: optional loadCameraParam from the initTracker
  message (guarded; no effect on other examples).
- examples/threejs_static_image_worker_ES6.js: fetch data/camera_para.dat and
  pass it; also still contains in-progress orientation work (found() Y-row +
  Z-column correction, markerFrame, debug cube/axes) -- WIP.
- examples/data/camera_para.dat: sample calibration.
- Bump emscripten/WebARKitLib submodule to the loadCameraParamFromBuffer commit.
- Rebuilt build/ + dist/ artifacts.

Exploratory: validates the calibration path end-to-end (projection switches to
the real fx/fy + non-zero principal point). Orthogonal to the orientation /
handedness issue (WebARKitLib#35) and does not resolve it on its own.

Refs: webarkit/WebARKitLib#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