I am trying to write code that will calculate the fundamental matrix to determine the relationship between stereo images. I started with the books of Hartley and Sisserman, which most people recommend, but he did not have practical examples, and the code example for him was in MATLAB, which I do not have. Then I switched to an introduction to 3D methods and algorithms of computer vision , which is more practical and has actual examples in it. I implemented the recommended 8-point algorithm using Python and numpy, but I had trouble checking its validity.
I use the dataset listed on page 48 (use this link above to see an excerpt from Google Books) of this book. When I normalize glasses, I get the same results as this book. However, when I use the numpy SVD function to calculate the main matrix, I get the following value for F:
[[-0.01851684 -0.21631176 -0.67036356] [ 0.2605251 -0.01023853 0.14234079] [ 0.63748775 -0.09404508 -0.00220713]]
This matrix satisfies the equation p_R ^ * F * p_L = 0 , therefore it seems correct. However, it is very different from the matrix calculated in the book. I tried double checking the answer using OpenCV cv.FindFundamentalMat () and I got the third answer:
[[ 22.98129082 271.46453857 853.74273682] [-334.1673584 -4.84123087 -175.99523926] [-809.88891602 125.99833679 1. ]]
Iβm not the way these two other matrices are calculated, but I canβt find examples of calculating the fundamental matrix in the network to test my implementation of the 8-point algorithm. The fact that my implementation returns a value that satisfies the equation gives me confidence, but I'm worried that I did something stupid, so I cannot compare the results in a book or OpenCV.
opencv computer-vision stereo-3d
SigmaXiPi
source share