-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Closed
Labels
category: documentationDocumentation fix or updateDocumentation fix or update
Description
Describe the doc issue
Hello! This piece of code:
opencv/doc/py_tutorials/py_calib3d/py_pose/py_pose.markdown
Lines 38 to 43 in 4d26e16
| def draw(img, corners, imgpts): | |
| corner = tuple(corners[0].ravel()) | |
| img = cv.line(img, corner, tuple(imgpts[0].ravel()), (255,0,0), 5) | |
| img = cv.line(img, corner, tuple(imgpts[1].ravel()), (0,255,0), 5) | |
| img = cv.line(img, corner, tuple(imgpts[2].ravel()), (0,0,255), 5) | |
| return img |
Fix suggestion
Should be changed as follows:
def draw(img, corners, imgpts):
corner = tuple(corners[0].ravel().astype("int32"))
imgpts = imgpts.astype("int32")
img = cv.line(img, corner, tuple(imgpts[0].ravel()), (255,0,0), 5)
img = cv.line(img, corner, tuple(imgpts[1].ravel()), (0,255,0), 5)
img = cv.line(img, corner, tuple(imgpts[2].ravel()), (0,0,255), 5)
return imgThis is because cv.lline expects the points to be integers and not floats.
Can I submit a PR?
PoC: https://github.com/albertoZurini/UNITS-ComputerVision/blob/master/1_Photos/3_pose_estimation.ipynb
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category: documentationDocumentation fix or updateDocumentation fix or update