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,
00027 std::vector< cv::Vec<float,POSE_SIZE> >& means,
00028 std::vector< std::vector< Vote > >& clusters,
00029 std::vector< Vote >& votes,
00030 int stride = 5,
00031 float max_variance = 1000,
00032 float prob_th = 1.0,
00033 float larger_radius_ratio = 1.0,
00034 float smaller_radius_ratio = 6.0,
00035 bool verbose = false,
00036 int threshold = 400
00037 );
00038
00039
00040 private:
00041
00042 cv::Rect getBoundingBox(const cv::Mat& im3D);
00043
00044 CRForest* crForest;
00045
00046 };
00047
00048