BitmapToolkit Scol plugin
ArManager.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25#ifndef __BTK_ARMANAGER_H__
26#define __BTK_ARMANAGER_H__
27
28#include "Prerequisites.h"
29#include <aruco.h>
30#include <set>
31#include "ArMarker.h"
32#include "ArCameraParam.h"
33#include "ArDetector.h"
34#include "ArFeaturedDetector.h"
35#include "ArFaceDetector.h"
36#include "ArBlobDetector.h"
37#include "ArTkDetector.h"
38#ifdef HAVE_BTSLAM
39#include "sSlam.h"
40#endif
41#include "BitmapToolkitThread.h"
42
44{
45 public:
46 typedef std::set<ArMarker*> MarkerList;
47
48 public:
49 boost::shared_mutex updateMutex;
50 boost::shared_mutex listMutex;
52
53 protected:
54
55 private:
56 static ArManager* _singleton;
57 ArDetector* detector;
58
59#ifdef HAVE_BTSLAM
60 Sslam* slamdetector;
61#endif
62 ArTkDetector* tkdetector;
63 ArFeaturedDetector* fdetector;
64 ArFaceDetector* facedetector;
65 std::vector<ArBlobDetector*> bdetectorList;
66 LASTDATA lastData;
67
68 public:
69 static ArManager* GetInstance();
70 static void Kill();
71 void UpdateMarkers(cv::Mat image, ArCameraParam* arCameraParam, bool reversedBitmap = false, bool debugDraw = false);
72 ArMarker* AddMarker(int index, float size);
73 ArMarker* AddMarker(std::string path, float size, unsigned int maxFeatures = 600);
74 ArMarker* AddMarker(cv::Mat tpl, float size, unsigned int maxFeatures = 600);
75 ArMarker* AddObjMarker(const std::string path, float size, unsigned int maxFeatures = 600);
76 ArMarker* AddFaceMarker(float size);
77
78#ifdef HAVE_BTSLAM
79 void EnableSlamDetector(bool state);
80 void SetSlamDetectorParams(int nbp, int nbimp, int minf, int maxf);
81
82 Vector3 GetSlamCameraPostition();
83 BtQuaternion GetSlamCameraOrientation();
84 bool IsSlamFound();
85 void ResetSlamDetector();
86#endif
87 ArBlobDetector* AddBlobDetector(cv::SimpleBlobDetector::Params params);
88 void RemoveBlobDetector(ArBlobDetector* detector);
89
90 void RemoveMarker(ArMarker* marker);
91 void GetLastData(LASTDATA &data);
92 void updateFiducialMarkers(std::vector<aruco::Marker> detectedMarkers, LASTDATA lastd);
94
95 /*
96 void UseNaturalFeatureDetection(bool state);
97 ArNaturalFeatureDetector* GetNaturalFeatureDetector();
98 */
99 protected:
100 ~ArManager();
101
102 private:
103 ArManager();
104 unsigned int CalcNewID();
105};
106
107#endif
static void Kill()
Definition ArManager.cpp:80
void GetLastData(LASTDATA &data)
void RemoveBlobDetector(ArBlobDetector *detector)
Definition ArManager.cpp:97
boost::shared_mutex updateMutex
Definition ArManager.h:49
void SetNFTdetectorDirty()
std::set< ArMarker * > MarkerList
Definition ArManager.h:46
ArMarker * AddFaceMarker(float size)
ArMarker * AddMarker(int index, float size)
ArBlobDetector * AddBlobDetector(cv::SimpleBlobDetector::Params params)
Definition ArManager.cpp:89
MarkerList markerList
Definition ArManager.h:51
ArMarker * AddObjMarker(const std::string path, float size, unsigned int maxFeatures=600)
static ArManager * GetInstance()
Definition ArManager.cpp:70
boost::shared_mutex listMutex
Definition ArManager.h:50
void updateFiducialMarkers(std::vector< aruco::Marker > detectedMarkers, LASTDATA lastd)
void RemoveMarker(ArMarker *marker)
void UpdateMarkers(cv::Mat image, ArCameraParam *arCameraParam, bool reversedBitmap=false, bool debugDraw=false)
Definition sSlam.h:74