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

[Question] How to run correctly with cv2.recoverPose in thirdparty/visual_odometry.py #8

Open
JEFFCHANG0501 opened this issue Mar 7, 2022 · 2 comments

Comments

@JEFFCHANG0501
Copy link

Hello, it's an excellent work. But I face a problem when I run visual_odometry.py. It seems that there is a problem with cv2.revocerPose function.

image

According to opencv document opencv, the code seems reasonable for using recoverPose. So, I try to use this function without output 'triangulatedPoints' to get Rotation and translation, and it worked. I am confused why it doesn't work with output 'triangulatedPoints'.

_, self.cur_R, self.cur_t, mask,points_3d = cv2.recoverPose(E, self.px_cur,\ self.px_ref,cameraMatrix=self.camera_matrix,distanceThresh=100)

@TimingSpace
Copy link
Owner

@JEFFCHANG0501 Hi, thanks, and sorry for the late reply.
The reason for your problem may be the difference in the OpenCV version.
I tried OpenCV '4.5.5', where the following code worked

_, self.cur_R, self.cur_t, mask,points_3d = cv2.recoverPose(E, self.px_cur,\ self.px_ref,cameraMatrix=self.camera_matrix,distanceThresh=100)

@JEFFCHANG0501
Copy link
Author

@TimingSpace Thanks for the reply. I will try the OpenCV version you provided.

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

2 participants