Comprehensive camera models and 3D coordinate transformation library for MoonBit
import {
"cxh04/moonbit_camera_models/src/camera",
"cxh04/moonbit_camera_models/src/math",
}let camera = @camera.PinholeCamera::new(
800.0, 800.0, 640.0, 360.0, 1280.0, 720.0,
)
let point = @math.Vec3::new(1.0, -0.5, 4.0)
let projection = camera.project(point)
let recovered = camera.unproject(projection.pixel, projection.depth)moon run src/cmd/main -- help
moon run src/cmd/main -- info
moon run src/cmd/main -- project
moon run src/cmd/main -- unproject
moon run src/cmd/main -- bench 10000moonbit-camera-models/
├── moon.mod
├── README.md -> README.mbt.md
├── src/
│ ├── math/ vector, matrix, decomposition, solver, and SE(3) math
│ ├── distortion/ lens models and remap LUTs
│ ├── camera/ projection/unprojection models and stereo rigs
│ ├── geometry/ epipolar geometry, PnP, rectification, triangulation
│ ├── calibration/ targets, metrics, losses, and optimization
│ ├── datasets/ real-camera presets and synthetic generators
│ ├── io/ COLMAP, JSON, and OpenCV serialization
│ ├── benchmarks/ measured performance and precision workloads
│ ├── lib/ small high-level facade helpers
│ └── cmd/main/ runnable CLI
└── .github/workflows/ check.yml and publish.ymlGet-ChildItem src -Recurse -Filter *.mbt |
Where-Object { $_.Name -notmatch '(_test|_wbtest|boundary_test|verification_table|grid_tables|feature_tables|batch_\d+_verification)\.mbt$' } |
Get-Content | Measure-Object -Linemoon run src/cmd/main -- bench 10000operation,samples,elapsed_us,operations_per_second,checksum
pinhole_projection,10000,3300.2000000000003,3030119.386703836,9693982.740837783
fisheye_projection,10000,3735.1,2677304.4898396297,9929626.307089247moon fmt --check
moon check --deny-warn --target all
moon test --deny-warn --target allmoon login
moon publishComprehensive camera models and 3D coordinate transformation library for MoonBit