From bedd89f916fb24ca349bfe0abdf593dee3aec22e Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Mon, 4 Jul 2022 20:04:57 +0800 Subject: [PATCH] fix bug --- deploy/lite/crnn_process.cc | 3 ++- deploy/lite/ocr_db_crnn.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy/lite/crnn_process.cc b/deploy/lite/crnn_process.cc index 6d5fc150..7cd95cdd 100644 --- a/deploy/lite/crnn_process.cc +++ b/deploy/lite/crnn_process.cc @@ -34,12 +34,13 @@ cv::Mat CrnnResizeImg(cv::Mat img, float wh_ratio, int rec_image_height) { resize_w = imgW; else resize_w = int(ceilf(imgH * ratio)); - + cv::Mat resize_img; cv::resize(img, resize_img, cv::Size(resize_w, imgH), 0.f, 0.f, cv::INTER_LINEAR); cv::copyMakeBorder(resize_img, resize_img, 0, 0, 0, int(imgW - resize_img.cols), cv::BORDER_CONSTANT, {127, 127, 127}); + return resize_img; } std::vector ReadDict(std::string path) { diff --git a/deploy/lite/ocr_db_crnn.cc b/deploy/lite/ocr_db_crnn.cc index cb2bf779..fde0d07d 100644 --- a/deploy/lite/ocr_db_crnn.cc +++ b/deploy/lite/ocr_db_crnn.cc @@ -474,7 +474,7 @@ void system(char **argv){ std::vector rec_times; RunRecModel(boxes, srcimg, rec_predictor, rec_text, rec_text_score, - charactor_dict, cls_predictor, use_direction_classify, &rec_times); + charactor_dict, cls_predictor, use_direction_classify, &rec_times, rec_image_height); //// visualization auto img_vis = Visualization(srcimg, boxes); -- GitLab