build: upgrade to go 1.17 and upgrade dependencies
This commit is contained in:
45
vendor/gocv.io/x/gocv/objdetect.go
generated
vendored
45
vendor/gocv.io/x/gocv/objdetect.go
generated
vendored
@@ -211,6 +211,7 @@ func (a *QRCodeDetector) Close() error {
|
||||
|
||||
// DetectAndDecode Both detects and decodes QR code.
|
||||
//
|
||||
// Returns true as long as some QR code was detected even in case where the decoding failed
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a7290bd6a5d59b14a37979c3a14fbf394
|
||||
//
|
||||
@@ -238,3 +239,47 @@ func (a *QRCodeDetector) Decode(input Mat, points Mat, straight_qrcode *Mat) str
|
||||
goResult := C.GoString(C.QRCodeDetector_DetectAndDecode(a.p, input.p, points.p, straight_qrcode.p))
|
||||
return string(goResult)
|
||||
}
|
||||
|
||||
// Detects QR codes in image and finds of the quadrangles containing the codes.
|
||||
//
|
||||
// Each quadrangle would be returned as a row in the `points` Mat and each point is a Vecf.
|
||||
// Returns true if QR code was detected
|
||||
// For usage please see TestQRCodeDetector
|
||||
// For further details, please see:
|
||||
// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#aaf2b6b2115b8e8fbc9acf3a8f68872b6
|
||||
func (a *QRCodeDetector) DetectMulti(input Mat, points *Mat) bool {
|
||||
result := C.QRCodeDetector_DetectMulti(a.p, input.p, points.p)
|
||||
return bool(result)
|
||||
}
|
||||
|
||||
// Detects QR codes in image and finds of the quadrangles containing the codes and decode the decode the QRCodes to strings.
|
||||
//
|
||||
// Each quadrangle would be returned as a row in the `points` Mat and each point is a Vecf.
|
||||
// Returns true as long as some QR code was detected even in case where the decoding failed
|
||||
// For usage please see TestQRCodeDetector
|
||||
// For further details, please see:
|
||||
//https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a188b63ffa17922b2c65d8a0ab7b70775
|
||||
func (a *QRCodeDetector) DetectAndDecodeMulti(input Mat, decoded *[]string, points *Mat, qrCodes *[]Mat) bool {
|
||||
cDecoded := C.CStrings{}
|
||||
defer C.CStrings_Close(cDecoded)
|
||||
cQrCodes := C.struct_Mats{}
|
||||
defer C.Mats_Close(cQrCodes)
|
||||
success := C.QRCodeDetector_DetectAndDecodeMulti(a.p, input.p, &cDecoded, points.p, &cQrCodes)
|
||||
if !success {
|
||||
return bool(success)
|
||||
}
|
||||
|
||||
tmpCodes := make([]Mat, cQrCodes.length)
|
||||
for i := C.int(0); i < cQrCodes.length; i++ {
|
||||
tmpCodes[i].p = C.Mats_get(cQrCodes, i)
|
||||
}
|
||||
|
||||
for _, qr := range tmpCodes {
|
||||
*qrCodes = append(*qrCodes, qr)
|
||||
}
|
||||
|
||||
for _, s := range toGoStrings(cDecoded) {
|
||||
*decoded = append(*decoded, s)
|
||||
}
|
||||
return bool(success)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user