feat: SwipeUntil

This commit is contained in:
debugtalk
2022-08-31 20:15:29 +08:00
parent 3aed97eab1
commit 6573c94240
3 changed files with 66 additions and 7 deletions
+4 -1
View File
@@ -9,6 +9,7 @@ import (
"io/ioutil"
"mime/multipart"
"net/http"
"strings"
"time"
)
@@ -92,10 +93,12 @@ func (s *veDEMOCRService) FindText(text string, imageBuf []byte) (rect image.Rec
}
for _, ocrResult := range ocrResults {
if ocrResult.Text != text {
// not contains text
if !strings.Contains(ocrResult.Text, text) {
continue
}
// contains text
// only find the first matched one
rect = image.Rectangle{
// ocrResult.Points 顺序:左上 -> 右上 -> 右下 -> 左下