24 #include <fvmodels/shape/accumulators/ht_accum.h> 28 namespace firevision {
30 RhtXNode *RhtXNode::reuse_head = NULL;
31 RhtYNode *RhtYNode::reuse_head = NULL;
32 RhtRNode *RhtRNode::reuse_head = NULL;
34 RhtXNode *RhtXNode::reuse_tail = NULL;
35 RhtYNode *RhtYNode::reuse_tail = NULL;
36 RhtRNode *RhtRNode::reuse_tail = NULL;
59 RhtAccNode::RhtAccNode()
61 left = right = next = NULL;
65 RhtAccNode::~RhtAccNode()
73 RhtAccNode::clear(
int ignore)
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);
522 vector<vector<int>> *
525 vector<vector<int>> *rv =
new vector<vector<int>>();
527 if ((min_votes <= num_votes) && (root != NULL)) {
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 getNodes(std::vector< std::vector< int >> *rv, int min_votes, int x)
Get nodes.
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.
static RhtXNode * generate(int x)
Generate.
void getNodes(std::vector< std::vector< int >> *rv, int min_votes, int x, int y)
Get nodes.
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.
void getNodes(std::vector< std::vector< int >> *rv, int min_votes)
Get nodes.
static void reset(void)
Reset.
void dump(std::ostream &, int x, int y)
Dump.