#include <bbgrid.h>
template<class BBC, class BBC_CLIST, class BBC_C_IT>
class tesseract::GridSearch< BBC, BBC_CLIST, BBC_C_IT >
Definition at line 48 of file bbgrid.h.
◆ GridSearch()
template<class BBC, class BBC_CLIST, class BBC_C_IT>
◆ GridX()
template<class BBC, class BBC_CLIST, class BBC_C_IT>
◆ GridY()
template<class BBC, class BBC_CLIST, class BBC_C_IT>
◆ NextFullSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 675 of file bbgrid.h.
679 while (it_.cycled_list()) {
681 if (x_ >= grid_->gridwidth_) {
690 TBOX box = previous_return_->bounding_box();
691 grid_->GridCoords(box.
left(), box.
bottom(), &x, &y);
692 }
while (x != x_ || y != y_);
693 return previous_return_;
◆ NextRadSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 713 of file bbgrid.h.
715 while (it_.cycled_list()) {
717 if (rad_index_ >= radius_) {
722 if (radius_ > max_radius_)
728 offset *= radius_ - rad_index_;
730 x_ = x_origin_ + offset.
x();
731 y_ = y_origin_ + offset.
y();
732 if (x_ >= 0 && x_ < grid_->gridwidth_ &&
733 y_ >= 0 && y_ < grid_->gridheight_)
737 }
while (unique_mode_ && returns_.find(previous_return_) != returns_.end());
739 returns_.insert(previous_return_);
740 return previous_return_;
◆ NextRectSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 842 of file bbgrid.h.
844 while (it_.cycled_list()) {
846 if (x_ > max_radius_) {
855 }
while (!rect_.
overlap(previous_return_->bounding_box()) ||
856 (unique_mode_ && returns_.find(previous_return_) != returns_.end()));
858 returns_.insert(previous_return_);
859 return previous_return_;
◆ NextSideSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 761 of file bbgrid.h.
763 while (it_.cycled_list()) {
765 if (rad_index_ > radius_) {
771 if (x_ < 0 || x_ >= grid_->gridwidth_)
774 y_ = y_origin_ - rad_index_;
775 if (y_ >= 0 && y_ < grid_->gridheight_)
779 }
while (unique_mode_ && returns_.find(previous_return_) != returns_.end());
781 returns_.insert(previous_return_);
782 return previous_return_;
◆ NextVerticalSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 802 of file bbgrid.h.
805 while (it_.cycled_list()) {
807 if (rad_index_ > radius_) {
813 if (y_ < 0 || y_ >= grid_->gridheight_)
816 x_ = x_origin_ + rad_index_;
817 if (x_ >= 0 && x_ < grid_->gridwidth_)
821 }
while (unique_mode_ && returns_.find(previous_return_) != returns_.end());
823 returns_.insert(previous_return_);
824 return previous_return_;
◆ RemoveBBox()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 866 of file bbgrid.h.
867 if (previous_return_ !=
nullptr) {
871 BBC* prev_data =
nullptr;
872 BBC* new_previous_return =
nullptr;
874 for (it_.mark_cycle_pt(); !it_.cycled_list();) {
875 if (it_.data() == previous_return_) {
876 new_previous_return = prev_data;
879 next_return_ = it_.cycled_list() ? nullptr : it_.data();
881 prev_data = it_.data();
885 grid_->RemoveBBox(previous_return_);
886 previous_return_ = new_previous_return;
◆ RepositionIterator()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 892 of file bbgrid.h.
903 if (!it_.empty() && it_.data() == next_return_) {
907 for (it_.mark_cycle_pt(); !it_.cycled_list(); it_.forward()) {
908 if (it_.data() == previous_return_ ||
909 it_.data_relative(1) == next_return_) {
915 previous_return_ =
nullptr;
916 next_return_ =
nullptr;
◆ ReturnedSeedElement()
template<class BBC, class BBC_CLIST, class BBC_C_IT>
Definition at line 264 of file bbgrid.h.
265 TBOX box = previous_return_->bounding_box();
266 int x_center = (box.
left()+box.
right())/2;
267 int y_center = (box.
top()+box.
bottom())/2;
269 grid_->GridCoords(x_center, y_center, &grid_x, &grid_y);
270 return (x_ == grid_x) && (y_ == grid_y);
◆ SetUniqueMode()
template<class BBC, class BBC_CLIST, class BBC_C_IT>
◆ StartFullSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 665 of file bbgrid.h.
668 CommonStart(grid_->bleft_.x(), grid_->tright_.y());
◆ StartRadSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 698 of file bbgrid.h.
703 max_radius_ = max_radius;
◆ StartRectSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 830 of file bbgrid.h.
835 CommonStart(rect.
left(), rect.
top());
837 &max_radius_, &y_origin_);
◆ StartSideSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 746 of file bbgrid.h.
752 radius_ = ((ymax - ymin) * 2 + grid_->gridsize_ - 1) / grid_->gridsize_;
754 CommonStart(x, ymax);
◆ StartVerticalSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
void tesseract::GridSearch< BBC, BBC_CLIST, BBC_C_IT >::StartVerticalSearch |
( |
int |
xmin, |
|
|
int |
xmax, |
|
|
int |
y |
|
) |
| |
Definition at line 788 of file bbgrid.h.
793 radius_ = (xmax - xmin + grid_->gridsize_ - 1) / grid_->gridsize_;
795 CommonStart(xmin, y);
The documentation for this class was generated from the following file: