我在原图中裁切了一个小区域,然后在小区域中找到一个矩形,画出来,此时,我显示原图,发现它也画出了矩形区域,它是如何进行坐标对应的,我该如何获取这些坐标

asked 2019-01-28 03:40:52 -0600

QRcode_img = img[int(p1_temp[1]):int(p3_temp[1]), int(p1_temp[0]):int(p3_temp[0])] cv2.imshow('QRcode_img', QRcode_img) cv2.waitKey(0)

contours = cv2.QRCodeDetector().detect(QRcode_img)
if np.all(contours[1] != None):
    box = contours[1].reshape(4, 2).astype(np.int64)
    code_img = cv2.drawContours(QRcode_img, [box], -1, (0, 0, 255), 2)
    cv2.imshow('xx', code_img)
    cv2.waitKey(0)
    cv2.imshow('xxxxxxxxxxxxxx', img)
edit retag flag offensive close merge delete

Comments

1

This is an English based forum... can you at least change your title.

StevenPuttemans gravatar imageStevenPuttemans ( 2019-01-28 04:04:37 -0600 )edit
1

@StevenPuttemans, It's interesting that in the question's URL all the hieroglyphs are replaced to their pronunciations. Unicode?

dkurt gravatar imagedkurt ( 2019-01-28 10:17:53 -0600 )edit
1

@dkurt can be, but still then I cannot ready mandarin or whatever language this is xD

StevenPuttemans gravatar imageStevenPuttemans ( 2019-01-29 02:54:12 -0600 )edit

@yuemengrui, If you can provide a minimal working example to reproduce the problem - it would be the best start to help you. The code is international thing and we can understand it better.

dkurt gravatar imagedkurt ( 2019-01-29 03:49:24 -0600 )edit

have a look at function "copyto",and it's offset

jsxyhelu gravatar imagejsxyhelu ( 2019-02-06 01:18:38 -0600 )edit