change recognizer output format

This commit is contained in:
UnknownObject
2025-05-19 21:56:27 +08:00
parent d070976d35
commit 521273638d
12 changed files with 32 additions and 24 deletions
+2 -2
View File
@@ -37,8 +37,8 @@ int main()
auto results = uns::EasyOCR_CPP::FullAuto(img);
for (const auto& [index, info] : results)
{
const auto& [text, conf] = info;
std::cout << "Box " << index << ": \"" << uns::EOCR_SupportTools::WtoA(text) << "\" Confidence=" << conf << "\n";
const auto& [text, conf, rect] = info;
printf("Result %d: Text = {%s}, Box = [%d, %d, %d, %d], Confidence = %.3f\n", (int)index, uns::EOCR_SupportTools::WtoA(text).c_str(), rect.tl().x, rect.tl().y, rect.br().x, rect.br().y, conf);
}
uns::EasyOCR_CPP::CleanupOCR();
+3 -2
View File
@@ -32,8 +32,9 @@ namespace uns
EN_CH
};
using EOCR_Result = std::pair<std::wstring, float>;
using EOCR_ResultSet = std::map<size_t, EOCR_Result>;
using EOCR_Result = std::tuple<std::wstring, float>;
using EOCR_Result_Single = std::tuple<std::wstring, float, cv::Rect>;
using EOCR_ResultSet = std::map<size_t, EOCR_Result_Single>;
using EOCRD_Rects = std::vector<std::vector<cv::Point2f>>;
}
Binary file not shown.
Binary file not shown.