Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

generateCheckerboardPoints

Generate checkerboard corner locations

Syntax

  • [worldPoints] = generateCheckerboardPoints(boardSize,squareSize)
    example

Description

example

[worldPoints] = generateCheckerboardPoints(boardSize,squareSize) returns an M-by-2 matrix containing M [x, y] corner coordinates for the squares on a checkerboard. The point [0,0] corresponds to the lower-right corner of the top-left square of the board.

Code Generation Support:
Supports Code Generation: Yes
Supports MATLAB® Function block: No
Code Generation Support, Usage Notes, and Limitations

Examples

collapse all

Generate the checkerboard, and obtain world coordinates.

    I = checkerboard;
    squareSize = 10;
    worldPoints = generateCheckerboardPoints([8 8], squareSize);

Offset the points, placing the first point at the lower-right corner of the first square.

    imshow(insertMarker(I, worldPoints + squareSize));

Related Examples

Input Arguments

collapse all

Generated checkerboard dimensions, specified as a 2-element [height, width] vector. You express the dimensions of the checkerboard in number of squares.

Checkerboard square side length, specified as a scalar in world units. You express world units as a measurement, such as millimeters or inches.

Output Arguments

collapse all

Generated checkerboard corner coordinates, returned as an M-by-2 matrix of M number of [x y] coordinates. The coordinates represent the corners of the squares on the checkerboard. The point [0,0] corresponds to the lower-right corner of the top-left square of the board. The number of points, M, that the function returns are based on the number of squares on the checkerboard. This value is set with the boardSize parameter.

M = (boardSize(1)-1) * (boardSize(2)-1)

Introduced in R2013b

Was this topic helpful?