charuco.hpp
Go to the documentation of this file.
1 /*
2 By downloading, copying, installing or using the software you agree to this
3 license. If you do not agree to this license, do not download, install,
4 copy or use the software.
5 
6  License Agreement
7  For Open Source Computer Vision Library
8  (3-clause BSD License)
9 
10 Copyright (C) 2013, OpenCV Foundation, all rights reserved.
11 Third party copyrights are property of their respective owners.
12 
13 Redistribution and use in source and binary forms, with or without modification,
14 are permitted provided that the following conditions are met:
15 
16  * Redistributions of source code must retain the above copyright notice,
17  this list of conditions and the following disclaimer.
18 
19  * Redistributions in binary form must reproduce the above copyright notice,
20  this list of conditions and the following disclaimer in the documentation
21  and/or other materials provided with the distribution.
22 
23  * Neither the names of the copyright holders nor the names of the contributors
24  may be used to endorse or promote products derived from this software
25  without specific prior written permission.
26 
27 This software is provided by the copyright holders and contributors "as is" and
28 any express or implied warranties, including, but not limited to, the implied
29 warranties of merchantability and fitness for a particular purpose are
30 disclaimed. In no event shall copyright holders or contributors be liable for
31 any direct, indirect, incidental, special, exemplary, or consequential damages
32 (including, but not limited to, procurement of substitute goods or services;
33 loss of use, data, or profits; or business interruption) however caused
34 and on any theory of liability, whether in contract, strict liability,
35 or tort (including negligence or otherwise) arising in any way out of
36 the use of this software, even if advised of the possibility of such damage.
37 */
38 
39 #ifndef __OPENCV_CHARUCO_HPP__
40 #define __OPENCV_CHARUCO_HPP__
41 
42 #include <opencv2/core.hpp>
43 #include <vector>
44 #include <opencv2/aruco.hpp>
45 
46 
47 namespace cv {
48 namespace aruco {
49 
52 
53 
62 class CV_EXPORTS_W CharucoBoard : public Board {
63 
64  public:
65  // vector of chessboard 3D corners precalculated
66  CV_PROP std::vector< Point3f > chessboardCorners;
67 
68  // for each charuco corner, nearest marker id and nearest marker corner id of each marker
69  CV_PROP std::vector< std::vector< int > > nearestMarkerIdx;
70  CV_PROP std::vector< std::vector< int > > nearestMarkerCorners;
71 
83  CV_WRAP void draw(Size outSize, OutputArray img, int marginSize = 0, int borderBits = 1);
84 
85 
100  CV_WRAP static Ptr<CharucoBoard> create(int squaresX, int squaresY, float squareLength,
101  float markerLength, const Ptr<Dictionary> &dictionary);
102 
106  CV_WRAP Size getChessboardSize() const { return Size(_squaresX, _squaresY); }
107 
111  CV_WRAP float getSquareLength() const { return _squareLength; }
112 
116  CV_WRAP float getMarkerLength() const { return _markerLength; }
117 
118  private:
119  void _getNearestMarkerCorners();
120 
121  // number of markers in X and Y directions
122  int _squaresX, _squaresY;
123 
124  // size of chessboard squares side (normally in meters)
126 
127  // marker side lenght (normally in meters)
129 };
130 
131 
132 
133 
158 CV_EXPORTS_W int interpolateCornersCharuco(InputArrayOfArrays markerCorners, InputArray markerIds,
159  InputArray image, const Ptr<CharucoBoard> &board,
160  OutputArray charucoCorners, OutputArray charucoIds,
161  InputArray cameraMatrix = noArray(),
162  InputArray distCoeffs = noArray(), int minMarkers = 2);
163 
164 
165 
166 
185 CV_EXPORTS_W bool estimatePoseCharucoBoard(InputArray charucoCorners, InputArray charucoIds,
186  const Ptr<CharucoBoard> &board, InputArray cameraMatrix,
187  InputArray distCoeffs, OutputArray rvec, OutputArray tvec,
188  bool useExtrinsicGuess = false);
189 
190 
191 
192 
204 CV_EXPORTS_W void drawDetectedCornersCharuco(InputOutputArray image, InputArray charucoCorners,
205  InputArray charucoIds = noArray(),
206  Scalar cornerColor = Scalar(255, 0, 0));
207 
208 
209 
244 CV_EXPORTS_AS(calibrateCameraCharucoExtended) double calibrateCameraCharuco(
245  InputArrayOfArrays charucoCorners, InputArrayOfArrays charucoIds, const Ptr<CharucoBoard> &board,
246  Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs,
247  OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,
248  OutputArray stdDeviationsIntrinsics, OutputArray stdDeviationsExtrinsics,
249  OutputArray perViewErrors, int flags = 0,
250  TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON));
251 
254 CV_EXPORTS_W double calibrateCameraCharuco(
255  InputArrayOfArrays charucoCorners, InputArrayOfArrays charucoIds, const Ptr<CharucoBoard> &board,
256  Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs,
257  OutputArrayOfArrays rvecs = noArray(), OutputArrayOfArrays tvecs = noArray(), int flags = 0,
258  TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON));
259 
260 
261 
284 CV_EXPORTS_W void detectCharucoDiamond(InputArray image, InputArrayOfArrays markerCorners,
285  InputArray markerIds, float squareMarkerLengthRate,
286  OutputArrayOfArrays diamondCorners, OutputArray diamondIds,
287  InputArray cameraMatrix = noArray(),
288  InputArray distCoeffs = noArray());
289 
290 
291 
310 CV_EXPORTS_W void drawDetectedDiamonds(InputOutputArray image, InputArrayOfArrays diamondCorners,
311  InputArray diamondIds = noArray(),
312  Scalar borderColor = Scalar(0, 0, 255));
313 
314 
315 
316 
331 // TODO cannot be exported yet; conversion from/to Vec4i is not wrapped in core
332 CV_EXPORTS void drawCharucoDiamond(const Ptr<Dictionary> &dictionary, Vec4i ids, int squareLength,
333  int markerLength, OutputArray img, int marginSize = 0,
334  int borderBits = 1);
335 
336 
337 
338 
340 }
341 }
342 
343 #endif
CV_EXPORTS_AS(calibrateCameraCharucoExtended) double calibrateCameraCharuco(InputArrayOfArrays charucoCorners
Calibrate a camera using Charuco corners.
CV_EXPORTS_W void drawDetectedCornersCharuco(InputOutputArray image, InputArray charucoCorners, InputArray charucoIds=noArray(), Scalar cornerColor=Scalar(255, 0, 0))
Draws a set of Charuco corners.
Definition: charuco.cpp:591
CV_PROP std::vector< std::vector< int > > nearestMarkerCorners
Definition: charuco.hpp:70
CV_EXPORTS_W void detectCharucoDiamond(InputArray image, InputArrayOfArrays markerCorners, InputArray markerIds, float squareMarkerLengthRate, OutputArrayOfArrays diamondCorners, OutputArray diamondIds, InputArray cameraMatrix=noArray(), InputArray distCoeffs=noArray())
Detect ChArUco Diamond markers.
Definition: charuco.cpp:735
CV_EXPORTS void drawCharucoDiamond(const Ptr< Dictionary > &dictionary, Vec4i ids, int squareLength, int markerLength, OutputArray img, int marginSize=0, int borderBits=1)
Draw a ChArUco Diamond marker.
Definition: charuco.cpp:869
CV_EXPORTS_W void drawDetectedDiamonds(InputOutputArray image, InputArrayOfArrays diamondCorners, InputArray diamondIds=noArray(), Scalar borderColor=Scalar(0, 0, 255))
Draw a set of detected ChArUco Diamond markers.
Definition: charuco.cpp:890
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray cameraMatrix
Definition: charuco.hpp:245
InputArrayOfArrays const Ptr< CharucoBoard > Size imageSize
Definition: charuco.hpp:245
CV_WRAP float getMarkerLength() const
Definition: charuco.hpp:116
Definition: charuco.hpp:47
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray InputOutputArray distCoeffs
Definition: charuco.hpp:245
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray InputOutputArray OutputArrayOfArrays OutputArrayOfArrays OutputArray OutputArray OutputArray int TermCriteria criteria
Definition: charuco.hpp:250
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray InputOutputArray OutputArrayOfArrays OutputArrayOfArrays OutputArray OutputArray stdDeviationsExtrinsics
Definition: charuco.hpp:245
CV_PROP std::vector< Point3f > chessboardCorners
Definition: charuco.hpp:66
InputArrayOfArrays charucoIds
Definition: charuco.hpp:245
Board of markers.
Definition: aruco.hpp:272
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray InputOutputArray OutputArrayOfArrays OutputArrayOfArrays OutputArray OutputArray OutputArray perViewErrors
Definition: charuco.hpp:245
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray InputOutputArray OutputArrayOfArrays OutputArrayOfArrays OutputArray OutputArray OutputArray int flags
Definition: charuco.hpp:249
CV_PROP std::vector< std::vector< int > > nearestMarkerIdx
Definition: charuco.hpp:69
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray InputOutputArray OutputArrayOfArrays OutputArrayOfArrays OutputArray stdDeviationsIntrinsics
Definition: charuco.hpp:245
CV_EXPORTS_W double calibrateCameraCharuco(InputArrayOfArrays charucoCorners, InputArrayOfArrays charucoIds, const Ptr< CharucoBoard > &board, Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs, OutputArrayOfArrays rvecs=noArray(), OutputArrayOfArrays tvecs=noArray(), int flags=0, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON))
It&#39;s the same function as calibrateCameraCharuco but without calibration error estimation.
Definition: charuco.cpp:723
CV_WRAP Size getChessboardSize() const
Definition: charuco.hpp:106
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray InputOutputArray OutputArrayOfArrays rvecs
Definition: charuco.hpp:245
CV_EXPORTS_W bool estimatePoseCharucoBoard(InputArray charucoCorners, InputArray charucoIds, const Ptr< CharucoBoard > &board, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess=false)
Pose estimation for a ChArUco board given some of their corners.
Definition: charuco.cpp:658
InputArray ids
Definition: aruco.hpp:569
InputArrayOfArrays const Ptr< CharucoBoard > Size InputOutputArray InputOutputArray OutputArrayOfArrays OutputArrayOfArrays tvecs
Definition: charuco.hpp:245
CV_EXPORTS_W int interpolateCornersCharuco(InputArrayOfArrays markerCorners, InputArray markerIds, InputArray image, const Ptr< CharucoBoard > &board, OutputArray charucoCorners, OutputArray charucoIds, InputArray cameraMatrix=noArray(), InputArray distCoeffs=noArray(), int minMarkers=2)
Interpolate position of ChArUco board corners.
Definition: charuco.cpp:565
CV_WRAP float getSquareLength() const
Definition: charuco.hpp:111
InputArrayOfArrays const Ptr< CharucoBoard > & board
Definition: charuco.hpp:245
ChArUco board Specific class for ChArUco boards. A ChArUco board is a planar board where the markers ...
Definition: charuco.hpp:62


aruco_pose
Author(s): Oleg Kalachev
autogenerated on Mon Feb 28 2022 22:08:24