Skip to content
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

3-line RANSAC function seem to be wrong #1

Open
PoetCoderJun opened this issue Jan 19, 2021 · 3 comments
Open

3-line RANSAC function seem to be wrong #1

PoetCoderJun opened this issue Jan 19, 2021 · 3 comments

Comments

@PoetCoderJun
Copy link

PoetCoderJun commented Jan 19, 2021

h = np.dot(vp1, [1 / f**2, 1 / f**2, 1])
vp2 = np.cross(h, l3)

The original code will cause 'AxisError: axisa: axis -1 is out of bounds for array of dimension 0' error, because h is a number and l3 is a vector.

I guess what you want to implement is:

h = [vp1[0]*(1 / f**2), vp1[1]*(1 / f**2), vp1[2]]
vp2 = np.cross(h, l3)

It works well on the test image.

@boisbb
Copy link

boisbb commented Mar 14, 2021

Hi, somehow I don't understand these two lines, could you possibly explain what is being calculated here (to be exact, i HAVE read the paper, however am none the wiser after doing so) ? Also in the original code the focal_length is set to None, however you say that the code is working on the presented image, how did you figure out the focal_length?

@PoetCoderJun
Copy link
Author

Hi, somehow I don't understand these two lines, could you possibly explain what is being calculated here (to be exact, i HAVE read the paper, however am none the wiser after doing so) ? Also in the original code the focal_length is set to None, however you say that the code is working on the presented image, how did you figure out the focal_length?

Focal_length defaults to None, but you can pass arguments to the function. To be honest, I don't really understand how the code works, but it works.

@marquistj13
Copy link

Hi, I can figure out a little, but not fully understand. let me give some comments. Please tell me if I am wrong.

  1. We first assume that l1 and l2 are the images of parallel lines L1 and L2 respectively in the 3D world.
  2. The vanishing point of parallel line images l1 and l2 is vp1
  3. vp1 can be seen as the image of some line in the 3D world, say L, this 3D line joins the camera center C,and vp1 in the image plane, (see Vanishing Points and Their Applications if if you do not understand this)
  4. Now we want to find the valishing line h of the 3D plane P which is perpendicular to L. Note the camera center C is also on the 3D plane P.
  5. So how can we find the valishing line h? The answer is ,see equation 4 in

Abbas, Syed Ammar, and Andrew Zisserman. “A Geometric Approach to Obtain a Bird’s Eye View From an Image.” In 2019 IEEE/CVF International Conference on Computer Vision Workshop (ICCVW), 4095–4104. Seoul, Korea (South): IEEE, 2019. https://doi.org/10.1109/ICCVW.2019.00504.

, see here for the expansion (in the expansion,cx, cy denotes the focal point)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants