fix: failed to find text in scope

This commit is contained in:
xucong.053
2022-11-09 15:42:10 +08:00
parent 33eafd987b
commit c4f966748c

View File

@@ -179,16 +179,16 @@ func (s *veDEMOCRService) FindText(text string, imageBuf []byte, options ...Data
}
rects = append(rects, rect)
}
// contains text while not match exactly
if ocrResult.Text != text {
continue
}
// contains text while not match exactly
if ocrResult.Text != text {
continue
}
// match exactly, and not specify index, return the first one
if data.Index == 0 {
return rect, nil
// match exactly, and not specify index, return the first one
if data.Index == 0 {
return rect, nil
}
}
}