From 61efe1a6efb5deebadc9af05007473271761b5b9 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Mon, 12 Jun 2023 20:14:30 +0200 Subject: [PATCH] #2465 Fix first digit on extended_Resolution=false (#2466) * added more debug for #2447 * new model on new images dig-class100-0165_s2 * #2465 fix first digit with extended_Resolution=false --- .../jomjol_flowcontroll/ClassFlowCNNGeneral.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp index 821fc89a7..ac1e6c280 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp @@ -55,7 +55,7 @@ string ClassFlowCNNGeneral::getReadout(int _analog = 0, bool _extendedResolution // LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "getReadout(analog) number=" + std::to_string(number) + ", result_after_decimal_point=" + std::to_string(result_after_decimal_point) + ", prev=" + std::to_string(prev)); result = std::to_string(prev); - if (_extendedResolution && (CNNType != Digital)) + if (_extendedResolution) result = result + std::to_string(result_after_decimal_point); for (int i = GENERAL[_analog]->ROI.size() - 2; i >= 0; --i) @@ -142,11 +142,10 @@ int ClassFlowCNNGeneral::PointerEvalHybridNew(float number, float number_of_pred int result_before_decimal_point = ((int) floor(number) + 10) % 10; if (eval_predecessors < 0) - { - if ((result_after_decimal_point <= Digital_Uncertainty * 10) || (result_after_decimal_point >= Digital_Uncertainty * 10)) // Band around the digit --> Rounding, as digit reaches inaccuracy in the frame - result = (int) (round(number) + 10) % 10; - else - result = (int) ((int) trunc(number) + 10) % 10; + { + // on first digit is no spezial logic for transition needed + // we use the recognition as given. The result is the int value of the recognition + result = (int) ((int) trunc(number) + 10) % 10; LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "PointerEvalHybridNew - No predecessor - Result = " + std::to_string(result) + " number: " + std::to_string(number) + " number_of_predecessors = " + std::to_string(number_of_predecessors)+ " eval_predecessors = " + std::to_string(eval_predecessors) + " Digital_Uncertainty = " + std::to_string(Digital_Uncertainty));