MCPcopy Create free account
hub / github.com/creatale/node-dv / GetPixRect

Method GetPixRect

deps/tesseract/ccmain/thresholder.cpp:228–239  ·  view source on GitHub ↗

Get a clone/copy of the source image rectangle. The returned Pix must be pixDestroyed. This function will be used in the future by the page layout analysis, and the layout analysis that uses it will only be available with Leptonica, so there is no raw equivalent.

Source from the content-addressed store, hash-verified

226// the layout analysis that uses it will only be available with Leptonica,
227// so there is no raw equivalent.
228Pix* ImageThresholder::GetPixRect() {
229 if (IsFullImage()) {
230 // Just clone the whole thing.
231 return pixClone(pix_);
232 } else {
233 // Crop to the given rectangle.
234 Box* box = boxCreate(rect_left_, rect_top_, rect_width_, rect_height_);
235 Pix* cropped = pixClipRectangle(pix_, box, NULL);
236 boxDestroy(&box);
237 return cropped;
238 }
239}
240
241// Get a clone/copy of the source image rectangle, reduced to greyscale,
242// and at the same resolution as the output binary.

Callers 1

SetImageMethod · 0.80

Calls 5

IsFullImageFunction · 0.85
pixCloneFunction · 0.85
boxCreateFunction · 0.85
pixClipRectangleFunction · 0.85
boxDestroyFunction · 0.85

Tested by

no test coverage detected