MATLAB File Help: cv.cornerSubPix Index
cv.cornerSubPix

Refines the corner locations

corners = cv.cornerSubPix(im, corners)
corners = cv.cornerSubPix(im, corners, 'OptionName', optionValue, ...)

Input

Output

Options

The function iterates to find the sub-pixel accurate location of corners or radial saddle points.

Sub-pixel accurate corner locator is based on the observation that every vector from the center q to a point p located within a neighborhood of q is orthogonal to the image gradient at p subject to image and measurement noise. Consider the expression:

epsilon_i = DI_p_i' * (q - p_i)

where DI_p_i is an image gradient at one of the points p_i in a neighborhood of q. The value of q is to be found so that epsilon_i is minimized. A system of equations may be set up with epsilon_i set to zero:

Sigma_i(DI_p_i * DI_p_i') - Sigma_i(DI_p_i * DI_p_i' * p_i)

where the gradients are summed within a neighborhood ("search window") of q. Calling the first gradient term G and the second gradient term b gives:

q = inv(G) * b

The algorithm sets the center of the neighborhood window at this new center q and then iterates until the center stays within a set threshold.

See also