Add support QR codes

This commit is contained in:
Даниил Корековцев
2019-12-12 14:38:10 +03:00
committed by Ron Evans
parent 952c9d63b3
commit 002a4b3257
5 changed files with 116 additions and 0 deletions

View File

@@ -125,3 +125,27 @@ struct Rects GroupRectangles(struct Rects rects, int groupThreshold, double eps)
Rects ret = {results, (int)vRect.size()};
return ret;
}
// QRCodeDetector
QRCodeDetector QRCodeDetector_New() {
return new cv::QRCodeDetector();
}
void QRCodeDetector_Close(QRCodeDetector qr) {
delete qr;
}
const char* QRCodeDetector_DetectAndDecode(QRCodeDetector qr, Mat input,Mat points,Mat straight_qrcode) {
cv::String *str = new cv::String(qr->detectAndDecode(*input,*points,*straight_qrcode));
return str->c_str();
}
bool QRCodeDetector_Detect(QRCodeDetector qr, Mat input,Mat points) {
return qr->detect(*input,*points);
}
const char* QRCodeDetector_Decode(QRCodeDetector qr, Mat input,Mat inputPoints,Mat straight_qrcode) {
cv::String *str = new cv::String(qr->detectAndDecode(*input,*inputPoints,*straight_qrcode));
return str->c_str();
}