mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-30 23:49:05 +08:00
intmatcher: Avoid conversion from double to float and vice versa
This fixes some clang warnings: src/classify/intmatcher.cpp:48:49: warning: implicit conversion loses floating-point precision: 'double' to 'const float' [-Wimplicit-float-conversion] src/classify/intmatcher.cpp:405:34: warning: implicit conversion loses floating-point precision: 'double' to 'float' [-Wimplicit-float-conversion] src/classify/intmatcher.cpp:405:64: warning: implicit conversion increases floating-point precision: 'float' to 'double' [-Wdouble-promotion] Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
6d259ebe44
commit
7ec5f0ca02
@ -44,8 +44,8 @@ using tesseract::UnicharRating;
|
||||
// Parameters of the sigmoid used to convert similarity to evidence in the
|
||||
// similarity_evidence_table_ that is used to convert distance metric to an
|
||||
// 8 bit evidence value in the secondary matcher. (See IntMatcher::Init).
|
||||
const float IntegerMatcher::kSEExponentialMultiplier = 0.0;
|
||||
const float IntegerMatcher::kSimilarityCenter = 0.0075;
|
||||
const float IntegerMatcher::kSEExponentialMultiplier = 0.0f;
|
||||
const float IntegerMatcher::kSimilarityCenter = 0.0075f;
|
||||
|
||||
static const uint8_t offset_table[] = {
|
||||
255, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3,
|
||||
@ -402,7 +402,7 @@ class ClassPruner {
|
||||
results->init_to_size(num_classes_, empty);
|
||||
for (int c = 0; c < num_classes_; ++c) {
|
||||
(*results)[c].Class = sort_index_[num_classes_ - c];
|
||||
(*results)[c].Rating = 1.0 - sort_key_[num_classes_ - c] /
|
||||
(*results)[c].Rating = 1.0f - sort_key_[num_classes_ - c] /
|
||||
(static_cast<float>(CLASS_PRUNER_CLASS_MASK) * num_features_);
|
||||
}
|
||||
return num_classes_;
|
||||
|
Loading…
Reference in New Issue
Block a user