CheckerBoard

Qualified name: n_fold_edge.checkerboard.CheckerBoard

class CheckerBoard(kernel_size=55, scale_factor=1000, distance_scale=40, relative_threshold_level=0.5)[source]

Bases: object

Detect corners of a checkerboard in images.

Parameters:
  • kernel_size (int) – Kernel size used by marker locator to detect corners.

  • scale_factor (float) – Scale factor used by marker locator.

  • distance_scale (int) – Distance scale of the corners relative to each other.

  • relative_threshold_level (float) – Threshold level to apply at each corner.

Methods

find_corners

Find corners of a checkerboard in the image.

image_coverage

Estimate how much of the image is covered by the checkerboard.

static image_coverage(image_shape, img_points)[source]

Estimate how much of the image is covered by the checkerboard. The image is divided into 100 equal regions and each region with a least one corner is counted.

Parameters:
  • image_shape (tuple[int, int]) – Image shape in height, width.

  • img_points (ndarray) – The image points of the detected corners as returned from find_corners.

Returns:

coverage – Number of the 100 regions in image with a least one corner.

Return type:

int

find_corners(image)[source]

Find corners of a checkerboard in the image.

Parameters:

image (ndarray) – Image of a checkerboard.

Returns:

  • image_points (ndarray) – corners in image coordinates.

  • object_points (ndarray) – corners in coordinates relative to each other.

Return type:

tuple[ndarray, ndarray]