#include <faster_detector.h>
Definition at line 36 of file faster_detector.h.
Public Member Functions | |
virtual void | operator() (const CVD::Image< CVD::byte > &i, std::vector< CVD::ImageRef > &c, unsigned int N) const |
faster_learn (const std::string &fname) | |
Private Attributes | |
std::auto_ptr < tree_element > | tree |
faster_learn::faster_learn | ( | const std::string & | fname | ) |
Initialize a detector.
fname | File to load the detector from. This was created from learn_detector. |
Definition at line 72 of file faster_detector.cc.
References load_a_tree(), and block_bytecode::print().
00073 { 00074 init(); 00075 ifstream i; 00076 i.open(fname.c_str()); 00077 00078 if(!i.good()) 00079 { 00080 cerr << "Error: " << fname << ": " << strerror(errno) << endl; 00081 exit(1); 00082 } 00083 00084 try{ 00085 tree.reset(load_a_tree(i)); 00086 } 00087 catch(ParseError p) 00088 { 00089 cerr << "Parse error in " << fname << endl; 00090 exit(1); 00091 } 00092 00093 if(GV3::get<bool>("faster_tree.print_tree", 0, 1)) 00094 { 00095 clog << "Tree:" << endl; 00096 tree->print(clog); 00097 } 00098 00099 if(GV3::get<bool>("faster_tree.print_block", 0, 1)) 00100 { 00101 block_bytecode f2 = tree->make_fast_detector(100); 00102 f2.print(clog, 100); 00103 } 00104 }
void faster_learn::operator() | ( | const CVD::Image< CVD::byte > & | i, | |
std::vector< CVD::ImageRef > & | c, | |||
unsigned int | N | |||
) | const [virtual] |
Detect corners.
i | Image in which to detect corners | |
c | Detected corners are inserted in to this container | |
N | Threshold used to detect corners |
Implements DetectT.
Definition at line 107 of file faster_detector.cc.
References tree_detect_corners().
00108 { 00109 Image<int> scratch(i.size(), 0); 00110 00111 v = tree_detect_corners(i, tree.get(), t, scratch); 00112 }
std::auto_ptr<tree_element> faster_learn::tree [private] |