#include <stridemap.h>
Definition at line 41 of file stridemap.h.
◆ StrideMap()
tesseract::StrideMap::StrideMap |
( |
| ) |
|
|
inline |
Definition at line 104 of file stridemap.h.
104 {
105 memset(shape_, 0, sizeof(shape_));
106 memset(t_increments_, 0, sizeof(t_increments_));
107 }
◆ ReduceWidthTo1()
void tesseract::StrideMap::ReduceWidthTo1 |
( |
| ) |
|
Definition at line 166 of file stridemap.cpp.
166 {
167 widths_.assign(widths_.size(), 1);
169 ComputeTIncrements();
170}
◆ ScaleXY()
void tesseract::StrideMap::ScaleXY |
( |
int |
x_factor, |
|
|
int |
y_factor |
|
) |
| |
Definition at line 153 of file stridemap.cpp.
153 {
154 for (int &height : heights_) {
155 height /= y_factor;
156 }
157 for (int &width : widths_) {
158 width /= x_factor;
159 }
162 ComputeTIncrements();
163}
◆ SetStride()
void tesseract::StrideMap::SetStride |
( |
const std::vector< std::pair< int, int > > & |
h_w_pairs | ) |
|
Definition at line 131 of file stridemap.cpp.
131 {
132 int max_height = 0;
133 int max_width = 0;
134 for (const std::pair<int, int> &hw : h_w_pairs) {
135 int height = hw.first;
136 int width = hw.second;
137 heights_.push_back(height);
138 widths_.push_back(width);
139 if (height > max_height) {
140 max_height = height;
141 }
142 if (width > max_width) {
143 max_width = width;
144 }
145 }
149 ComputeTIncrements();
150}
◆ Size()
Definition at line 119 of file stridemap.h.
119 {
120 return shape_[dimension];
121 }
◆ TransposeXY()
void tesseract::StrideMap::TransposeXY |
( |
| ) |
|
Definition at line 173 of file stridemap.cpp.
173 {
175 std::swap(heights_, widths_);
176 ComputeTIncrements();
177}
◆ Width()
int tesseract::StrideMap::Width |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files:
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/lstm/stridemap.h
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/lstm/stridemap.cpp