Closed Stephenfang51 closed 2 years ago
Yes there is. You need to modify DLT code to accept more points and more projection matrices. Keep in mind that I didn't test the instructions below but this is the correct way to do this.
https://github.com/TemugeB/bodypose3d/blob/4d505a50f9ae9d2b36326ea37de001f390b32b04/utils.py#L14
For 3 points:
A = [point1[1]*P1[2,:] - P1[1,:],
P1[0,:] - point1[0]*P1[2,:],
point2[1]*P2[2,:] - P2[1,:],
P2[0,:] - point2[0]*P2[2,:]
point3[1]*P3[2,:] - P3[1,:],
P3[0,:] - point3[0]*P3[2,:]
]
https://github.com/TemugeB/bodypose3d/blob/4d505a50f9ae9d2b36326ea37de001f390b32b04/utils.py#L19
https://github.com/TemugeB/bodypose3d/blob/4d505a50f9ae9d2b36326ea37de001f390b32b04/utils.py#L29
It is probably best to write this line as:
return Vh[-1,0:3]/Vh[-1,3]
This is supposed to work in the presence of noise in all of your points. Read this post if you want to understand what this is doing: DLT
@TemugeB
Thanks for your quick response ! It works ! it's really helpful !
@Stephenfang51 Here, does $3$ viewpoints refer to $3$ cameras? For more than $2$ cameras, how did you find the extrinsic matrix? Specifically should we use $[C1, C2]$, $[C2, C3]$ pairs or should we use $[C1, C2]$, $[C1, C3]$?
If you are using camera1 (C1) as the origin of your coordinate system, then you would use [C1, C2] and [C1, C3] and [C1, C1] to define your three projection matrices. Here [C1, C1] is just identity matrix and [0,0,0] for translation.
If the coordinate system is outside the camera, then you would use [O, C2] and [O, C3] and [O, C1].
DLT supoort 2 points to triangulate 3d point
if i can provide more than 2 points like 3 or 4, is there any method to do that ?
Thanks in advanced !