Computer vision infers information about a scene from digital images or video. Tasks include recognizing objects, image segmentation and estimating three-dimensional geometry. A digital image records pixel measurements after image formation; lighting, viewpoint and occlusion therefore affect what can be inferred. A dark pixel can indicate a dark surface, a shadow or a surface facing away from the light.
For example, in rectified stereo vision with parallel cameras, horizontal disparity is related to depth by , where is focal length in pixel units and is camera separation. similar triangles give the relation; a smaller disparity means greater distance. The relation requires corresponding scene points and calibrated geometry. Since , a fixed disparity error produces much greater depth error for distant points. Camera calibration, correspondence and uncertainty are thus part of the computation, rather than details that can be ignored after acquiring a picture.
OpenCV is a software library for computer vision and image processing. Its camera-geometry tools connect observed pixel coordinates to models of imaging, including camera calibration, correction of lens distortion, stereo rectification and three-dimensional reconstruction.[ref]
A checkerboard calibration target supplies known geometry that can be observed from several camera positions. Fitting the model compares detected image points with projected target points. The resulting reprojection error measures agreement in the image, rather than independently confirming every physical dimension of the reconstructed scene.
A simple perspective projection illustrates the distinction: in , replacing and by and for leaves unchanged. This scale ambiguity of perspective projection means that image agreement alone cannot verify a chosen unit of length. A camera baseline or a target of known size supplies additional metric information. Using the library well therefore includes checking geometric assumptions and units, alongside the numerical fit.

Tagged

Stereo vision estimates three-dimensional structure from images taken at different viewpoints. After camera calibration and alignment into a common image geometry, a point's horizontal displacement between the two views is its stereo disparity . For parallel ideal cameras with camera baseline and focal length in pixel units, similar triangles give
For pixels, and pixels, the inferred depth is . Doubling the depth halves the stereo disparity, making distant structure harder to measure accurately.[ref]
A practical apparatus uses two rigidly mounted cameras, a calibration target and synchronized exposures. Matching the same physical feature is essential: repeated textures, hidden surfaces and motion can give false correspondences. The measurement is therefore geometric inference from matched observations, not an intrinsic depth label stored in each pixel.[ref]
Camera calibration estimates the parameters relating points in a scene to measured image coordinates. In the ideal pinhole model,
where contains focal lengths and the principal point, while the rotation matrix and translation locate the camera relative to the scene. Lens distortion requires additional parameters.[ref]
A calibration experiment photographs a flat board with a known grid from several orientations. Detected grid corners provide image measurements; their known spacing supplies geometric constraints and a length scale. Parameters are fitted by minimizing reprojection error. Multiple orientations help separate camera geometry from board pose. For an ideal camera with focal length 1000 pixels, a point displaced sideways at depth projects 50 pixels from the principal point.[ref]
In an ideal camera model, the principal point is the intersection of the optical axis with the image plane, expressed in image pixel coordinates . It supplies the coordinate offset in perspective projection. For a scene point expressed relative to the camera, the model is
where are focal lengths in pixel units. Thus the principal point belongs to the camera's internal geometry; the camera's position and orientation in the world are separate parameters.[ref]
For , , metres and metres, the horizontal coordinate is pixels. A point on the optical axis instead has and projects to . The principal point is often near the image center, but camera calibration estimates it rather than establishing that it must be exactly centered. Cropping an image also changes the principal point's coordinate values: removing 20 columns from the left changes to , without physically moving the optical axis.
A checkerboard calibration target is a planar pattern of alternating dark and light squares with known geometry, used to estimate camera calibration parameters. Image measurements of internal corner intersections are paired with known target coordinates. Several tilted views constrain the image projection and distortion model.[ref]
For a board with nine squares across and six down, the internal-corner grid has eight columns and five rows. If square spacing is 20 millimetres, one can assign corner coordinates millimetres for and . Supplying only unit grid spacing instead yields translation estimates in square-size units. A useful experiment varies the target's orientation and image position, then examines reprojection error. Repeated identical views provide less geometric information; a warped board or inaccurate corner measurements can also bias the fitted camera model.

Articles by others on the same topic (1)