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 {
00039 
00065 class ARUCO_EXPORTS  BoardDetector
00066 {
00067 public:
00071     BoardDetector(bool  setYPerpendicular=false);
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 
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 
00152 };
00153 #endif
00154 


ar_sys
Author(s): Hamdi Sahloul , Rafael Muñoz Salinas , Bence Magyar
autogenerated on Thu Aug 27 2015 12:23:55