24 #include <fvmodels/shape/accumulators/ht_accum.h> 33 RhtXNode* RhtXNode::reuse_head = NULL;
34 RhtYNode* RhtYNode::reuse_head = NULL;
35 RhtRNode* RhtRNode::reuse_head = NULL;
37 RhtXNode* RhtXNode::reuse_tail = NULL;
38 RhtYNode* RhtYNode::reuse_tail = NULL;
39 RhtRNode* RhtRNode::reuse_tail = NULL;
62 RhtAccNode::RhtAccNode()
64 left = right = next = NULL;
69 RhtAccNode::~RhtAccNode()
77 RhtAccNode::clear(
int ignore)
86 RhtXNode::RhtXNode(
int x)
163 if (reuse_tail == NULL)
166 p->
next = reuse_head;
195 reuse_tail = reuse_head;
207 reuse_head = reuse_tail;
294 if (reuse_tail == NULL)
297 p->
next = reuse_head;
326 reuse_tail = reuse_head;
338 reuse_head = reuse_tail;
397 if (
count >= min_votes) {
402 node.push_back(
count );
403 rv->push_back( node );
421 s <<
"("<<x<<
","<<y<<
","<<
r<<
") with vote "<<
count<<endl;
434 if (reuse_tail == NULL)
437 p->
next = reuse_head;
465 reuse_tail = reuse_head;
476 reuse_head = reuse_tail;
524 int count = root->insert(x, y, r);
575 vector< vector< int > > *
578 vector< vector< int > > *rv =
new vector< vector< int > >();
580 if ( (min_votes <= num_votes) && (root != NULL) ) {
581 root->getNodes( rv, min_votes );
void getNodes(std::vector< std::vector< int > > *rv, int min_votes, int x, int y)
Get nodes.
void getNodes(std::vector< std::vector< int > > *rv, int min_votes, int x)
Get nodes.
static RhtRNode * generate(int r)
Generate.
int getMax(int &x, int &y, int &r) const
Get maximum.
static void reset(void)
Reset.
Hough-Transform accumulator node.
~RhtAccumulator()
Destructor.
void dump(std::ostream &, int x)
Dump.
Hough-Transform accumulator node.
virtual void clear(int ignore)
Clear.
void dump(std::ostream &)
Dump to stream.
void dump(std::ostream &)
Dump.
static void cleanup(void)
Cleanup.
RhtRNode(int r)
Constructor.
RhtAccNode * next
used for recycling
Hough-Transform accumulator node.
static void reset(void)
Reset.
RhtAccumulator()
Constructor.
static RhtYNode * generate(int y)
Generate.
int insert(int y, int r)
Insert.
int insert(int x, int y, int r)
Insert node.
void getNodes(std::vector< std::vector< int > > *rv, int min_votes)
Get nodes.
static RhtXNode * generate(int x)
Generate.
static void cleanup(void)
Cleanup.
unsigned int getNumVotes() const
Get number of votes.
static void cleanup(void)
Cleanup.
RhtXNode(int x)
Constructor.
std::vector< std::vector< int > > * getNodes(int min_count)
Get nodes.
RhtYNode(int y)
Constructor.
int accumulate(int x, int y, int r)
Accumulate new candidate.
Hough-Transform accumulator node.
static void reset(void)
Reset.
void dump(std::ostream &, int x, int y)
Dump.