CRForestEstimator.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "CRForest.h"
00004 #include <fstream>
00005 #include "opencv2/core/core.hpp"
00006 
00007 struct Vote {
00008 
00009         cv::Vec<float,POSE_SIZE> vote;
00010         const float* trace;
00011         const float* conf;
00012         bool operator<(const Vote& a) const { return trace<a.trace; }
00013 
00014 };
00015 
00016 class CRForestEstimator {
00017 
00018 public:
00019 
00020         CRForestEstimator(){ crForest = 0; };
00021 
00022         ~CRForestEstimator(){ if(crForest) delete crForest; };
00023 
00024         bool loadForest(const char* treespath, int ntrees = 0);
00025 
00026         void estimate( const cv::Mat & im3D, //input: 3d image (x,y,z coordinates for each pixel)
00027                    std::vector< cv::Vec<float,POSE_SIZE> >& means, //output: heads' centers and orientations (x,y,z,pitch,yaw,roll)
00028                    std::vector< std::vector< Vote > >& clusters, //all clusters
00029                    std::vector< Vote >& votes, //all votes
00030                    int stride = 5, //stride
00031                    float max_variance = 1000, //max leaf variance
00032                    float prob_th = 1.0, //threshold on the leaf's probability of belonging to a head
00033                    float larger_radius_ratio = 1.0, //for clustering heads
00034                    float smaller_radius_ratio = 6.0, //for mean shift
00035                    bool verbose = false, //print out more info
00036                    int threshold = 400 //head threshold
00037         );
00038 
00039 
00040 private:
00041 
00042         cv::Rect getBoundingBox(const cv::Mat& im3D);
00043 
00044         CRForest* crForest;
00045 
00046 };
00047 
00048 


head_pose_estimation
Author(s): Dan Lazewatsky
autogenerated on Thu Feb 11 2016 23:06:59