24#include <fvmodels/shape/accumulators/ht_accum.h>
30RhtXNode *RhtXNode::reuse_head = NULL;
31RhtYNode *RhtYNode::reuse_head = NULL;
32RhtRNode *RhtRNode::reuse_head = NULL;
34RhtXNode *RhtXNode::reuse_tail = NULL;
35RhtYNode *RhtYNode::reuse_tail = NULL;
36RhtRNode *RhtRNode::reuse_tail = NULL;
151 if (reuse_tail == NULL) {
153 p->
next = reuse_head;
179 reuse_tail = reuse_head;
189 reuse_head = reuse_tail;
267 if (reuse_tail == NULL) {
269 p->
next = reuse_head;
295 reuse_tail = reuse_head;
305 reuse_head = reuse_tail;
357 if (
count >= min_votes) {
362 node.push_back(
count);
380 s <<
"(" << x <<
"," << y <<
"," <<
r <<
") with vote " <<
count << endl;
392 if (reuse_tail == NULL) {
394 p->
next = reuse_head;
420 reuse_tail = reuse_head;
430 reuse_head = reuse_tail;
474 int count = root->
insert(x, y, r);
525 vector<vector<int>> *rv =
new vector<vector<int>>();
527 if ((min_votes <= num_votes) && (root != NULL)) {
Hough-Transform accumulator node.
virtual void clear(int ignore)
Clear.
RhtAccNode * next
used for recycling
virtual ~RhtAccNode()
Destructor.
unsigned int getNumVotes() const
Get number of votes.
int getMax(int &x, int &y, int &r) const
Get maximum.
std::vector< std::vector< int > > * getNodes(int min_count)
Get nodes.
int accumulate(int x, int y, int r)
Accumulate new candidate.
~RhtAccumulator()
Destructor.
void dump(std::ostream &)
Dump.
RhtAccumulator()
Constructor.
Hough-Transform accumulator node.
static RhtRNode * generate(int r)
Generate.
RhtRNode(int r)
Constructor.
void dump(std::ostream &, int x, int y)
Dump.
static void reset(void)
Reset.
static void cleanup(void)
Cleanup.
void getNodes(std::vector< std::vector< int > > *rv, int min_votes, int x, int y)
Get nodes.
Hough-Transform accumulator node.
int insert(int x, int y, int r)
Insert node.
static void reset(void)
Reset.
static void cleanup(void)
Cleanup.
RhtXNode(int x)
Constructor.
static RhtXNode * generate(int x)
Generate.
void dump(std::ostream &)
Dump to stream.
void getNodes(std::vector< std::vector< int > > *rv, int min_votes)
Get nodes.
Hough-Transform accumulator node.
static RhtYNode * generate(int y)
Generate.
void getNodes(std::vector< std::vector< int > > *rv, int min_votes, int x)
Get nodes.
static void reset(void)
Reset.
void dump(std::ostream &, int x)
Dump.
RhtYNode(int y)
Constructor.
static void cleanup(void)
Cleanup.
int insert(int y, int r)
Insert.