Calibration API
Camera calibration from planar targets: the 1-D radial camera and its minimal solver, intrinsics from homographies (zhang_intrinsics), and each lens's honest view-angle domain. The iterative calibration built on them — the radial camera's fit, the division-camera focal stack, lens-model regression — lives in VisualGeometryToolkitEstimation. Split from the Cameras API page. See the Cameras guide.
Radial Camera, Intrinsics
RadialCamera(::PosedCamera) is exact only for a radially symmetric lens; which lenses are is Core's camera trait RadialSymmetry (RadiallySymmetric() / RadiallyAsymmetric(), public, not exported: reached as VisualGeometryToolkitCore.Cameras.RadialSymmetry). It fails closed: a lens type that has not declared itself symmetric is treated as asymmetric.
VisualGeometryToolkitCore.Cameras.RadialCamera — Type
RadialCamera{T}The 1-D radial camera of one planar board: the 2×3 block P such that the image point of a plane point X̃ lies on the radial line through center in direction P·X̃ (rows 1–2 of the plane homography taken about that centre, up to scale — invariant to f and to any radially symmetric distortion about it).
The centre is part of the camera, as it is for RadialHomography. A radial camera without one is only half a model: its P predicts a direction, and a direction is not a locus in the image until you know where the pencil is centred. Carrying it here is what lets project return the Line2D the pixel must lie on, and lets constraint_with_jacobians take the RAW pixel — so no caller has to pre-centre its correspondences and keep that convention in its head.
RadialCamera(H) reads it off a HomographyMat (about the origin unless a centre is given); HomographyMat(P) returns the homography with the placeholder third row (0, 0, 1) that the focal solve accepts (it never reads row 3), carrying the centre translation.
VisualGeometryToolkitCore.Cameras.RadialCamera — Method
RadialCamera(cam::PosedCamera) -> RadialCameraThe 1-D radial camera of a POSED camera viewing the plane z = 0 of its extrinsics' source frame: rows 1–2 of the induced homography H = K·[r₁ r₂ t], read about K's principal point.
An IDENTITY, not a fit — no correspondences, no least squares, the pose taken exactly as it stands. That is what makes this the safe way to hand a calibrated arm's Extrinsics3 to VisualGeometryToolkitEstimation's division_camera_step: re-estimating a radial camera from the same board's correspondences re-runs the metric upgrade's sign decision on a slightly different matrix, and can flip the board's pose.
The lens is ignored by construction, not by omission. A radially symmetric distortion about that same principal point moves an image point along its own ray from the centre, so it cannot change the ray — and the ray is all this model claims (see RadialCamera). That invariance is why a camera with ANY radially symmetric lens is admissible here, while HomographyMat(::PosedPinholeCamera) stays Pinhole-only: the plane map of a distorted camera is not a homography, but its radial camera is exact.
A lens that is NOT radially symmetric is an ArgumentError: a decentering piece of the distortion (Tangential, ThinPrism, Tilt, alone or inside an Additive or a ∘ composition) or a SplineLens moves points off their rays from the centre, so the radial camera would not be exact. Which lenses are radially symmetric is the RadialSymmetry trait's verdict, which fails closed: a lens type that has not declared itself RadiallySymmetric() is refused too.
VisualGeometryToolkitCore.Cameras.RadialCamera5pt — Type
RadialCamera5pt(; center = Point2(0, 0))Minimal 5-point radial-camera solver (solve verb over the radial_camera_5pt kernel) on plane_point => raw_pixel correspondences. The pencil's center belongs to the solver, not the data: it is the problem's geometry, carried onto every returned camera. sample_size 5, max_solutions 1; a degenerate sample (collinear basis, dependent equations) gives count == 0.
Deliberately NOT entered in the minimal_solvers registry: generic Correspondence{Point2, Point2} data carries no pencil centre (the same reason Homography5ptRadial stays out). Construct it where the centre is known.
VisualGeometryToolkitCore.Cameras.RadialSymmetry — Type
RadialSymmetry(lens) -> RadiallySymmetric() | RadiallyAsymmetric()
RadialSymmetry(::Type) -> RadiallySymmetric() | RadiallyAsymmetric()Whether a lens (or a piece of one: a projection, a distortion term, a composition) is radially symmetric about the principal point — a Holy trait of its TYPE, which RadialCamera(::PosedCamera) dispatches on and VisualGeometryToolkitEstimation's fit_camera reads to warn of non-radial terms it cannot fit.
The default is RadiallyAsymmetric(), so the trait fails closed: a type that has not declared itself is treated as asymmetric until it declares itself symmetric, by a method RadialSymmetry(::Type{MyLens}) = RadiallySymmetric().
Symmetric: every projection (AbstractProjection), no distortion (nothing), Radial, FieldOfView and LiftLens; an Additive, a ∘ composition and a Lens (its projection and its distortion) when every piece is. Asymmetric: Tangential, ThinPrism, Tilt, a SplineLens (a calibrated grid has no symmetry), and anything else undeclared.
Public, not exported: VisualGeometryToolkitCore.Cameras.RadialSymmetry.
VisualGeometryToolkitCore.Cameras.RadiallyAsymmetric — Type
RadiallyAsymmetric() <: RadialSymmetryThe RadialSymmetry of a lens not known to be radially symmetric (the default).
VisualGeometryToolkitCore.Cameras.RadiallySymmetric — Type
RadiallySymmetric() <: RadialSymmetryThe RadialSymmetry of a lens radially symmetric about the principal point.
VisualGeometryToolkitCore.Cameras.radial_camera_5pt — Method
radial_camera_5pt(pts; center = Point2(0, 0)) -> RadialCamera{Float64} | nothingThe exactly determined radial camera from five plane_point => raw_pixel pairs about center — the minimal solver a RANSAC over board correspondences samples. Closed form and homogeneous, the way homography_4pt is: the first three plane points form a projective basis B, so P·B = [λ₁y₁ λ₂y₂ λ₃y₃] with yⱼ the pixels' ray directions and three unknown scales; the fourth and fifth points, written in that basis (c = B⁻¹X̃), each give one linear equation in λ (their pixel must be parallel to Σⱼ cⱼλⱼyⱼ), and λ is the cross product of the two equation rows. Then P = [λⱼyⱼ]·B⁻¹, unit Frobenius norm. Two 3×3 static solves and a cross product — no SVD, no scale fixed by hand, no root to pick. nothing when the basis points are collinear or the two equations are dependent (the configuration does not determine P).
VisualGeometryToolkitCore.Cameras.radial_rows — Method
The 2×3 block P of a RadialCamera: rows 1–2 of the plane homography about its center, up to scale.
VisualGeometryToolkitCore.Cameras.zhang_intrinsics — Method
zhang_intrinsics(Hs, pitch::Size2; center) -> LogicalIntrinsics{Float64}Known-sensor variant: with the pixel pitch given, the aspect ratio is fixed (fy/fx = pitch.width / pitch.height) and only a single focal length remains. Each homography's two constraints collapse onto one unknown 1/fx², solved by weighted least squares — this stays well-posed even for view sets that cannot separate fx from fy. The metric focal length is fx * pitch.width.
VisualGeometryToolkitCore.Cameras.zhang_intrinsics — Method
zhang_intrinsics(Hs; center) -> LogicalIntrinsics{Float64}The calibration from plane→image homographies by Zhang's IAC constraints — one linear least-squares step, assuming zero skew and the principal point at the known center (pixels, required). Each H maps its plane to the caller's pixels; they are read about center internally, and the result is in the caller's pixels: K = [fx 0 cx; 0 fy cy; 0 0 1] with (cx, cy) = center. Each homography contributes two linear equations on (1/fx², 1/fy²); the overdetermined system is solved by (optionally weighted) least squares. A homography carries its weight, a non-negative vote strength (e.g. an inlier count), as Attributed(H, (; weight)), read with weight_of; a bare H weighs 1. Throws ArgumentError when the set is degenerate — all views near fronto-parallel leave the IAC unobservable.
VisualGeometryToolkitCore.project — Method
project(P::RadialCamera, X) -> Line2DThe 1-D radial camera's image of the plane point X: the radial LINE through the camera's centre in direction P·X̃. The camera knows where a point's ray points, not how far along it the point lands, so a point of the plane images to a line — and the RAW pixel of X lies on it under any radially symmetric distortion about that centre. constraint_with_jacobians is that statement as a residual.
direction gives the bare P·X̃ for callers working up to scale.
View-Angle Limits
view_angle_limit and radial_part are documented with the lenses.
Index
VisualGeometryToolkitCore.Cameras.RadialCameraVisualGeometryToolkitCore.Cameras.RadialCameraVisualGeometryToolkitCore.Cameras.RadialCamera5ptVisualGeometryToolkitCore.Cameras.RadialSymmetryVisualGeometryToolkitCore.Cameras.RadiallyAsymmetricVisualGeometryToolkitCore.Cameras.RadiallySymmetricVisualGeometryToolkitCore.Cameras.radial_camera_5ptVisualGeometryToolkitCore.Cameras.radial_rowsVisualGeometryToolkitCore.Cameras.zhang_intrinsicsVisualGeometryToolkitCore.Cameras.zhang_intrinsicsVisualGeometryToolkitCore.project