#include "ocrpara.h"
#include "ocrrow.h"
#include "pdblock.h"
Go to the source code of this file.
◆ decreasing_top_order()
int decreasing_top_order |
( |
const void * |
row1, |
|
|
const void * |
row2 |
|
) |
| |
decreasing_top_order
Sort Comparator: Return <0 if row1 top < row2 top
Definition at line 72 of file ocrblock.cpp.
75 return (*(
ROW **) row2)->bounding_box ().top () -
76 (*(
ROW **) row1)->bounding_box ().top ();
◆ ExtractBlobsFromSegmentation()
void ExtractBlobsFromSegmentation |
( |
BLOCK_LIST * |
blocks, |
|
|
C_BLOB_LIST * |
output_blob_list |
|
) |
| |
Definition at line 445 of file ocrblock.cpp.
447 C_BLOB_IT return_list_it(output_blob_list);
448 BLOCK_IT block_it(blocks);
449 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
450 BLOCK* block = block_it.data();
452 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
453 ROW* row = row_it.data();
456 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
457 WERD* werd = werd_it.data();
458 return_list_it.move_to_last();
459 return_list_it.add_list_after(werd->
cblob_list());
460 return_list_it.move_to_last();
C_BLOB_LIST * cblob_list()
ROW_LIST * row_list()
get rows
C_BLOB_LIST * rej_cblob_list()
◆ PrintSegmentationStats()
void PrintSegmentationStats |
( |
BLOCK_LIST * |
block_list | ) |
|
Definition at line 412 of file ocrblock.cpp.
417 BLOCK_IT block_it(block_list);
418 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
419 BLOCK* block = block_it.data();
422 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
424 ROW* row = row_it.data();
427 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
428 WERD* werd = werd_it.data();
434 tprintf(
"Block list stats:\nBlocks = %d\nRows = %d\nWords = %d\nBlobs = %d\n",
435 num_blocks, num_rows, num_words, num_blobs);
C_BLOB_LIST * cblob_list()
ROW_LIST * row_list()
get rows
◆ RefreshWordBlobsFromNewBlobs()
void RefreshWordBlobsFromNewBlobs |
( |
BLOCK_LIST * |
block_list, |
|
|
C_BLOB_LIST * |
new_blobs, |
|
|
C_BLOB_LIST * |
not_found_blobs |
|
) |
| |
Definition at line 480 of file ocrblock.cpp.
485 BLOCK_IT block_it(block_list);
486 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
487 BLOCK* block = block_it.data();
492 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
493 ROW* row = row_it.data();
497 WERD_IT new_words_it(&new_words);
498 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
499 WERD* werd = werd_it.extract();
505 new_words_it.add_after_then_move(new_werd);
511 new_words_it.add_after_then_move(werd);
516 werd_it.move_to_first();
517 werd_it.add_list_after(&new_words);
ROW_LIST * row_list()
get rows
POLY_BLOCK * poly_block() const
WERD * ConstructWerdWithNewBlobs(C_BLOB_LIST *all_blobs, C_BLOB_LIST *orphan_blobs)