#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 443 of file ocrblock.cpp.
445 C_BLOB_IT return_list_it(output_blob_list);
446 BLOCK_IT block_it(blocks);
447 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
448 BLOCK* block = block_it.data();
450 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
451 ROW* row = row_it.data();
454 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
455 WERD* werd = werd_it.data();
456 return_list_it.move_to_last();
457 return_list_it.add_list_after(werd->
cblob_list());
458 return_list_it.move_to_last();
C_BLOB_LIST * cblob_list()
C_BLOB_LIST * rej_cblob_list()
ROW_LIST * row_list()
get rows
◆ PrintSegmentationStats()
void PrintSegmentationStats |
( |
BLOCK_LIST * |
block_list | ) |
|
Definition at line 410 of file ocrblock.cpp.
415 BLOCK_IT block_it(block_list);
416 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
417 BLOCK* block = block_it.data();
420 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
422 ROW* row = row_it.data();
425 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
426 WERD* werd = werd_it.data();
432 tprintf(
"Block list stats:\nBlocks = %d\nRows = %d\nWords = %d\nBlobs = %d\n",
433 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 478 of file ocrblock.cpp.
483 BLOCK_IT block_it(block_list);
484 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
485 BLOCK* block = block_it.data();
490 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
491 ROW* row = row_it.data();
495 WERD_IT new_words_it(&new_words);
496 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
497 WERD* werd = werd_it.extract();
503 new_words_it.add_after_then_move(new_werd);
509 new_words_it.add_after_then_move(werd);
514 werd_it.move_to_first();
515 werd_it.add_list_after(&new_words);
WERD * ConstructWerdWithNewBlobs(C_BLOB_LIST *all_blobs, C_BLOB_LIST *orphan_blobs)
POLY_BLOCK * poly_block() const
ROW_LIST * row_list()
get rows