Skip to content

Commit f25cc27

Browse files
author
Ray Smith
committed
Update fopr leptonica 1.74
1 parent a2a72d7 commit f25cc27

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

textord/imagefind.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,19 @@ Pix* ImageFind::FindImages(Pix* pix, DebugPixa* pixa_debug) {
8484
pixDestroy(&pixr);
8585
return pixCreate(pixGetWidth(pix), pixGetHeight(pix), 1);
8686
}
87+
// Get the halftone mask.
8788
l_int32 ht_found = 0;
88-
Pix *pixht2 = pixGenHalftoneMask(pixr, NULL, &ht_found,
89-
textord_tabfind_show_images);
89+
Pixa* pixadb = (textord_tabfind_show_images && pixa_debug != nullptr)
90+
? pixaCreate(0)
91+
: nullptr;
92+
Pix* pixht2 = pixGenerateHalftoneMask(pixr, NULL, &ht_found, pixadb);
93+
if (pixadb) {
94+
Pix* pixdb = pixaDisplayTiledInColumns(pixadb, 3, 1.0, 20, 2);
95+
if (textord_tabfind_show_images && pixa_debug != nullptr)
96+
pixa_debug->AddPix(pixdb, "HalftoneMask");
97+
pixDestroy(&pixdb);
98+
pixaDestroy(&pixadb);
99+
}
90100
pixDestroy(&pixr);
91101
if (!ht_found && pixht2 != NULL)
92102
pixDestroy(&pixht2);

0 commit comments

Comments
 (0)