Skip to content

qrdet sometimes give wrong quad_xy coords? #7

@vladimir-dudnik-1

Description

@vladimir-dudnik-1

qrdet v2.4 installed from PyPi seems give wrong quad_xy coords, see resulting image below
out

This result was obtained from this test image
test
using code below:
`#!/usr/bin/python3
from qrdet import QRDetector
import numpy as np
import cv2

detector = QRDetector(model_size = 's')
image = cv2.imread(filename='test.jpg')
detections = detector.detect(image=image, is_bgr=True)

Draw the detections

for detection in detections:
x1, y1, x2, y2 = np.array(detection['bbox_xyxy'], np.int32)
cv2.rectangle(image, (x1, y1), (x2, y2), color = (0, 255, 0), thickness = 1)

(qx1, qy1), (qx2, qy2), (qx3, qy3), (qx4, qy4) = np.array(detection['quad_xy'], np.int32)
cv2.circle(image, (qx1, qy1), 4, color = (0, 0, 255), thickness = -1)
cv2.circle(image, (qx2, qy2), 4, color = (0, 0, 255), thickness = -1)
cv2.circle(image, (qx3, qy3), 4, color = (0, 0, 255), thickness = -1)
cv2.circle(image, (qx4, qy4), 4, color = (0, 0, 255), thickness = -1)

confidence = detection['confidence']
cv2.putText(image, f'{confidence:.2f}', (x1, y1 - 10), fontFace = cv2.FONT_HERSHEY_SIMPLEX, fontScale = 1, color = (0, 255, 0), thickness = 2)

Save the result

cv2.imwrite(filename='out.jpg', img=image)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions