#include <devanagari_processing.h>
Definition at line 33 of file devanagari_processing.h.
◆ PixelHistogram()
tesseract::PixelHistogram::PixelHistogram |
( |
| ) |
|
|
inline |
◆ ~PixelHistogram()
tesseract::PixelHistogram::~PixelHistogram |
( |
| ) |
|
|
inline |
◆ Clear()
void tesseract::PixelHistogram::Clear |
( |
| ) |
|
|
inline |
◆ ConstructHorizontalCountHist()
void tesseract::PixelHistogram::ConstructHorizontalCountHist |
( |
Image |
pix | ) |
|
Definition at line 480 of file devanagari_processing.cpp.
480 {
482 Numa *counts = pixCountPixelsByRow(pix, nullptr);
483 length_ = numaGetCount(counts);
484 hist_ = new int[length_];
485 for (
int i = 0;
i < length_; ++
i) {
486 l_int32 val = 0;
487 numaGetIValue(counts,
i, &val);
489 }
490 numaDestroy(&counts);
491}
◆ ConstructVerticalCountHist()
void tesseract::PixelHistogram::ConstructVerticalCountHist |
( |
Image |
pix | ) |
|
Definition at line 459 of file devanagari_processing.cpp.
459 {
461 int width = pixGetWidth(pix);
462 int height = pixGetHeight(pix);
463 hist_ = new int[width];
464 length_ = width;
465 int wpl = pixGetWpl(pix);
466 l_uint32 *data = pixGetData(pix);
467 for (
int i = 0;
i < width; ++
i) {
469 }
470 for (
int i = 0;
i < height; ++
i) {
471 l_uint32 *line = data +
i * wpl;
472 for (int j = 0; j < width; ++j) {
473 if (GET_DATA_BIT(line, j)) {
474 ++(hist_[j]);
475 }
476 }
477 }
478}
◆ GetHistogramMaximum()
int tesseract::PixelHistogram::GetHistogramMaximum |
( |
int * |
count | ) |
const |
Definition at line 445 of file devanagari_processing.cpp.
445 {
446 int best_value = 0;
447 for (
int i = 0;
i < length_; ++
i) {
448 if (hist_[
i] > hist_[best_value]) {
450 }
451 }
453 *
count = hist_[best_value];
454 }
455 return best_value;
456}
◆ hist()
int * tesseract::PixelHistogram::hist |
( |
| ) |
const |
|
inline |
◆ length()
int tesseract::PixelHistogram::length |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: