generateCharucoBoard
Syntax
Description
returns a grayscale ChArUco board image.I
= generateCharucoBoard(imageSize
,patternDims
,markerFamily
,checkerSize
,markerSize
)
specifies options using one or more name-value arguments in addition to the previous syntax.
For example, I
= generateCharucoBoard(___,Name=Value)MinMarkerID=3
sets the lowest marker ID in the board to
3
.
Examples
Generate ChArUco Board Image for Camera Calibration
Specify properties to generate the ChArUco board. Image, checker, and marker size are in pixels.
patternDims = [7 10];
family = "DICT_4X4_1000";
imageSize = [900 1200];
checkerSize = 100;
markerSize = 75;
Generate the ChArUco board based on specified properties.
I = generateCharucoBoard(imageSize,patternDims,family,checkerSize,markerSize);
Display the generated ChArUco board image.
imshow(I)
Write the ChArUco board image to a file.
imwrite(I,"ChArUco_7X10_4X4_100_75.png")
Next Steps: Print the ChArUco board image file. Use the printed board for capturing calibration images with the camera you intend to calibrate.
Input Arguments
imageSize
— ChArUco board size
2-element vector (default)
ChArUco board size in pixels, specified as a 2-element vector of the form [height,width].
patternDims
— Pattern dimensions
two-element vector
Pattern dimensions, specified as a two-element vector that represents the number of checker boxes in the dim1 and dim2 dimensions of the ChArUco board image, respectively. For more details on ChArUco board patterns, see ArUco and ChArUco board patterns.
markerFamily
— ArUco marker family name
character vector | string scalar | vector of strings | cell array of character vectors
ArUco marker family name used in CharUco board, specified as a character vector, string scalar, vector of strings, or cell array of character vectors. Each element must be one of the valid ArUco marker families listed in the table. Select a marker family suitable for your application based on the total number of markers needed, the marker length, and the Hamming distance between the marker code words. The minimum Hamming distance between markers in the same family, determine the ability to detect them and correct errors. Marker families with less number of markers can be more robust against errors than a family with a large number of markers, which can increase marker detection difficulty due to a greater number of bits to extract. These general rules apply:
The less number of bits to detect, the longer the range in distance a marker can be detected.
For correct identification and decoding, ArUco markers require a white border, also known as the quiet zone.
Family | Marker Size (bits) | Number of Markers in Family | Minimum Hamming Distance Between Markers (bits) |
---|---|---|---|
"DICT_ARUCO_ORIGINAL" | 5-by-5 | 1024 | 3 |
"DICT_4X4_50" | 4-by-4 | 50 | 4 |
"DICT_4X4_100" | 100 | 3 | |
"DICT_4X4_250" | 250 | 2 | |
"DICT_4X4_1000" | 1000 | 2 | |
"DICT_5X5_50" | 5-by-5 | 50 | 8 |
"DICT_5X5_100" | 100 | 7 | |
"DICT_5X5_250" | 250 | 6 | |
"DICT_5X5_1000" | 1000 | 5 | |
"DICT_6X6_50" | 6-by-6 | 50 | 13 |
"DICT_6X6_100" | 100 | 12 | |
"DICT_6X6_250" | 250 | 11 | |
"DICT_6X6_1000" | 1000 | 9 | |
"DICT_7X7_50" | 7-by-7 | 50 | 19 |
"DICT_7X7_100" | 250 | 18 | |
"DICT_7X7_250" | 250 | 17 | |
"DICT_7X7_1000" | 1000 | 14 |
Data Types: char
| string
| cell
checkerSize
— ChArUco board checker box side length
scalar
ChArUco board checker box side length, specified as a scalar in world units, such as
millimeters or inches. The checkerSize
and
markerSize
must be specified in the same world units and
checkerSize
must be a larger value than
markerSize
.
markerSize
— ArUco marker side length
scalar
ArUco marker side length, specified as a scalar in world units, such as millimeters
or inches. The checkerSize
and markerSize
must
be specified in the same world units and checkerSize
must be a
larger value than markerSize
.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example:
generateCharucoBoard(____,MinMarkerID=3)
sets the lowest marker ID in the
board to 3
.
MarginSize
— Number of white pixels to pad margin
10
(default) | scalar
Number of white pixels to pad margin of output image, specified as a scalar.
MinMarkerID
— Lowest value marker ID in pattern
0
(default) | non-negative integer
Lowest value marker ID in the pattern, specified as a non-negative integer. The
markers in the pattern must correspond to sequential IDs, each incremented by
1
.
OriginCheckerColor
— Color of the checker box located in the top-left corner of board
"black"
(default) | "white"
Color of the checker box located in the top-left corner of ChArUco board,
specified as "black"
or "white"
. The top-left
corner value represents the origin of the board. This value must not be set to
"white"
when the board contains an odd number of boxes in the
x dimension, specified in
patternDims(1)
.
Output Arguments
I
— ChArUco image
grayscale
ChArUco image, returned as a grayscale image.
Data Types: uint8
Version History
Introduced in R2024b
See Also
Functions
Objects
Topics
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)