fix: failed to find text in scope

This commit is contained in:
xucong.053
2022-11-09 15:42:10 +08:00
parent 49757b52a8
commit 315610e0a2
+1 -1
View File
@@ -179,7 +179,6 @@ func (s *veDEMOCRService) FindText(text string, imageBuf []byte, options ...Data
}
rects = append(rects, rect)
}
// contains text while not match exactly
if ocrResult.Text != text {
@@ -191,6 +190,7 @@ func (s *veDEMOCRService) FindText(text string, imageBuf []byte, options ...Data
return rect, nil
}
}
}
if len(rects) == 0 {
return image.Rectangle{}, errors.Wrap(code.OCRTextNotFoundError,