#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 233 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 711 of file bbgrid.h.
715 while (it_.cycled_list()) {
717 if (x_ >= grid_->gridwidth_) {
727 TBOX box = previous_return_->bounding_box();
728 grid_->GridCoords(box.left(), box.bottom(), &x, &y);
729 }
while (x != x_ || y != y_);
730 return previous_return_;
◆ NextRadSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 749 of file bbgrid.h.
751 while (it_.cycled_list()) {
753 if (rad_index_ >= radius_) {
758 if (radius_ > max_radius_) {
765 offset *= radius_ - rad_index_;
767 x_ = x_origin_ + offset.x();
768 y_ = y_origin_ + offset.y();
769 if (x_ >= 0 && x_ < grid_->gridwidth_ && y_ >= 0 && y_ < grid_->gridheight_) {
777 auto inserted = returns_.insert(previous_return_);
778 if (inserted.second) {
782 return previous_return_;
static ICOORD chain_step(int chaindir)
◆ NextRectSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 896 of file bbgrid.h.
898 while (it_.cycled_list()) {
900 if (x_ > max_radius_) {
903 if (y_ < y_origin_) {
910 if (!rect_.
overlap(previous_return_->bounding_box())) {
916 auto inserted = returns_.insert(previous_return_);
917 if (inserted.second) {
921 return previous_return_;
bool overlap(const TBOX &box) const
◆ NextSideSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 802 of file bbgrid.h.
804 while (it_.cycled_list()) {
806 if (rad_index_ > radius_) {
813 if (x_ < 0 || x_ >= grid_->gridwidth_) {
817 y_ = y_origin_ - rad_index_;
818 if (y_ >= 0 && y_ < grid_->gridheight_) {
826 auto inserted = returns_.insert(previous_return_);
827 if (inserted.second) {
831 return previous_return_;
◆ NextVerticalSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 849 of file bbgrid.h.
851 while (it_.cycled_list()) {
853 if (rad_index_ > radius_) {
860 if (y_ < 0 || y_ >= grid_->gridheight_) {
864 x_ = x_origin_ + rad_index_;
865 if (x_ >= 0 && x_ < grid_->gridwidth_) {
873 auto inserted = returns_.insert(previous_return_);
874 if (inserted.second) {
878 return previous_return_;
◆ RemoveBBox()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 928 of file bbgrid.h.
929 if (previous_return_ !=
nullptr) {
933 BBC *prev_data =
nullptr;
934 BBC *new_previous_return =
nullptr;
936 for (it_.mark_cycle_pt(); !it_.cycled_list();) {
937 if (it_.data() == previous_return_) {
938 new_previous_return = prev_data;
941 next_return_ = it_.cycled_list() ? nullptr : it_.data();
943 prev_data = it_.data();
947 grid_->RemoveBBox(previous_return_);
948 previous_return_ = new_previous_return;
void RepositionIterator()
◆ RepositionIterator()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 954 of file bbgrid.h.
965 if (!it_.empty() && it_.data() == next_return_) {
969 for (it_.mark_cycle_pt(); !it_.cycled_list(); it_.forward()) {
970 if (it_.data() == previous_return_ || it_.data_relative(1) == next_return_) {
976 previous_return_ =
nullptr;
977 next_return_ =
nullptr;
◆ ReturnedSeedElement()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 260 of file bbgrid.h.
261 TBOX box = previous_return_->bounding_box();
262 int x_center = (box.left() + box.right()) / 2;
263 int y_center = (box.top() + box.bottom()) / 2;
265 grid_->GridCoords(x_center, y_center, &grid_x, &grid_y);
266 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 701 of file bbgrid.h.
704 CommonStart(grid_->bleft_.x(), grid_->tright_.y());
◆ StartRadSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 735 of file bbgrid.h.
739 max_radius_ = max_radius;
◆ StartRectSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 884 of file bbgrid.h.
889 CommonStart(rect.left(), rect.top());
890 grid_->GridCoords(rect.right(), rect.bottom(),
891 &max_radius_, &y_origin_);
◆ StartSideSearch()
template<class BBC , class BBC_CLIST , class BBC_C_IT >
Definition at line 788 of file bbgrid.h.
793 radius_ = ((ymax - ymin) * 2 + grid_->gridsize_ - 1) / grid_->gridsize_;
795 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 837 of file bbgrid.h.
840 radius_ = (xmax - xmin + grid_->gridsize_ - 1) / grid_->gridsize_;
842 CommonStart(xmin, y);
The documentation for this class was generated from the following file: