Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Migrating to 0.18.0

Breaking for Rust callers of the facade. The detect_* and blur functions borrow a GrayImageView instead of taking an image::GrayImage, and the five detect_*_best sweeps share one set of rules. The Python and WASM detection calls keep their signatures; only the sweep error behaviour changes there.

Labels change in two ways (see the CHANGELOG): dense, strongly distorted chessboards gain corners, and a ChArUco fragment is merged only when its geometry agrees with the rest of the board.

The facade takes &GrayImageView

Every calib_targets::detect::* and calib_targets::blur::* function that took &image::GrayImage now takes &GrayImageView<'_>. Borrow your image with detect::gray_view — no copy is made:

// Before
let det = calib_targets::detect::detect_chessboard(&img, &chess_cfg, &params);

// After
use calib_targets::detect::{detect_chessboard, gray_view};
let det = detect_chessboard(&gray_view(&img), &chess_cfg, &params);

Raw buffers: detect::gray_image_from_slice(w, h, &px) is replaced by detect::gray_view_from_slice(w, h, &px), which borrows px. A zero width or height is now rejected as DetectError::InvalidGrayDimensions (it used to run and miss); the detect_*_from_gray_u8 helpers inherit this.

detect and blur no longer need the image feature. With default-features = false you build GrayImageView yourself; the image feature only adds gray_view, preprocess and the image re-export, and it no longer pulls in chess-corners.

detect_*_best sweeps

All five sweeps (detect_chessboard_best, detect_charuco_best, detect_puzzleboard_best, detect_puzzlepole_best, detect_marker_board_best) follow one contract:

Situation0.170.18
Empty config lista miss (NoDetection, CharucoDetect(NoMarkers), …)DetectError::EmptySweep { op } (misuse, is_not_found() == false)
An invalid config in the listskippedthe sweep stops and returns that error
Two configs tie on the scorechessboard / marker board: last wins; others: first winsfirst wins everywhere

Order sweep presets by preference: the earlier config wins a tie. Match on DetectError::EmptySweep if you build config lists dynamically (the enum is #[non_exhaustive], so existing _ arms keep compiling).

Python / WASM: detect_*_best(image, []), or a list containing an invalid config, now raises ValueError / throws instead of returning None / null.

Smaller changes

  • MarkerBoardDetector::new returns MarkerBoardParamsError; the facade reports it as DetectError::MarkerBoardParams (was DetectError::ChessboardParams).
  • ChArUco MarkerDetection::score is exp(mean bit log-likelihood) in (0, 1] (it was a sigmoid that never exceeded 0.5). Re-check any threshold you apply to it.
  • PuzzlePoleDetector::new refuses min_circumference_span < 5 or min_axial_span < 8 (PuzzlePoleDetectError::WindowBelowFloor): smaller windows admit placements that provably alias.
  • calib_targets_core::axis_estimate_to_next(axis) → LocalAxis::from(axis).
  • Binaries behind features: cargo run -p calib-targets-puzzleboard --features tools --bin … for the code-map tools, --features package-archive for the FFI package-release-archive.
  • projective-grid 0.15: expert::lattice::GRID_TRANSFORMS_D4 is removed in favour of D4_TRANSFORMS, which now has that order. Code that indexes D4_TRANSFORMS[k] directly gets a different transform for k = 1, 3. calib_targets_core::GRID_TRANSFORMS_D4 keeps its values and order.

Migrating to 0.17.0

Breaking only for rarely used Rust surface. 0.17.0 removes three items that nothing in the workspace used. Code that calls the detect_* functions or the detectors, and reads their results, needs no change. The Python package, the WASM package and the C ABI (6.0.3, no type or layout change) have no API change.

Labels change in one way: frames that used to deliver wrong labels on boards blurred past readability now decline (see the CHANGELOG).

RectifiedView and RectToImgMapper are gone from calib-targets-core

They were result carriers that no function in the workspace produced. The chessboard crate builds rectified views and returns its own types:

NeedCallReturns
One homography for the whole board (negligible lens distortion)calib_targets_chessboard::rectify_from_chessboard_result(&view, &detection, px_per_square, margin_squares)RectifiedBoardView (rect, h_img_from_rect, h_rect_from_img, grid extent)
A per-cell homography mesh (tolerates lens distortion)calib_targets_chessboard::rectify_mesh_from_grid(&view, &corners, &inliers, px_per_square)RectifiedMeshView (rect, origin, cells_x, cells_y, …)

Both are reachable through the facade as calib_targets::chessboard::…. A RectToImgMapper::Global { h_img_from_rect } corresponds to RectifiedBoardView::h_img_from_rect; a RectToImgMapper::Mesh to a RectifiedMeshView.

square_predict_grid_position is gone

It forwarded to projective-grid’s lattice predictor. Call the predictor directly (this needs projective-grid as a dependency of your own) and read the prediction’s position:

// Before
use calib_targets_core::square_predict_grid_position;
let p = square_predict_grid_position(&grid, idx);

// After
use projective_grid::{expert::lattice::predict_grid_position, LatticeKind};
let p = predict_grid_position(&grid, idx, LatticeKind::Square).map(|pred| pred.position);

The prediction also carries n_axis_pairs, the number of complete opposite neighbour pairs it averages.

The chessboard crate’s dataset feature is gone

calib-targets-chessboard/dataset enabled diagnostics and an unused dependency. Enable diagnostics instead:

calib-targets-chessboard = { version = "0.17", features = ["diagnostics"] }