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/opencv.hpp>
00031 #include <aruco/exports.h>
00032 #include <aruco/board.h>
00033 #include <aruco/cameraparameters.h>
00034 #include <aruco/markerdetector.h>
00035 using namespace std;
00036 
00037 namespace aruco
00038 {
00039 
00065 class ARUCO_EXPORTS  BoardDetector
00066 {
00067 public:
00071     BoardDetector(bool setYPerpendicular=true);
00072     
00073     
00077     void setParams(const BoardConfiguration &bc,const CameraParameters &cp, float markerSizeMeters=-1);
00078     void setParams(const BoardConfiguration &bc);
00083     float  detect(const cv::Mat &im)throw (cv::Exception);
00086     Board & getDetectedBoard(){return _boardDetected;}
00089     MarkerDetector &getMarkerDetector(){return _mdetector;}
00092     vector<Marker> &getDetectedMarkers(){return _vmarkers;}
00093     
00094     
00095     //ALTERNATIVE DETECTION METHOD, BASED ON MARKERS PREVIOUSLY DETECTED
00096     
00108     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);
00109     float detect(const vector<Marker> &detectedMarkers,const  BoardConfiguration &BConf, Board &Bdetected,const CameraParameters &cp, float markerSizeMeters=-1 )throw (cv::Exception);
00110 
00111 
00117     void setYPerpendicular(bool enable){_setYPerpendicular=enable;}
00118     
00119     
00120     
00121     
00122 private:
00123     void rotateXAxis(cv::Mat &rotation);
00124     bool _setYPerpendicular;
00125     
00126     //-- Functionality to detect markers inside
00127     bool _areParamsSet;
00128     BoardConfiguration _bconf;
00129     Board _boardDetected;
00130     float _markerSize;
00131     CameraParameters _camParams;
00132     MarkerDetector _mdetector;//internal markerdetector
00133     vector<Marker> _vmarkers;//markers detected in the call to : float  detect(const cv::Mat &im);
00134     
00135 };
00136 
00137 };
00138 #endif
00139 


aruco
Author(s): Rafael Muñoz Salinas , Bence Magyar
autogenerated on Thu Jun 6 2019 17:52:15