-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to do the triangulation #4
Comments
Hi, @enrico-c, I am also trying to reconstruct 3D position from uv. However, I can't get the correct 3D position. I am wondering if you could point out what I have done wrong or release the code of triangulation. def triangulation_test(self):
poses, p_mats = self.triangulation_getitem(0)
cam_num = len(poses) # 2
# poses: (2, 2, 13)
# p_mats: (2, 3, 4)
b = np.empty((cam_num * 3, self.num_joints)) #(6, 13)
for cam in range(cam_num):
b[cam * 3] = poses[cam][0]
b[cam * 3 + 1] = self.image_h - poses[cam][1] # flip
b[cam * 3 + 2] = np.ones((1, self.num_joints))
A = np.concatenate(p_mats) #(6, 4)
# x = (A'A)^(-1)A'b, (4, 13), least square method
x = np.matmul(np.matmul(np.linalg.inv(np.matmul(A.T, A)), A.T), b)
pred_skeleton = x[:3]
return pred_skeleton |
Hi @enrico-c @tobidelbruck , |
Hi @Adamink , did you solve the problem of reconstructing 3D position from uv? |
This is the algorithm we used to triangulate from two cameras: a) Back project each 2D point to 3D space using the pseudo-inverse of the camera projection matrix [1]. References: Another useful resource: Please have a look at the notebook |
Hi,
I'm trying to reconstruct the 3D position from uv. I first equation (1) from the paper (
(u, v, 1)^T = P(X, Y, Z, 1)^T
) to get(X, Y, Z)_2
and(X, Y, Z)_3
for camera 2 and 3. Then I don't know how to use the camera position to get the finalX, Y, Z
location.The text was updated successfully, but these errors were encountered: