BitmapToolkit Scol plugin
ArFaceMarker.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/*
26 Toolkit based on OpenCV library
27 First version : dec 2010
28 Author : Bastien BOURINEAU
29*/
30
31#ifndef __BTK_FACEMARKER_H__
32#define __BTK_FACEMARKER_H__
33
34#include "Prerequisites.h"
35#include <vector>
36#include <iostream>
37#include "opencv2/features2d/features2d.hpp"
38#include "cameraparameters.h"
39#include "marker.h"
40#include "ArFeaturedMarker.h"
41
46typedef struct model_struct FLANDMARK_Model;
47
49{
50public:
51 std::vector<cv::Point2f> m_lastCorner;
52
55 ArFaceMarker(unsigned int mid, float size);
56
60
63 //void calculateFeaturedExtrinsics(float markerSize, aruco::CameraParameters& camParams, bool setYPerpendicular=true);
64
65 void SetImage(const cv::Mat image, std::vector<cv::Rect> objRects);
66
67 bool detectMotionFlow(cv::Mat &frame);
68
69 bool IsInitialized();
70
71 void Update(cv::Mat frame, cv::Mat color, aruco::CameraParameters& camparam, bool reverse);
72private:
73 unsigned int m_maxFeatures;
74 bool m_bInitialized;
75 cv::Rect m_ObjRect;
76 cv::Mat m_prevFrame;
77 std::vector<cv::Point2f> m_pcorners;
78 std::vector<cv::Point2f> m_ObjPoints;
79 std::vector<bool> m_lastFoundPoints;
80 unsigned int m_nbInitFrames;
81 unsigned int m_initFrames;
82 unsigned int m_minInliners;
83 FilterDoubleExponential3f m_PosSmoothers;
84
85 bool GetCorners(std::vector<cv::Point2f> trainPoints, std::vector<cv::Point2f> framePoints);
86 cv::Point3f UnProjectPoint(cv::Point2f pt, cv::Point2f offset, float width, float height, float radius);
87};
88
89#endif
struct model_struct FLANDMARK_Model
This class represents a marker. It is a vector of the fours corners ot the marker.
void SetImage(const cv::Mat image, std::vector< cv::Rect > objRects)
bool IsInitialized()
void Update(cv::Mat frame, cv::Mat color, aruco::CameraParameters &camparam, bool reverse)
std::vector< cv::Point2f > m_lastCorner
bool detectMotionFlow(cv::Mat &frame)
std::vector< cv::Point2f > GetCorners()
Definition ArMarker.cpp:325