Skip to contents

cornerSubPix finds the sub-pixel locations of corners or radial saddle points in an image from their estimated locations.

Usage

cornerSubPix(
  image,
  corners,
  win_size = c(11, 11),
  zero_zone = c(-1, -1),
  maxit = 30,
  eps = 1e-04
)

Arguments

image

An 8-bit (8U), single-channel (GRAY) Image object.

corners

A matrix of estimated corner locations as returned by findChessboardCorners.

win_size

A vector of the half of the side length of the search window. For example, if win_size = c(5, 5) , then a (5∗2+1)×(5∗2+1)=11×11 search window is used (default: c(11, 11)).

zero_zone

A vector of the half of the size of the dead region in the middle of the search zone. It is used sometimes to avoid possible singularities in the detection algorithm. The value of c(-1, -1) indicates that there is no such a size (the default).

maxit

The maximum number of iterations of the detection algorithm (default: 30).

eps

The desired accuracy or change in parameters at which the iterative algorithm stops (default: 0.0001).

Value

A (pprow * ppcol)x2 matrix. If the matrix is empty then no chessboard with the indicated dimensions is detected.

References

Förstner, W., & Gülch, E. (1987). A fast operator for detection and precise location of distinct points, corners and centres of circular features. Proc. ISPRS Intercommission Conference on Fast Processing of Photogrammetric Data, 6, 281–305.

Author

Simon Garnier, garnier@njit.edu

Examples

checkerboard <- image(system.file("sample_img/checkerboard6x9.png", package = "Rvision"))
pts <- findChessboardCorners(checkerboard, 6, 9)
checkerboard_gray <- changeColorSpace(checkerboard, "GRAY")
pts_refined <- cornerSubPix(checkerboard_gray, pts)