Question

I am working on a project to detect the 3D location of the object. I have two cameras set up at two corners of the room and I have obtained the Fundamental matrix between them. These cameras are internally calibrated. My images are 2592 X 1944

K = [1228 0 3267 0 1221 538 0 0 1 ]

F = [-1.098e-7 3.50715e-7 -0.000313 2.312e-7 2.72256e-7 4.629e-5 0.000234 -0.00129250 1 ]

Now, How do I proceed so that given a 3D point in space, I should be able to get points on the image which correspond to the same object in the room. If I can obtain the right projection matrices (with correct scale) I can use them later as inputs to OpenCV's traingulatePoints function to obtain the location of the object.

I have been stuck at this since a long time. So, please help me.

Thanks.

Was it helpful?

Solution 2

Sorry its not coming in size of comment.. so @user2167617 reply to your comment. Pretty much. A few pointers, though: the singular values should be (s,s,0), so (1.3, 1.05, 0) is a pretty good guess. About the R: Technically, this is right, however, ignoring signs. It might very well be that you get a rotation matrix which does not satisfy the constraint deteminant(R) = 1 but is instead -1. You might want to multiply it with -1 in that case. Generally, if you run into problems with this approach, try to determine the Essential Matrix using the 5 point algorithm (implemented into the very newest version of OpenCV, you will have to build it yourself). The scale is indeed impossible to obtain with these informations. However, it's all to scale. If you define for example the distance between the cameras being 1 unit, then everything will be measured in that unit.

OTHER TIPS

From what I gather, you have obtained the Fundamental matrix through some means of calibration? Either way, with the fundamental matrix (or the calibration rig itself) you can obtain the pose difference via decomposition of the Essential matrix. Once you have that, you can use matched feature points (using a feature extractor and descriptor like SURF, BRISK, ...) to identify which points in one image belong to the same object point as another feature point in the other image. With that information, you should be able to triangulate away.

May be it will be simplier use cv::reprojectImageTo3D function? It will give you 3D coordinates.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top