#include "ocrblock.h"
#include <cstdlib>
#include <memory>
#include "stepblob.h"
#include "tprintf.h"
Go to the source code of this file.
| void ExtractBlobsFromSegmentation |
( |
BLOCK_LIST * |
blocks, |
|
|
C_BLOB_LIST * |
output_blob_list |
|
) |
| |
Definition at line 439 of file ocrblock.cpp.
441 C_BLOB_IT return_list_it(output_blob_list);
442 BLOCK_IT block_it(blocks);
443 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
444 BLOCK* block = block_it.data();
446 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
447 ROW* row = row_it.data();
450 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
451 WERD* werd = werd_it.data();
452 return_list_it.move_to_last();
453 return_list_it.add_list_after(werd->
cblob_list());
454 return_list_it.move_to_last();
C_BLOB_LIST * rej_cblob_list()
ROW_LIST * row_list()
get rows
C_BLOB_LIST * cblob_list()
| void PrintSegmentationStats |
( |
BLOCK_LIST * |
block_list | ) |
|
Definition at line 406 of file ocrblock.cpp.
411 BLOCK_IT block_it(block_list);
412 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
413 BLOCK* block = block_it.data();
416 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
418 ROW* row = row_it.data();
421 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
422 WERD* werd = werd_it.data();
428 tprintf(
"Block list stats:\nBlocks = %d\nRows = %d\nWords = %d\nBlobs = %d\n",
429 num_blocks, num_rows, num_words, num_blobs);
DLLSYM void tprintf(const char *format,...)
ROW_LIST * row_list()
get rows
C_BLOB_LIST * cblob_list()
| void RefreshWordBlobsFromNewBlobs |
( |
BLOCK_LIST * |
block_list, |
|
|
C_BLOB_LIST * |
new_blobs, |
|
|
C_BLOB_LIST * |
not_found_blobs |
|
) |
| |
Definition at line 474 of file ocrblock.cpp.
479 BLOCK_IT block_it(block_list);
480 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
481 BLOCK* block = block_it.data();
486 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
487 ROW* row = row_it.data();
491 WERD_IT new_words_it(&new_words);
492 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
493 WERD* werd = werd_it.extract();
499 new_words_it.add_after_then_move(new_werd);
505 new_words_it.add_after_then_move(werd);
510 werd_it.move_to_first();
511 werd_it.add_list_after(&new_words);
POLY_BLOCK * poly_block() const
PDBLK pdblk
Page Description Block.
WERD * ConstructWerdWithNewBlobs(C_BLOB_LIST *all_blobs, C_BLOB_LIST *orphan_blobs)
ROW_LIST * row_list()
get rows