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

calib-stereo.cpp: Use Mat for T #24

Open
blazczak opened this issue Dec 16, 2020 · 0 comments
Open

calib-stereo.cpp: Use Mat for T #24

blazczak opened this issue Dec 16, 2020 · 0 comments

Comments

@blazczak
Copy link

blazczak commented Dec 16, 2020

In calib-stereo.cpp you're using Vec3d to store and then write the contents of vector T. opencv does not store metadata about the type of the container for Vec3d as it does for Mat, so users may get errors on cvRead because opencv won't be able to tell the type of the node. Ideally, you would want to specify Mat as T's type on the reader side just like the other calibration params and rely on simple fs["T"] >> T; working seamlessly on the reader side.

diff --git calib_stereo.cpp calib_stereo.cpp
index 5adb9f1..15d7aea 100644
--- calib_stereo.cpp
+++ calib_stereo.cpp
@@ -118,9 +118,7 @@ int main(int argc, char const *argv[])
                    leftimg_dir, rightimg_dir, leftimg_filename, rightimg_filename, extension);
 
   printf("Starting Calibration\n");
-  Mat K1, K2, R, F, E;
-  Vec3d T;
-  Mat D1, D2;
+  Mat K1, K2, D1, D2, R, T, F, E;
   fsl["K"] >> K1;
   fsr["K"] >> K2;
   fsl["D"] >> D1;
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

1 participant