fix: run ocr alone without opencv

This commit is contained in:
debugtalk
2022-09-21 18:11:26 +08:00
parent 937b48236e
commit 976e715357
11 changed files with 42 additions and 24 deletions
-10
View File
@@ -53,10 +53,6 @@ func Extend(driver gwda.WebDriver, options ...CVOption) (dExt *DriverExt, err er
option(&dExt.CVArgs)
}
if dExt.scale, err = dExt.Scale(); err != nil {
return nil, err
}
if dExt.threshold == 0 {
dExt.threshold = 0.95 // default threshold
}
@@ -149,9 +145,3 @@ func getBufFromDisk(name string) (*bytes.Buffer, error) {
}
return bytes.NewBuffer(all), nil
}
func (dExt *DriverExt) MappingToRectInUIKit(rect image.Rectangle) (x, y, width, height float64) {
x, y = float64(rect.Min.X)/dExt.scale, float64(rect.Min.Y)/dExt.scale
width, height = float64(rect.Dx())/dExt.scale, float64(rect.Dy())/dExt.scale
return
}