1 #ifndef _NNDEPLOY_OCR_OCR_H_
2 #define _NNDEPLOY_OCR_OCR_H_
32 key_ =
"nndeploy::ocr::RotateCropImage";
33 desc_ =
"RotateCropImage";
34 this->setInputTypeInfo<OCRResult>();
35 this->setInputTypeInfo<cv::Mat>();
36 this->setOutputTypeInfo<OCRResult>();
39 std::vector<dag::Edge *> outputs)
40 : Node(name, inputs, outputs) {
41 key_ =
"nndeploy::ocr::RotateCropImage";
42 desc_ =
"RotateCropImage";
43 this->setInputTypeInfo<OCRResult>();
44 this->setInputTypeInfo<cv::Mat>();
45 this->setOutputTypeInfo<OCRResult>();
56 key_ =
"nndeploy::ocr::RotateImage180";
57 desc_ =
"RotateImage180";
58 this->setInputTypeInfo<OCRResult>();
59 this->setInputTypeInfo<OCRResult>();
60 this->setOutputTypeInfo<OCRResult>();
63 std::vector<dag::Edge *> outputs)
64 : Node(name, inputs, outputs) {
65 key_ =
"nndeploy::ocr::RotateImage180";
66 desc_ =
"RotateImage180";
67 this->setInputTypeInfo<OCRResult>();
68 this->setInputTypeInfo<OCRResult>();
69 this->setOutputTypeInfo<OCRResult>();
83 rapidjson::Value &json,
84 rapidjson::Document::AllocatorType &allocator)
override {
85 rapidjson::Value texts_json(rapidjson::kArrayType);
86 for (
const auto &text : texts_) {
87 texts_json.PushBack(rapidjson::Value(text.c_str(), allocator), allocator);
89 json.AddMember(
"texts_", texts_json, allocator);
95 if (json.HasMember(
"texts_") && json[
"texts_"].IsArray()) {
97 for (
const auto &text : json[
"texts_"].GetArray()) {
98 texts_.push_back(text.GetString());
107 std::string path_ =
"resources/others/ocr_out.txt";
111 rapidjson::Document::AllocatorType &allocator);
119 std::vector<dag::Edge *> outputs)
120 : Node(name, inputs, outputs) {
121 key_ =
"nndeploy::ocr::PrintOcrNode";
122 desc_ =
"Print Text";
123 param_ = std::make_shared<PrintOcrNodeParam>();
124 this->setInputTypeInfo<OCRResult>();
virtual base::Status deserialize(rapidjson::Value &json)
virtual std::string serialize()
virtual base::Status deserialize(rapidjson::Value &json) override
virtual base::Status serialize(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) override
std::vector< std::string > texts_
virtual base::Status serialize(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator)
virtual base::Status deserialize(rapidjson::Value &json)
base::Status setPath(const std::string &path)
virtual base::Status run()
Run node (pure virtual function)
PrintOcrNode(const std::string &name, std::vector< dag::Edge * > inputs, std::vector< dag::Edge * > outputs)
virtual base::Status run()
Run node (pure virtual function)
PostProcessor util_post_processor_
RotateCropImage(const std::string &name)
RotateCropImage(const std::string &name, std::vector< dag::Edge * > inputs, std::vector< dag::Edge * > outputs)
virtual ~RotateCropImage()
virtual base::Status run()
Run node (pure virtual function)
RotateImage180(const std::string &name, std::vector< dag::Edge * > inputs, std::vector< dag::Edge * > outputs)
RotateImage180(const std::string &name)
virtual ~RotateImage180()
PostProcessor util_post_processor_
#define NNDEPLOY_CC_API
api
@ kStatusCodeErrorInvalidParam