mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-17 14:11:14 +08:00
[Bug Fix] fixed ocr visualize error (#2090)
This commit is contained in:
@@ -20,11 +20,15 @@ namespace vision {
|
|||||||
cv::Mat VisOcr(const cv::Mat& im, const OCRResult& ocr_result,
|
cv::Mat VisOcr(const cv::Mat& im, const OCRResult& ocr_result,
|
||||||
const float score_threshold) {
|
const float score_threshold) {
|
||||||
auto vis_im = im.clone();
|
auto vis_im = im.clone();
|
||||||
|
bool have_score =
|
||||||
|
(ocr_result.boxes.size() == ocr_result.rec_scores.size());
|
||||||
|
|
||||||
for (int n = 0; n < ocr_result.boxes.size(); n++) {
|
for (int n = 0; n < ocr_result.boxes.size(); n++) {
|
||||||
|
if (have_score) {
|
||||||
if (ocr_result.rec_scores[n] < score_threshold) {
|
if (ocr_result.rec_scores[n] < score_threshold) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
cv::Point rook_points[4];
|
cv::Point rook_points[4];
|
||||||
|
|
||||||
for (int m = 0; m < 4; m++) {
|
for (int m = 0; m < 4; m++) {
|
||||||
|
Reference in New Issue
Block a user