constchar*about="A tutorial code on charuco board creation and detection of charuco board with and without camera caliberation";
constchar*keys="{c | | Put value of c=1 to create charuco board;\nc=2 to detect charuco board without camera calibration;\nc=3 to detect charuco board with camera calibration and Pose Estimation}";
- The first parameter is the size of the output image in pixels. In this case 600x500 pixels. If this is not proportional
to the board dimensions, it will be centered on the image.
...
...
@@ -76,9 +87,9 @@ The output image will be something like this:
![](images/charucoboard.jpg)
A full working example is included in the ```create_board_charuco.cpp``` inside the module samples folder.
A full working example is included in the ```create_board_charuco.cpp``` inside the modules/aruco/samples/create_board_charuco.cpp.
Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like
Note: The create_board_charuco.cpp now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like
The detection of the ChArUco corners is based on the previous detected markers. So that, first markers are detected, and then
ChArUco corners are interpolated from markers.
The original image where the markers are to be detected. The image is necessary to perform subpixel refinement in the ChArUco corners.
The function that detect the ChArUco corners is ```cv::aruco::interpolateCornersCharuco()``` . This example shows the whole process. First, markers are detected, and then the ChArUco corners are interpolated from these markers.
-**Reading the camera calibration Parameters(only for detection with camera calibration)**
The parameters of the ```interpolateCornersCharuco()``` function are:
-```markerCorners``` and ```markerIds```: the detected markers from ```detectMarkers()``` function.
-```inputImage```: the original image where the markers were detected. The image is necessary to perform subpixel refinement
in the ChArUco corners.
-```board```: the ```CharucoBoard``` object
-```charucoCorners``` and ```charucoIds```: the output interpolated Charuco corners
-```cameraMatrix``` and ```distCoeffs```: the optional camera calibration parameters
- The function returns the number of Charuco corners interpolated.
The parameters of readCameraParameters are:
- filename- This is the path to caliberation.txt file which is the output file generated by calibrate_camera_charuco.cpp
- cameraMatrix and distCoeffs- the optional camera calibration parameters
In this case, we have call ```interpolateCornersCharuco()``` providing the camera calibration parameters. However these parameters
are optional. A similar example without these parameters would be:
This function takes these parameters as input and returns a boolean value of whether the camera calibration parameters are valid or not. For detection of corners without calibration, this step is not required.
- dictionary - Pointer to the Dictionary/Set of Markers that will be searched.
- markerCorners - vector of detected marker corners.
- markerIds - vector of identifiers of the detected markers
- params - marker detection parameters
The detection of the ChArUco corners is based on the previous detected markers. So that, first markers are detected, and then ChArUco corners are interpolated from markers.
-**Interpolation of charuco corners from markers**
The function that detect the ChArUco corners is cv::aruco::interpolateCornersCharuco(). This function returns the number of Charuco corners interpolated.
-```std::vector<cv::Point2f> charucoCorners``` : list of image positions of the detected corners.
-```std::vector<int> charucoIds``` : ids for each of the detected corners in ```charucoCorners```.
If calibration parameters are provided, the ChArUco corners are interpolated by, first, estimating a rough pose from the ArUco markers
and, then, reprojecting the ChArUco corners back to the image.
...
...
@@ -176,11 +171,9 @@ After the ChArUco corners have been interpolated, a subpixel refinement is perfo
Once we have interpolated the ChArUco corners, we would probably want to draw them to see if their detections are correct.
This can be easily done using the ```drawDetectedCornersCharuco()``` function:
A full working example is included in the ```detect_board_charuco.cpp``` inside the module samples folder.
A full working example is included in the ```detect_board_charuco.cpp``` inside the modules/aruco/samples/detect_board_charuco.cpp.
Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like
A full working example is included in the ```detect_board_charuco.cpp``` inside the module samples folder.
A full working example is included in the ```detect_board_charuco.cpp``` inside the modules/aruco/samples/detect_board_charuco.cpp.
Note: The samples now take input via commandline via the [OpenCV Commandline Parser](http://docs.opencv.org/trunk/d0/d2e/classcv_1_1CommandLineParser.html#gsc.tab=0). For this file the example parameters will look like