boarddetector.h
Go to the documentation of this file.
00001 /*****************************
00002 Copyright 2011 Rafael Muñoz Salinas. All rights reserved.
00003 
00004 Redistribution and use in source and binary forms, with or without modification, are
00005 permitted provided that the following conditions are met:
00006 
00007    1. Redistributions of source code must retain the above copyright notice, this list of
00008       conditions and the following disclaimer.
00009 
00010    2. Redistributions in binary form must reproduce the above copyright notice, this list
00011       of conditions and the following disclaimer in the documentation and/or other materials
00012       provided with the distribution.
00013 
00014 THIS SOFTWARE IS PROVIDED BY Rafael Muñoz Salinas ''AS IS'' AND ANY EXPRESS OR IMPLIED
00015 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
00016 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Rafael Muñoz Salinas OR
00017 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00018 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00019 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00020 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00021 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00022 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00023 
00024 The views and conclusions contained in the software and documentation are those of the
00025 authors and should not be interpreted as representing official policies, either expressed
00026 or implied, of Rafael Muñoz Salinas.
00027 ********************************/
00028 #ifndef _Aruco_BoardDetector_H
00029 #define _Aruco_BoardDetector_H
00030 #include <opencv2/core/core.hpp>
00031 #include "exports.h"
00032 #include "board.h"
00033 #include "cameraparameters.h"
00034 #include "markerdetector.h"
00035 using namespace std;
00036 
00037 namespace aruco {
00038 
00064 class ARUCO_EXPORTS BoardDetector {
00065   public:
00069     BoardDetector(bool setYPerpendicular = false);
00070 
00071 
00075     void setParams(const BoardConfiguration &bc, const CameraParameters &cp, float markerSizeMeters = -1);
00076     void setParams(const BoardConfiguration &bc);
00081     float detect(const cv::Mat &im) throw(cv::Exception);
00084     Board &getDetectedBoard() { return _boardDetected; }
00087     MarkerDetector &getMarkerDetector() { return _mdetector; }
00090     vector< Marker > &getDetectedMarkers() { return _vmarkers; }
00091 
00092 
00093     // ALTERNATIVE DETECTION METHOD, BASED ON MARKERS PREVIOUSLY DETECTED
00094 
00106     float detect(const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, cv::Mat camMatrix = cv::Mat(),
00107                  cv::Mat distCoeff = cv::Mat(), float markerSizeMeters = -1) throw(cv::Exception);
00108     float detect(const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, const CameraParameters &cp,
00109                  float markerSizeMeters = -1) throw(cv::Exception);
00110 
00118     static Board detect(const cv::Mat &Image, const BoardConfiguration &bc, const CameraParameters &cp, float markerSizeMeters = -1);
00119 
00125     void setYPerpendicular(bool enable) { _setYPerpendicular = enable; }
00126     void setYPerperdicular(bool enable) { setYPerpendicular(enable); } // TODO mark as deprecated
00127     bool isYPerpendicular() { return _setYPerpendicular; }
00128 
00133     void set_repj_err_thres(float Repj_err_thres) { repj_err_thres = Repj_err_thres; }
00134     float get_repj_err_thres() const { return repj_err_thres; }
00135 
00136 
00137   private:
00138     void rotateXAxis(cv::Mat &rotation);
00139     bool _setYPerpendicular;
00140 
00141     //-- Functionality to detect markers inside
00142     bool _areParamsSet;
00143     BoardConfiguration _bconf;
00144     Board _boardDetected;
00145     float _markerSize, repj_err_thres;
00146     CameraParameters _camParams;
00147     MarkerDetector _mdetector; // internal markerdetector
00148     vector< Marker > _vmarkers; // markers detected in the call to : float  detect(const cv::Mat &im);
00149 };
00150 };
00151 #endif


asr_aruco_marker_recognition
Author(s): Allgeyer Tobias, Meißner Pascal, Qattan Mohamad
autogenerated on Thu Jun 6 2019 21:14:12