change recognizer output format
This commit is contained in:
@@ -378,7 +378,7 @@ uns::EOCR_ResultSet uns::EasyOCR_Recognizer::operator()(const cv::Mat& full_imag
|
||||
if (crop.empty())
|
||||
continue;
|
||||
auto [text, conf] = (*this)(crop);
|
||||
result_set.insert({ i, { text, conf } });
|
||||
result_set.insert({ i, { text, conf, rect } });
|
||||
}
|
||||
return result_set;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,9 @@ namespace uns
|
||||
{
|
||||
namespace easyocr
|
||||
{
|
||||
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>>;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
uns::OCRConfig uns::G_OCRConfig;
|
||||
|
||||
std::wstring detect_model_path;
|
||||
std::wstring recognize_model_path;
|
||||
|
||||
uns::OCRConfig::OCRConfig()
|
||||
{
|
||||
language = easyocr::CharsetType::EN;
|
||||
|
||||
@@ -25,8 +25,6 @@ namespace uns
|
||||
private:
|
||||
easyocr::GPUUsage gpu_usage;
|
||||
easyocr::CharsetType language;
|
||||
std::wstring detect_model_path;
|
||||
std::wstring recognize_model_path;
|
||||
|
||||
public:
|
||||
OCRConfig();
|
||||
|
||||
@@ -11,8 +11,9 @@ namespace uns
|
||||
using VecFloat = std::vector<float>;
|
||||
using IONames = std::vector<const char*>;
|
||||
using IONamesStorage = std::vector<std::string>;
|
||||
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>>;
|
||||
|
||||
class OCRToolBox
|
||||
|
||||
Reference in New Issue
Block a user