mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
change: simplify ocr texts summary
This commit is contained in:
@@ -1 +1 @@
|
||||
v5.0.0+2412081145
|
||||
v5.0.0+2412081202
|
||||
|
||||
@@ -57,9 +57,12 @@ func (o OCRResults) ToOCRTexts() (ocrTexts OCRTexts) {
|
||||
Y: int(ocrResult.Points[2].Y),
|
||||
},
|
||||
}
|
||||
rectStr := fmt.Sprintf("%d,%d,%d,%d",
|
||||
rect.Min.X, rect.Min.Y, rect.Max.X, rect.Max.Y)
|
||||
ocrText := OCRText{
|
||||
Text: ocrResult.Text,
|
||||
Rect: rect,
|
||||
Text: ocrResult.Text,
|
||||
Rect: rect,
|
||||
RectStr: rectStr,
|
||||
}
|
||||
ocrTexts = append(ocrTexts, ocrText)
|
||||
}
|
||||
@@ -67,8 +70,9 @@ func (o OCRResults) ToOCRTexts() (ocrTexts OCRTexts) {
|
||||
}
|
||||
|
||||
type OCRText struct {
|
||||
Text string
|
||||
Rect image.Rectangle
|
||||
Text string `json:"text"`
|
||||
RectStr string `json:"rect"`
|
||||
Rect image.Rectangle `json:"-"`
|
||||
}
|
||||
|
||||
func (t OCRText) Size() Size {
|
||||
|
||||
@@ -80,7 +80,7 @@ type DriverResult struct {
|
||||
Success bool `json:"success"`
|
||||
ResponseStatus int `json:"response_status"`
|
||||
ResponseDuration int64 `json:"response_duration(ms)"` // ms
|
||||
ResponseBody string `json:"response_body,omitempty"`
|
||||
ResponseBody string `json:"response_body"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user