#include "ocrblock.h"
#include <cstdlib>
#include <memory>
#include "stepblob.h"
#include "tprintf.h"
Go to the source code of this file.
◆ ROW_SPACING
◆ ExtractBlobsFromSegmentation()
void ExtractBlobsFromSegmentation |
( |
BLOCK_LIST * |
blocks, |
|
|
C_BLOB_LIST * |
output_blob_list |
|
) |
| |
Definition at line 435 of file ocrblock.cpp.
440 C_BLOB_IT return_list_it(output_blob_list);
441 BLOCK_IT block_it(blocks);
442 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
443 BLOCK* block = block_it.data();
445 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
446 ROW* row = row_it.data();
449 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
450 WERD* werd = werd_it.data();
451 return_list_it.move_to_last();
452 return_list_it.add_list_after(werd->
cblob_list());
453 return_list_it.move_to_last();
◆ PrintSegmentationStats()
void PrintSegmentationStats |
( |
BLOCK_LIST * |
block_list | ) |
|
Definition at line 403 of file ocrblock.cpp.
410 BLOCK_IT block_it(block_list);
411 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
412 BLOCK* block = block_it.data();
415 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
417 ROW* row = row_it.data();
420 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
421 WERD* werd = werd_it.data();
427 tprintf(
"Block list stats:\nBlocks = %d\nRows = %d\nWords = %d\nBlobs = %d\n",
◆ RefreshWordBlobsFromNewBlobs()
void RefreshWordBlobsFromNewBlobs |
( |
BLOCK_LIST * |
block_list, |
|
|
C_BLOB_LIST * |
new_blobs, |
|
|
C_BLOB_LIST * |
not_found_blobs |
|
) |
| |
Definition at line 469 of file ocrblock.cpp.
478 BLOCK_IT block_it(block_list);
479 for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
480 BLOCK* block = block_it.data();
485 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
486 ROW* row = row_it.data();
490 WERD_IT new_words_it(&new_words);
491 for (werd_it.mark_cycle_pt(); !werd_it.cycled_list(); werd_it.forward()) {
492 WERD* werd = werd_it.extract();
498 new_words_it.add_after_then_move(new_werd);
504 new_words_it.add_after_then_move(werd);
509 werd_it.move_to_first();