This repository was archived by the owner on Nov 22, 2026. It is now read-only.
Repository navigation
mojo-cv v0.1.2
mojo-cv v0.1.2
Released: 2026-11-04 · Commit: 935554f · Previous: v0.1.1
What it does
OpenCV-style computer vision in Mojo on the CPU, with 3D, CAD and calibration helpers. Each op is checked against cv2 5.0 (2D) or a numpy, brute-force or closed-form oracle (3D) on the same input. A library (from mojocv.imgproc import ...) and a command-line tool (mojo-cv OP OUT IN... [k=v] on .mcv files).
Highlights
StereoSGBMat 1080p with 128 disparities peaks at 1.5 GB instead of 11.7 GB, with the same output byte for byte.cvtColorBGR to RGB no longer writes into the next row for widths 9, 10, 17, 18, 25, 26, ...; the gray and
YCrCb paths no longer read past the row.- Malformed input raises an error instead of crashing: a
.mcvheader larger than its data, a short file, glb
accessors out of bounds, and mismatched arguments to remap, blobFromImage, HOGScores, Farneback flow, bfmatch and
knnmatch. - The package precompiles (
mojo precompile src/mojocv), so the conda recipe builds; it builds on Mojo 1.3
nightly too.
Changes
Added
recipe.yaml(conda packagemojo-cv),docs/design.md.
Changed
StereoSGBMkeeps one uint16 cost volume and rolling path rows;blockSizeabove 16 now raises.- The 3D command-line entry moves to
tools/cli3d.mojo(mojo build -I src tools/cli3d.mojo).
Fixed
cvtColorSIMD blocks stay inside their row (bgr2rgb, bgr2gray, rgb2gray, YCrCb).Mat.loadchecks the header size against the file before it allocates; a short.mcvfile or a missing argument
raises instead of aborting.Rng.sampleraises when n < k instead of looping forever.thresholdsaturatesmaxvalto the dtype's range.ransac_itersreturns the cap when the inlier share vanishes (it returned a large negative number).remap,blobFromImage,HOGScores,calcOpticalFlowFarneback,bfmatchandknnmatchcheck their
inputs' shapes and raise on a mismatch.- glb accessor bounds cannot wrap.
- Builds on Mojo 1.3.0.dev2026110305 as well as 1.2.0.
Verified
| Check | Result |
|---|---|
ci-local: the GitHub workflow in a clean Ubuntu 24.04 container, Mojo 1.2.0, MAX 26.7.0 |
PASS |
Known limits
StereoSGBMacceptsblockSizeup to 16.- As in v0.1.0 otherwise.
Upgrade / run
uv sync
mojo build -I src tools/cli3d.mojo -o cli3d # was: the entry inside src/mojocv/cli3d.mojo
Commits
935554ffix(release): pyproject.toml, recipe.yaml, uv.lock say 0.1.2bda27c7docs: design.md, recipe.yaml, oracle packages in the dev groupea82689fix(cv): main() moves out of the package into tools/cli3d.mojof4722f9ci(cv): run tests/ransac_iters.mojo in the gate40d097dfix(cv): ransac_iters uses log1p so a vanishing inlier share gives the cap412b7b9fix(cv): threshold saturates maxval to the dtype range1ae86effix(cv): bfmatch and knnmatch raise on descriptors of different width9c59fe3fix(cv): calcOpticalFlowFarneback checks the frames' shape and channelseacc957fix(cv): HOGScores raises unless the svm holds 3781 floats855aff2fix(cv): blobFromImage raises when mean has fewer values than channels1b7847ffix(cv): remap raises when the two maps differ in shapeffeffd6build: mojo-upgrade gives src/main.mojo 240 s191ce15fix: build on Mojo 1.3 nightly3fe3034perf(cv): StereoSGBM peak RSS 11.7 GB -> 1.5 GB at 1080p/128, output unchangedba088fcci(cv): run tools/malformed_check.py in the gate4c2c81dchore(cv): delete polar_rotation, Js.count and a redundant clause; version 0.1.14d1017efix(cv): glb accessor bounds cannot wrapf52b18efix(cv): Rng.sample raises when n < k instead of looping forever24f635cfix(cv): a short .mcv file or a missing input argument raises instead of aborting1147350fix(cv): Mat.load checks the header size before it allocates9e24054fix(cv): cvtColor SIMD blocks stay inside their row514e610docs: CI, latest-release and license badges