summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_aruco/include
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_aruco/include')
-rw-r--r--ftnoir_tracker_aruco/include/aruco.h29
-rw-r--r--ftnoir_tracker_aruco/include/arucofidmarkers.h15
-rw-r--r--ftnoir_tracker_aruco/include/board.h168
-rw-r--r--ftnoir_tracker_aruco/include/boarddetector.h139
-rw-r--r--ftnoir_tracker_aruco/include/cameraparameters.h6
-rw-r--r--ftnoir_tracker_aruco/include/cvdrawingutils.h19
-rw-r--r--ftnoir_tracker_aruco/include/exports.h6
-rw-r--r--ftnoir_tracker_aruco/include/marker.h16
-rw-r--r--ftnoir_tracker_aruco/include/markerdetector.h56
9 files changed, 69 insertions, 385 deletions
diff --git a/ftnoir_tracker_aruco/include/aruco.h b/ftnoir_tracker_aruco/include/aruco.h
index 569b95fb..8ea583a8 100644
--- a/ftnoir_tracker_aruco/include/aruco.h
+++ b/ftnoir_tracker_aruco/include/aruco.h
@@ -26,12 +26,12 @@ The views and conclusions contained in the software and documentation are those
authors and should not be interpreted as representing official policies, either expressed
or implied, of Rafael Muñoz Salinas.
-
-
+
+
\mainpage ArUco: Augmented Reality library from the University of Cordoba
-ArUco is a minimal C++ library for detection of Augmented Reality markers based on OpenCv exclusively.
+ArUco is a minimal C++ library for detection of Augmented Reality markers based on OpenCv exclusively.
It is an educational project to show student how to detect augmented reality markers and it is provided under BSD license.
@@ -54,11 +54,11 @@ Aruco allows the possibility to employ board. Boards are markers composed by an
The library comes with five applications that will help you to learn how to use the library:
- aruco_create_marker: which creates marker and saves it in a jpg file you can print.
- - aruco_simple : simple test aplication that detects the markers in a image
+ - aruco_simple : simple test aplication that detects the markers in a image
- aruco_test: this is the main application for detection. It reads images either from the camera of from a video and detect markers. Additionally, if you provide the intrinsics of the camera(obtained by OpenCv calibration) and the size of the marker in meters, the library calculates the marker intrinsics so that you can easily create your AR applications.
- aruco_test_gl: shows how to use the library AR applications using OpenGL for rendering
- aruco_create_board: application that helps you to create a board
- - aruco_simple_board: simple test aplication that detects a board of markers in a image
+ - aruco_simple_board: simple test aplication that detects a board of markers in a image
- aruco_test_board: application that detects boards
- aruco_test_board_gl: application that detects boards and uses OpenGL to draw
@@ -66,7 +66,7 @@ The library comes with five applications that will help you to learn how to use
The ArUco library contents are divided in two main directories. The src directory, which contains the library itself. And the utils directory which contains the applications.
-The library main classes are:
+The library main classes are:
- aruco::CameraParameters: represent the information of the camera that captures the images. Here you must set the calibration info.
- aruco::Marker: which represent a marker detected in the image
- aruco::MarkerDetector: that is in charge of deteting the markers in a image Detection is done by simple calling the member funcion ArMarkerDetector::detect(). Additionally, the classes contain members to create the required matrices for rendering using OpenGL. See aruco_test_gl for details
@@ -101,34 +101,33 @@ The library has been compiled using MinGW and codeblocks. Below I describe the b
-# Download the source code and compile it using cmake and codeblocks. Note: install the library in C:\ if you want it to be easily detected by cmake afterwards
- step 4) aruco
-# Download and decompress.
- -# Open cmake gui application and set the path to the main library directory and also set a path where the project is going to be built.
+ -# Open cmake gui application and set the path to the main library directory and also set a path where the project is going to be built.
-# Generate the codeblock project.
-# Open the project with codeblock and compile then, install. The programs will be probably generated into the bin directory
OpenGL: by default, the mingw version installed has not the glut library. So, the opengl programs are not compiled. If you want to compile with OpenGL support, you must install glut, or prefereably freeglut.
-Thus,
- - Download the library (http://www.martinpayne.me.uk/software/development/GLUT/freeglut-MinGW.zip) for mingw.
- - Decompress in a directory X.
+Thus,
+ - Download the library (http://www.martinpayne.me.uk/software/development/GLUT/freeglut-MinGW.zip) for mingw.
+ - Decompress in a directory X.
- Then, rerun cmake setting the variable GLU_PATH to that directory (>cmake .. -DGLUT_PATH="C:\X")
- Finally, recompile and test. Indeed, you should move the freeglut.dll to the directory with the binaries or to any other place in the PATH.
CONCLUSION: Move to Linux, things are simpler :P
-
-\section Testing
+
+\section Testing
For testing the applications, the library provides videos and the corresponding camera parameters of these videos. Into the directories you will find information on how to run the examples.
-
+
\section Final Notes
- REQUIREMENTS: OpenCv >= 2.1.0. and OpenGL for (aruco_test_gl and aruco_test_board_gl)
- CONTACT: Rafael Munoz-Salinas: rmsalinas@uco.es
- This libary is free software and come with no guaratee!
-
+
*/
#include "markerdetector.h"
-#include "boarddetector.h"
#include "cvdrawingutils.h"
diff --git a/ftnoir_tracker_aruco/include/arucofidmarkers.h b/ftnoir_tracker_aruco/include/arucofidmarkers.h
index 7dad4672..15eb8e4c 100644
--- a/ftnoir_tracker_aruco/include/arucofidmarkers.h
+++ b/ftnoir_tracker_aruco/include/arucofidmarkers.h
@@ -31,7 +31,6 @@ or implied, of Rafael Muñoz Salinas.
#include <opencv2/core/core.hpp>
#include "exports.h"
#include "marker.h"
-#include "board.h"
namespace aruco {
class ARUCO_EXPORTS FiducidalMarkers {
@@ -80,7 +79,7 @@ public:
* @param gridSize grid layout (numer of sqaures in x and Y)
* @param MarkerSize size of markers sides in pixels
* @param MarkerDistance distance between the markers
- * @param TInfo output
+ * @param TInfo output
* @param excludedIds set of ids excluded from the board
*/
static cv::Mat createBoardImage( cv::Size gridSize,int MarkerSize,int MarkerDistance, BoardConfiguration& TInfo ,vector<int> *excludedIds=NULL ) throw (cv::Exception);
@@ -89,24 +88,24 @@ public:
/**Creates a printable image of a board in chessboard_like manner
* @param gridSize grid layout (numer of sqaures in x and Y)
* @param MarkerSize size of markers sides in pixels
- * @param TInfo output
+ * @param TInfo output
* @param setDataCentered indicates if the center is set at the center of the board. Otherwise it is the left-upper corner
- *
+ *
*/
static cv::Mat createBoardImage_ChessBoard( cv::Size gridSize,int MarkerSize, BoardConfiguration& TInfo ,bool setDataCentered=true ,vector<int> *excludedIds=NULL) throw (cv::Exception);
- /**Creates a printable image of a board in a frame fashion
+ /**Creates a printable image of a board in a frame fashion
* @param gridSize grid layout (numer of sqaures in x and Y)
* @param MarkerSize size of markers sides in pixels
* @param MarkerDistance distance between the markers
- * @param TInfo output
+ * @param TInfo output
* @param setDataCentered indicates if the center is set at the center of the board. Otherwise it is the left-upper corner
- *
+ *
*/
static cv::Mat createBoardImage_Frame( cv::Size gridSize,int MarkerSize,int MarkerDistance, BoardConfiguration& TInfo ,bool setDataCentered=true,vector<int> *excludedIds=NULL ) throw (cv::Exception);
private:
-
+
static vector<int> getListOfValidMarkersIds_random(int nMarkers,vector<int> *excluded) throw (cv::Exception);
static cv::Mat rotate(const cv::Mat & in);
static int hammDistMarker(cv::Mat bits);
diff --git a/ftnoir_tracker_aruco/include/board.h b/ftnoir_tracker_aruco/include/board.h
deleted file mode 100644
index c1d79292..00000000
--- a/ftnoir_tracker_aruco/include/board.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*****************************
-Copyright 2011 Rafael Muñoz Salinas. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are
-permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of
- conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
- of conditions and the following disclaimer in the documentation and/or other materials
- provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY Rafael Muñoz Salinas ''AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Rafael Muñoz Salinas OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-The views and conclusions contained in the software and documentation are those of the
-authors and should not be interpreted as representing official policies, either expressed
-or implied, of Rafael Muñoz Salinas.
-********************************/
-#ifndef _Aruco_board_h
-#define _Aruco_board_h
-#include <opencv2/opencv.hpp>
-#include <string>
-#include <vector>
-#include "exports.h"
-#include "marker.h"
-using namespace std;
-namespace aruco {
-/**
- * 3d representation of a marker
- */
-struct ARUCO_EXPORTS MarkerInfo:public vector<cv::Point3f> {
- MarkerInfo() {}
- MarkerInfo(int _id) {id=_id; }
- MarkerInfo(const MarkerInfo&MI): vector<cv::Point3f>(MI){id=MI.id; }
- MarkerInfo & operator=(const MarkerInfo&MI){
- vector<cv::Point3f> ::operator=(MI);
- id=MI.id;
- return *this;
- }
- int id;//maker id
-};
-
-/**\brief This class defines a board with several markers.
- * A Board contains several markers so that they are more robustly detected.
- *
- * In general, a board is a set of markers. So BoardConfiguration is only a list
- * of the id of the markers along with the position of their corners.
- *
- * The position of the corners can be specified either in pixels (in a non-specific size) or in meters.
- * The first is the typical case in which you generate the image of board and the print it. Since you do not know in advance the real
- * size of the markers, their corners are specified in pixels, and then, the translation to meters can be made once you know the real size.
- *
- * On the other hand, you may want to have the information of your boards in meters. The BoardConfiguration allows you to do so.
- *
- * The point is in the mInfoType variable. It can be either PIX or METERS according to your needs.
- *
-*/
-
-
-class ARUCO_EXPORTS BoardConfiguration: public vector<MarkerInfo>
-{
- friend class Board;
-public:
- enum MarkerInfoType {NONE=-1,PIX=0,METERS=1};//indicates if the data in MakersInfo is expressed in meters or in pixels so as to do conversion internally
- //variable indicates if the data in MakersInfo is expressed in meters or in pixels so as to do conversion internally
- int mInfoType;
- /**
- */
- BoardConfiguration();
-
- /**
- */
- BoardConfiguration(const BoardConfiguration &T);
-
- /**
- */
- BoardConfiguration & operator=(const BoardConfiguration &T);
- /**Saves the board info to a file
- */
- void saveToFile(string sfile)throw (cv::Exception);
- /**Reads board info from a file
- */
- void readFromFile(string sfile)throw (cv::Exception);
- /**Indicates if the corners are expressed in meters
- */
- bool isExpressedInMeters()const {
- return mInfoType==METERS;
- }
- /**Indicates if the corners are expressed in meters
- */
- bool isExpressedInPixels()const {
- return mInfoType==PIX;
- }
- /**Returns the index of the marker with id indicated, if is in the list
- */
- int getIndexOfMarkerId(int id)const;
- /**Returns the Info of the marker with id specified. If not in the set, throws exception
- */
- const MarkerInfo& getMarkerInfo(int id)const throw (cv::Exception);
- /**Set in the list passed the set of the ids
- */
- void getIdList(vector<int> &ids,bool append=true)const;
-private:
- /**Saves the board info to a file
- */
- void saveToFile(cv::FileStorage &fs)throw (cv::Exception);
- /**Reads board info from a file
- */
- void readFromFile(cv::FileStorage &fs)throw (cv::Exception);
-};
-
-/**
-*/
-class ARUCO_EXPORTS Board:public vector<Marker>
-{
-
-public:
- BoardConfiguration conf;
- //matrices of rotation and translation respect to the camera
- cv::Mat Rvec,Tvec;
- /**
- */
- Board()
- {
- Rvec.create(3,1,CV_32FC1);
- Tvec.create(3,1,CV_32FC1);
- for (int i=0;i<3;i++)
- Tvec.at<float>(i,0)=Rvec.at<float>(i,0)=-999999;
- }
-
- /**Given the extrinsic camera parameters returns the GL_MODELVIEW matrix for opengl.
- * Setting this matrix, the reference corrdinate system will be set in this board
- */
- void glGetModelViewMatrix(double modelview_matrix[16])throw(cv::Exception);
-
- /**
- * Returns position vector and orientation quaternion for an Ogre scene node or entity.
- * Use:
- * ...
- * Ogre::Vector3 ogrePos (position[0], position[1], position[2]);
- * Ogre::Quaternion ogreOrient (orientation[0], orientation[1], orientation[2], orientation[3]);
- * mySceneNode->setPosition( ogrePos );
- * mySceneNode->setOrientation( ogreOrient );
- * ...
- */
- void OgreGetPoseParameters( double position[3], double orientation[4] )throw(cv::Exception);
-
-
- /**Save this from a file
- */
- void saveToFile(string filePath)throw(cv::Exception);
- /**Read this from a file
- */
- void readFromFile(string filePath)throw(cv::Exception);
-
-};
-}
-
-#endif
diff --git a/ftnoir_tracker_aruco/include/boarddetector.h b/ftnoir_tracker_aruco/include/boarddetector.h
deleted file mode 100644
index 4770b5c9..00000000
--- a/ftnoir_tracker_aruco/include/boarddetector.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*****************************
-Copyright 2011 Rafael Muñoz Salinas. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are
-permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of
- conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
- of conditions and the following disclaimer in the documentation and/or other materials
- provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY Rafael Muñoz Salinas ''AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Rafael Muñoz Salinas OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-The views and conclusions contained in the software and documentation are those of the
-authors and should not be interpreted as representing official policies, either expressed
-or implied, of Rafael Muñoz Salinas.
-********************************/
-#ifndef _Aruco_BoardDetector_H
-#define _Aruco_BoardDetector_H
-#include <opencv2/opencv.hpp>
-#include "exports.h"
-#include "board.h"
-#include "cameraparameters.h"
-#include "markerdetector.h"
-using namespace std;
-
-namespace aruco
-{
-
-/**\brief This class detects AR boards
- * Version 1.2
- * There are two modes for board detection.
- * First, the old way. (You first detect markers with MarkerDetector and then call to detect in this class.
- *
- * Second: New mode, marker detection is included in the class
- * \code
-
- CameraParameters CP;
- CP.readFromFile(path_cp)
- BoardConfiguration BC;
- BC.readFromFile(path_bc);
- BoardDetector BD;
- BD.setParams(BC,CP); //or only BD.setParams(BC)
- //capture image
- cv::Mat im;
- capture_image(im);
-
- float prob=BD.detect(im);
- if (prob>0.3)
- CvDrawingUtils::draw3DAxis(im,BD.getDetectedBoard(),CP);
-
- \endcode
- *
-*/
-class ARUCO_EXPORTS BoardDetector
-{
-public:
- /** See discussion in @see enableRotateXAxis.
- * Do not change unless you know what you are doing
- */
- BoardDetector(bool setYPerperdicular=true);
-
-
- /**
- * Use if you plan to let this class to perform marker detection too
- */
- void setParams(const BoardConfiguration &bc,const CameraParameters &cp, float markerSizeMeters=-1);
- void setParams(const BoardConfiguration &bc);
- /**
- * Detect markers, and then, look for the board indicated in setParams()
- * @return value indicating the likelihood of having found the marker
- */
- float detect(const cv::Mat &im)throw (cv::Exception);
- /**Returns a reference to the board detected
- */
- Board & getDetectedBoard(){return _boardDetected;}
- /**Returns a reference to the internal marker detector
- */
- MarkerDetector &getMarkerDetector(){return _mdetector;}
- /**Returns the vector of markers detected
- */
- vector<Marker> &getDetectedMarkers(){return _vmarkers;}
-
-
- //ALTERNATIVE DETECTION METHOD, BASED ON MARKERS PREVIOUSLY DETECTED
-
- /** Given the markers detected, determines if there is the board passed
- * @param detectedMarkers result provided by aruco::ArMarkerDetector
- * @param BConf the board you want to see if is present
- * @param Bdetected output information of the detected board
- * @param camMatrix camera matrix with intrinsics
- * @param distCoeff camera distorsion coeff
- * @param camMatrix intrinsic camera information.
- * @param distCoeff camera distorsion coefficient. If set Mat() if is assumed no camera distorion
- * @param markerSizeMeters size of the marker sides expressed in meters
- * @return value indicating the likelihood of having found the marker
- */
- 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);
- float detect(const vector<Marker> &detectedMarkers,const BoardConfiguration &BConf, Board &Bdetected,const CameraParameters &cp, float markerSizeMeters=-1 )throw (cv::Exception);
-
-
- /**
- * By default, the Y axis is set to point up. However this is not the default
- * operation mode of opencv, which produces the Z axis pointing up instead.
- * So, to achieve this change, we have to rotate the X axis.
- */
- void setYPerperdicular(bool enable){_setYPerperdicular=enable;}
-
-
-
-
-private:
- void rotateXAxis(cv::Mat &rotation);
- bool _setYPerperdicular;
-
- //-- Functionality to detect markers inside
- bool _areParamsSet;
- BoardConfiguration _bconf;
- Board _boardDetected;
- float _markerSize;
- CameraParameters _camParams;
- MarkerDetector _mdetector;//internal markerdetector
- vector<Marker> _vmarkers;//markers detected in the call to : float detect(const cv::Mat &im);
-
-};
-
-}
-#endif
-
diff --git a/ftnoir_tracker_aruco/include/cameraparameters.h b/ftnoir_tracker_aruco/include/cameraparameters.h
index c3381a74..a419afbe 100644
--- a/ftnoir_tracker_aruco/include/cameraparameters.h
+++ b/ftnoir_tracker_aruco/include/cameraparameters.h
@@ -28,7 +28,7 @@ or implied, of Rafael Muñoz Salinas.
#ifndef _Aruco_CameraParameters_H
#define _Aruco_CameraParameters_H
#include "exports.h"
-#include <opencv2/opencv.hpp>
+#include <opencv2/core/core.hpp>
#include <string>
using namespace std;
namespace aruco
@@ -105,7 +105,7 @@ public:
* @param invert: indicates if the output projection matrix has to yield a horizontally inverted image because image data has not been stored in the order of glDrawPixels: bottom-to-top.
*/
void glGetProjectionMatrix( cv::Size orgImgSize, cv::Size size,double proj_matrix[16],double gnear,double gfar,bool invert=false )throw(cv::Exception);
-
+
/**
* setup camera for an Ogre project.
* Use:
@@ -117,7 +117,7 @@ public:
* As in OpenGL, it assumes no camera distorsion
*/
void OgreGetProjectionMatrix( cv::Size orgImgSize, cv::Size size,double proj_matrix[16],double gnear,double gfar,bool invert=false )throw(cv::Exception);
-
+
private:
//GL routines
diff --git a/ftnoir_tracker_aruco/include/cvdrawingutils.h b/ftnoir_tracker_aruco/include/cvdrawingutils.h
index 38e9986e..24bfe630 100644
--- a/ftnoir_tracker_aruco/include/cvdrawingutils.h
+++ b/ftnoir_tracker_aruco/include/cvdrawingutils.h
@@ -33,19 +33,12 @@ namespace aruco
{
/**\brief A set of functions to draw in opencv images
*/
- class ARUCO_EXPORTS CvDrawingUtils
- {
- public:
-
- static void draw3dAxis(cv::Mat &Image,Marker &m,const CameraParameters &CP);
-
- static void draw3dCube(cv::Mat &Image,Marker &m,const CameraParameters &CP);
-
- static void draw3dAxis(cv::Mat &Image,Board &m,const CameraParameters &CP);
-
- static void draw3dCube(cv::Mat &Image,Board &m,const CameraParameters &CP);
-
- };
+ class ARUCO_EXPORTS CvDrawingUtils
+ {
+ public:
+ static void draw3dAxis(cv::Mat &Image,Marker &m,const CameraParameters &CP);
+ static void draw3dCube(cv::Mat &Image,Marker &m,const CameraParameters &CP);
+ };
}
#endif
diff --git a/ftnoir_tracker_aruco/include/exports.h b/ftnoir_tracker_aruco/include/exports.h
index 154605ec..044a1367 100644
--- a/ftnoir_tracker_aruco/include/exports.h
+++ b/ftnoir_tracker_aruco/include/exports.h
@@ -25,7 +25,7 @@ The views and conclusions contained in the software and documentation are those
authors and should not be interpreted as representing official policies, either expressed
or implied, of Rafael Muñoz Salinas.
********************************/
-
+
#ifndef __OPENARUCO_CORE_TYPES_H__
@@ -37,9 +37,9 @@ or implied, of Rafael Muñoz Salinas.
#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined DSO_EXPORTS
- #define ARUCO_EXPORTS __declspec(dllexport)
+ #define ARUCO_EXPORTS __declspec(dllexport) __attribute__((visibility ("default")))
#else
- #define ARUCO_EXPORTS
+ #define ARUCO_EXPORTS __attribute__((visibility ("default")))
#endif
diff --git a/ftnoir_tracker_aruco/include/marker.h b/ftnoir_tracker_aruco/include/marker.h
index dc6bb28c..89961002 100644
--- a/ftnoir_tracker_aruco/include/marker.h
+++ b/ftnoir_tracker_aruco/include/marker.h
@@ -29,7 +29,7 @@ or implied, of Rafael Muñoz Salinas.
#define _Aruco_Marker_H
#include <vector>
#include <iostream>
-#include <opencv2/opencv.hpp>
+#include <opencv2/core/core.hpp>
#include "exports.h"
#include "cameraparameters.h"
using namespace std;
@@ -81,12 +81,12 @@ public:
* @param setYPerperdicular If set the Y axis will be perpendicular to the surface. Otherwise, it will be the Z axis
*/
void calculateExtrinsics(float markerSize,cv::Mat CameraMatrix,cv::Mat Distorsion=cv::Mat(),bool setYPerperdicular=true)throw(cv::Exception);
-
+
/**Given the extrinsic camera parameters returns the GL_MODELVIEW matrix for opengl.
* Setting this matrix, the reference coordinate system will be set in this marker
*/
void glGetModelViewMatrix( double modelview_matrix[16])throw(cv::Exception);
-
+
/**
* Returns position vector and orientation quaternion for an Ogre scene node or entity.
* Use:
@@ -97,8 +97,8 @@ public:
* mySceneNode->setOrientation( ogreOrient );
* ...
*/
- void OgreGetPoseParameters( double position[3], double orientation[4] )throw(cv::Exception);
-
+ void OgreGetPoseParameters( double position[3], double orientation[4] )throw(cv::Exception);
+
/**Returns the centroid of the marker
*/
cv::Point2f getCenter()const;
@@ -132,11 +132,11 @@ public:
return str;
}
-
-
+
+
private:
void rotateXAxis(cv::Mat &rotation);
-
+
};
}
diff --git a/ftnoir_tracker_aruco/include/markerdetector.h b/ftnoir_tracker_aruco/include/markerdetector.h
index 4d6e7b90..a4656527 100644
--- a/ftnoir_tracker_aruco/include/markerdetector.h
+++ b/ftnoir_tracker_aruco/include/markerdetector.h
@@ -27,7 +27,7 @@ or implied, of Rafael Muñoz Salinas.
********************************/
#ifndef _ARUCO_MarkerDetector_H
#define _ARUCO_MarkerDetector_H
-#include <opencv2/opencv.hpp>
+#include <opencv2/core/core.hpp>
#include <cstdio>
#include <iostream>
#include "cameraparameters.h"
@@ -47,7 +47,7 @@ class ARUCO_EXPORTS MarkerDetector
class MarkerCandidate: public Marker{
public:
MarkerCandidate(){}
- MarkerCandidate(const Marker &M): Marker(M){}
+ MarkerCandidate(const Marker &M): Marker(M){}
MarkerCandidate(const MarkerCandidate &M): Marker(M){
contour=M.contour;
idx=M.idx;
@@ -60,20 +60,20 @@ class ARUCO_EXPORTS MarkerDetector
idx=M.idx;
return M;
}
-
+
vector<cv::Point> contour;//all the points of its contour
int idx;//index position in the global contour list
};
public:
/**
- * See
+ * See
*/
- MarkerDetector();
+ MarkerDetector() {}
/**
*/
- ~MarkerDetector();
+ ~MarkerDetector() {}
/**Detects the markers in the image passed
*
@@ -161,17 +161,17 @@ public:
* of cols and rows.
* @param min size of the contour to consider a possible marker as valid (0,1]
* @param max size of the contour to consider a possible marker as valid [0,1)
- *
+ *
*/
void setMinMaxSize(float min=0.03,float max=0.5)throw(cv::Exception);
-
+
/**reads the min and max sizes employed
* @param min output size of the contour to consider a possible marker as valid (0,1]
* @param max output size of the contour to consider a possible marker as valid [0,1)
- *
+ *
*/
void getMinMaxSize(float &min,float &max){min=_minSize;max=_maxSize;}
-
+
/**Enables/Disables erosion process that is REQUIRED for chessboard like boards.
* By default, this property is enabled
*/
@@ -210,10 +210,10 @@ public:
markerIdDetector_ptrfunc=markerdetector_func;
}
- /** Use an smaller version of the input image for marker detection.
+ /** Use an smaller version of the input image for marker detection.
* If your marker is small enough, you can employ an smaller image to perform the detection without noticeable reduction in the precision.
* Internally, we are performing a pyrdown operation
- *
+ *
* @param level number of times the image size is divided by 2. Internally, we are performing a pyrdown.
*/
void pyrDown(unsigned int level){pyrdown_level=level;}
@@ -247,17 +247,17 @@ public:
* @return true if the operation succeed
*/
bool warp(cv::Mat &in,cv::Mat &out,cv::Size size, std::vector<cv::Point2f> points)throw (cv::Exception);
-
-
-
+
+
+
/** Refine MarkerCandidate Corner using LINES method
* @param candidate candidate to refine corners
*/
- void refineCandidateLines(MarkerCandidate &candidate);
-
-
+ void refineCandidateLines(MarkerCandidate &candidate);
+
+
/**DEPRECATED!!! Use the member function in CameraParameters
- *
+ *
* Given the intrinsic camera parameters returns the GL_PROJECTION matrix for opengl.
* PLease NOTE that when using OpenGL, it is assumed no camera distorsion! So, if it is not true, you should have
* undistor image
@@ -308,26 +308,26 @@ private:
*/
int perimeter(std::vector<cv::Point2f> &a);
-
+
// //GL routines
-//
+//
// static void argConvGLcpara2( double cparam[3][4], int width, int height, double gnear, double gfar, double m[16], bool invert )throw(cv::Exception);
// static int arParamDecompMat( double source[3][4], double cpara[3][4], double trans[3][4] )throw(cv::Exception);
// static double norm( double a, double b, double c );
// static double dot( double a1, double a2, double a3,
// double b1, double b2, double b3 );
-//
+//
//detection of the
void findBestCornerInRegion_harris(const cv::Mat & grey,vector<cv::Point2f> & Corners,int blockSize);
-
-
+
+
// auxiliar functions to perform LINES refinement
void interpolate2Dline( const vector< cv::Point > &inPoints, cv::Point3f &outLine);
- cv::Point2f getCrossPoint(const cv::Point3f& line1, const cv::Point3f& line2);
-
-
- /**Given a vector vinout with elements and a boolean vector indicating the lements from it to remove,
+ cv::Point2f getCrossPoint(const cv::Point3f& line1, const cv::Point3f& line2);
+
+
+ /**Given a vector vinout with elements and a boolean vector indicating the lements from it to remove,
* this function remove the elements
* @param vinout
* @param toRemove