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();