Ask Your Question

gareins's profile - activity

2020-01-15 12:45:03 -0600 received badge  Notable Question (source)
2019-05-02 03:05:10 -0600 received badge  Popular Question (source)
2017-12-12 07:51:38 -0600 marked best answer projectPoints tvec and rvec

I have a problem understanding the two parameters of this function. I thought they are the translation and rotation of the camera in global coordinate system and object points are also given in this global coordinate system. But a simple test proves me wrong:

import cv2
import numpy as np

# principal point (60, 60)
cammat = np.array([[30, 0, 60], [0, 30, 60], [0, 0, 1]], dtype=np.float32)
distortion = np.array([0, 0, 0, 0, 0], dtype=np.float32)

tvec = np.array([0, 0, 0], dtype=np.float32)
rvec = np.array([0, 0, 0], dtype=np.float32)

point_3d = np.array([0.1, 0.1, 1], dtype=np.float32)

# [63.00, 63.00]
p1 = cv2.projectPoints(np.array([[point_3d]]), rvec, tvec, cammat, distortion)

# move camera a bit closer to the 3d point, expecting point on 2d plant
# to be a bit further away from the principal point
tvec = np.array([0, 0, 0.1], dtype=np.float32)
# [62.72, 62.72]
p2 = cv2.projectPoints(np.array([[point_3d]]), rvec, tvec, cammat, distortion)

Where am I wrong?

2017-12-12 07:51:38 -0600 received badge  Scholar (source)
2017-12-12 07:51:37 -0600 received badge  Supporter (source)
2017-12-05 03:36:27 -0600 received badge  Necromancer (source)
2017-12-04 15:58:54 -0600 answered a question openCV and Pypy?

As of Pypy 5.9, OpenCV just works. Instructions for usage in virtual environment: make virtual environment with virtua

2017-11-22 07:57:51 -0600 asked a question projectPoints tvec and rvec

projectPoints tvec and rvec I have a problem understanding the two parameters of this function. I thought they are the t