mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-22 09:53:03 +08:00
BlockPolygon: unrotate from internal to image coordinates
This commit is contained in:
parent
60b07d5dd8
commit
5751a408c9
@ -370,7 +370,13 @@ Pta* PageIterator::BlockPolygon() const {
|
||||
return nullptr; // Already at the end!
|
||||
if (it_->block()->block->pdblk.poly_block() == nullptr)
|
||||
return nullptr; // No layout analysis used - no polygon.
|
||||
ICOORDELT_IT it(it_->block()->block->pdblk.poly_block()->points());
|
||||
// Copy polygon, so we can unrotate it to image coordinates.
|
||||
POLY_BLOCK* internal_poly = it_->block()->block->pdblk.poly_block();
|
||||
ICOORDELT_LIST vertices;
|
||||
vertices.deep_copy(internal_poly->points(), ICOORDELT::deep_copy);
|
||||
POLY_BLOCK poly(&vertices, internal_poly->isA());
|
||||
poly.rotate(it_->block()->block->re_rotation());
|
||||
ICOORDELT_IT it(poly.points());
|
||||
Pta* pta = ptaCreate(it.length());
|
||||
int num_pts = 0;
|
||||
for (it.mark_cycle_pt(); !it.cycled_list(); it.forward(), ++num_pts) {
|
||||
|
Loading…
Reference in New Issue
Block a user