#include <devanagari_processing.h>
List of all members.
Detailed Description
Definition at line 27 of file devanagari_processing.h.
Constructor & Destructor Documentation
tesseract::PixelHistogram::PixelHistogram |
( |
| ) |
|
|
inline |
tesseract::PixelHistogram::~PixelHistogram |
( |
| ) |
|
|
inline |
Member Function Documentation
void tesseract::PixelHistogram::Clear |
( |
| ) |
|
|
inline |
void tesseract::PixelHistogram::ConstructHorizontalCountHist |
( |
Pix * |
pix | ) |
|
Definition at line 486 of file devanagari_processing.cpp.
{
Numa* counts = pixCountPixelsByRow(pix,
NULL);
length_ = numaGetCount(counts);
hist_ = new int[length_];
for (int i = 0; i < length_; ++i) {
l_int32 val = 0;
numaGetIValue(counts, i, &val);
hist_[i] = val;
}
numaDestroy(&counts);
}
void tesseract::PixelHistogram::ConstructVerticalCountHist |
( |
Pix * |
pix | ) |
|
Definition at line 468 of file devanagari_processing.cpp.
{
int width = pixGetWidth(pix);
int height = pixGetHeight(pix);
hist_ = new int[width];
length_ = width;
int wpl = pixGetWpl(pix);
l_uint32 *data = pixGetData(pix);
for (int i = 0; i < width; ++i)
hist_[i] = 0;
for (int i = 0; i < height; ++i) {
l_uint32 *line = data + i * wpl;
for (int j = 0; j < width; ++j)
if (GET_DATA_BIT(line, j))
++(hist_[j]);
}
}
int tesseract::PixelHistogram::GetHistogramMaximum |
( |
int * |
count | ) |
const |
Definition at line 454 of file devanagari_processing.cpp.
{
int best_value = 0;
for (int i = 0; i < length_; ++i) {
if (hist_[i] > hist_[best_value]) {
best_value = i;
}
}
*
count = hist_[best_value];
}
return best_value;
}
int* const tesseract::PixelHistogram::hist |
( |
| ) |
const |
|
inline |
int tesseract::PixelHistogram::length |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: