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/core/core.hpp>
31 #include "exports.h"
32 #include "board.h"
33 #include "cameraparameters.h"
34 #include "markerdetector.h"
35 using namespace std;
36 
37 namespace aruco {
38 
65  public:
69  BoardDetector(bool setYPerpendicular = false);
70 
71 
75  void setParams(const BoardConfiguration &bc, const CameraParameters &cp, float markerSizeMeters = -1);
76  void setParams(const BoardConfiguration &bc);
81  float detect(const cv::Mat &im) throw(cv::Exception);
84  Board &getDetectedBoard() { return _boardDetected; }
87  MarkerDetector &getMarkerDetector() { return _mdetector; }
90  vector< Marker > &getDetectedMarkers() { return _vmarkers; }
91 
92 
93  // ALTERNATIVE DETECTION METHOD, BASED ON MARKERS PREVIOUSLY DETECTED
94 
106  float detect(const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, cv::Mat camMatrix = cv::Mat(),
107  cv::Mat distCoeff = cv::Mat(), float markerSizeMeters = -1) throw(cv::Exception);
108  float detect(const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, const CameraParameters &cp,
109  float markerSizeMeters = -1) throw(cv::Exception);
110 
118  static Board detect(const cv::Mat &Image, const BoardConfiguration &bc, const CameraParameters &cp, float markerSizeMeters = -1);
119 
125  void setYPerpendicular(bool enable) { _setYPerpendicular = enable; }
126  void setYPerperdicular(bool enable) { setYPerpendicular(enable); } // TODO mark as deprecated
127  bool isYPerpendicular() { return _setYPerpendicular; }
128 
133  void set_repj_err_thres(float Repj_err_thres) { repj_err_thres = Repj_err_thres; }
134  float get_repj_err_thres() const { return repj_err_thres; }
135 
136 
137  private:
138  void rotateXAxis(cv::Mat &rotation);
140 
141  //-- Functionality to detect markers inside
145  float _markerSize, repj_err_thres;
147  MarkerDetector _mdetector; // internal markerdetector
148  vector< Marker > _vmarkers; // markers detected in the call to : float detect(const cv::Mat &im);
149 };
150 };
151 #endif
vector< Marker > _vmarkers
MarkerDetector _mdetector
Board & getDetectedBoard()
Definition: boarddetector.h:84
#define ARUCO_EXPORTS
Definition: exports.h:42
void setYPerpendicular(bool enable)
CameraParameters _camParams
void setYPerperdicular(bool enable)
This class detects AR boards Version 1.2 There are two modes for board detection. First...
Definition: boarddetector.h:64
void set_repj_err_thres(float Repj_err_thres)
float get_repj_err_thres() const
vector< Marker > & getDetectedMarkers()
Definition: boarddetector.h:90
Main class for marker detection.
Parameters of the camera.
MarkerDetector & getMarkerDetector()
Definition: boarddetector.h:87
This class defines a board with several markers. A Board contains several markers so that they are mo...
Definition: board.h:69
BoardConfiguration _bconf


asr_aruco_marker_recognition
Author(s): Allgeyer Tobias, Meißner Pascal, Qattan Mohamad
autogenerated on Mon Feb 28 2022 21:41:30