#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 71 of file ocrblock.cpp.
74 return (*(
ROW **) row2)->bounding_box ().top () -
75 (*(
ROW **) row1)->bounding_box ().top ();
◆ ExtractBlobsFromSegmentation()
void ExtractBlobsFromSegmentation |
( |
BLOCK_LIST * |
blocks, |
|
|
C_BLOB_LIST * |
output_blob_list |
|
) |
| |
Definition at line 444 of file ocrblock.cpp.
446 C_BLOB_IT return_list_it(output_blob_list);
447 BLOCK_IT block_it(blocks);
448 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
449 BLOCK* block = block_it.data();
451 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
452 ROW* row = row_it.data();
455 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
456 WERD* werd = werd_it.data();
457 return_list_it.move_to_last();
458 return_list_it.add_list_after(werd->
cblob_list());
459 return_list_it.move_to_last();
ROW_LIST * row_list()
get rows
C_BLOB_LIST * cblob_list()
C_BLOB_LIST * rej_cblob_list()
◆ PrintSegmentationStats()
void PrintSegmentationStats |
( |
BLOCK_LIST * |
block_list | ) |
|
Definition at line 411 of file ocrblock.cpp.
416 BLOCK_IT block_it(block_list);
417 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
418 BLOCK* block = block_it.data();
421 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
423 ROW* row = row_it.data();
426 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
427 WERD* werd = werd_it.data();
433 tprintf(
"Block list stats:\nBlocks = %d\nRows = %d\nWords = %d\nBlobs = %d\n",
434 num_blocks, num_rows, num_words, num_blobs);
ROW_LIST * row_list()
get rows
C_BLOB_LIST * cblob_list()
◆ RefreshWordBlobsFromNewBlobs()
void RefreshWordBlobsFromNewBlobs |
( |
BLOCK_LIST * |
block_list, |
|
|
C_BLOB_LIST * |
new_blobs, |
|
|
C_BLOB_LIST * |
not_found_blobs |
|
) |
| |
Definition at line 479 of file ocrblock.cpp.
484 BLOCK_IT block_it(block_list);
485 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
486 BLOCK* block = block_it.data();
491 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
492 ROW* row = row_it.data();
496 WERD_IT new_words_it(&new_words);
497 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
498 WERD* werd = werd_it.extract();
504 new_words_it.add_after_then_move(new_werd);
510 new_words_it.add_after_then_move(werd);
515 werd_it.move_to_first();
516 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)