aruco/include/aruco/boarddetector.h
Go to the documentation of this file.
1 /*****************************
2 Copyright 2011 Rafael Muñoz Salinas. All rights reserved.
3 
4 Redistribution and use in source and binary forms, with or without modification, are
5 permitted provided that the following conditions are met:
6 
7  1. Redistributions of source code must retain the above copyright notice, this list of
8  conditions and the following disclaimer.
9 
10  2. Redistributions in binary form must reproduce the above copyright notice, this list
11  of conditions and the following disclaimer in the documentation and/or other materials
12  provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY Rafael Muñoz Salinas ''AS IS'' AND ANY EXPRESS OR IMPLIED
15 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Rafael Muñoz Salinas OR
17 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 
24 The views and conclusions contained in the software and documentation are those of the
25 authors and should not be interpreted as representing official policies, either expressed
26 or implied, of Rafael Muñoz Salinas.
27 ********************************/
28 #ifndef _Aruco_BoardDetector_H
29 #define _Aruco_BoardDetector_H
30 #include <opencv2/opencv.hpp>
31 #include <aruco/exports.h>
32 #include <aruco/board.h>
33 #include <aruco/cameraparameters.h>
34 #include <aruco/markerdetector.h>
35 using namespace std;
36 
37 namespace aruco
38 {
39 
66 {
67 public:
71  BoardDetector(bool setYPerpendicular=true);
72 
73 
77  void setParams(const BoardConfiguration &bc,const CameraParameters &cp, float markerSizeMeters=-1);
78  void setParams(const BoardConfiguration &bc);
83  float detect(const cv::Mat &im)throw (cv::Exception);
86  Board & getDetectedBoard(){return _boardDetected;}
89  MarkerDetector &getMarkerDetector(){return _mdetector;}
92  vector<Marker> &getDetectedMarkers(){return _vmarkers;}
93 
94 
95  //ALTERNATIVE DETECTION METHOD, BASED ON MARKERS PREVIOUSLY DETECTED
96 
108  float detect(const vector<Marker> &detectedMarkers,const BoardConfiguration &BConf, Board &Bdetected, cv::Mat camMatrix=cv::Mat(),cv::Mat distCoeff=cv::Mat(), float markerSizeMeters=-1 )throw (cv::Exception);
109  float detect(const vector<Marker> &detectedMarkers,const BoardConfiguration &BConf, Board &Bdetected,const CameraParameters &cp, float markerSizeMeters=-1 )throw (cv::Exception);
110 
111 
117  void setYPerpendicular(bool enable){_setYPerpendicular=enable;}
118 
119 
120 
121 
122 private:
123  void rotateXAxis(cv::Mat &rotation);
125 
126  //-- Functionality to detect markers inside
130  float _markerSize;
132  MarkerDetector _mdetector;//internal markerdetector
133  vector<Marker> _vmarkers;//markers detected in the call to : float detect(const cv::Mat &im);
134 
135 };
136 
137 };
138 #endif
139 
This class detects AR boards Version 1.2 There are two modes for board detection. First...
Main class for marker detection.
#define ARUCO_EXPORTS
This class defines a board with several markers. A Board contains several markers so that they are mo...


lidar_camera_calibration
Author(s):
autogenerated on Sat Feb 6 2021 03:39:37