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

Remove cv.sfm dependency #4

Open
jyjblrd opened this issue Nov 21, 2023 · 5 comments · Fixed by #42
Open

Remove cv.sfm dependency #4

jyjblrd opened this issue Nov 21, 2023 · 5 comments · Fixed by #42
Labels
good first issue Good for newcomers

Comments

@jyjblrd
Copy link
Owner

jyjblrd commented Nov 21, 2023

This project depends on the OpenCV SFM (structure from motion) module, which requires you to build OpenCV from source. This is a huge pain, especially since we only use three simple functions from the module: fundamentalFromProjections, essentialFromFundamental, and motionFromEssential.

It should be very easy to reimplement these functions in python by looking at the module source code, and this would remove cv.sfm as a dependancy, making the project a lot more accessible.

@jyjblrd jyjblrd added the good first issue Good for newcomers label Nov 21, 2023
@SANTHOSH-MAMIDISETTI
Copy link

@jyjblrd , Could you link where those functions are present in the OpenCV repo , I would like to have a look and start

@jyjblrd
Copy link
Owner Author

jyjblrd commented Nov 22, 2023

Hey @SANTHOSH-MAMIDISETTI, you can find the usages of the sfm module in the code base here. It would be amazing if you can do this!

The source code for the sfm module is here. An example of searching up the implementation of the fundimentalFromProjections function is here.

@NightHawk32
Copy link

@jyjblrd could you provide test data of camera1_image_points and camera2_image_points like used here?
If possible the output of F and E would also be great. I am not entirely sure what the camera points look like. Additionally the test data would help to compare the openCV implementation of essentialFromFundamental to the python version.

@jyjblrd
Copy link
Owner Author

jyjblrd commented May 22, 2024

Resolved by #42, which has been pulle into the no-cv-sfm branch. However, this code is currently untested – test cases will need to be written before this issue can be closed.

@high993
Copy link

high993 commented Sep 10, 2024

Hey, @jyjblrd I have an amazing project in the works for 3D Markerless Human-Mocap using AI Models, that's very similar to your project. I plan on pushing the project to github some time in the next days or weeks. In the course of making it, I learned that to avoid using opencv sfm some concessions must be made, for starters, fundamental matrix generators like RANSAC and LMEDS need a minimum number of points (8) to solve its position (or 7 if you make a few assumption's). I circumvented this by running my extrinsic calibration off of a large checker pattern placed in the center of the scene. However since I haven't made the IR filter modifications to the camera and I'm running the cameras in the res.LARGE (640x480) configuration, I'm not sure if this solution will work for you due to the compute overhead. Also, I plan on making a YT vid explaining my code and I felt like that a proper reference to yourself was in order. Id be happy to hash out the details of the absence of opencv sfm after its published.

Cheers!
Adam,

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

Successfully merging a pull request may close this issue.

4 participants