Ask Your Question

vidstige's profile - activity

2017-08-10 04:35:00 -0600 asked a question Link thirdparty dynamically

I'm building static OpenCV 3.0.0 using DBUILD_SHARED_LIBS=OFF working fine producing a beautiful .a file. However, thirdparty libraries such as libjasper and libwebp are linked into this static library (libopencv_imgproc). I would like to create static opencv libraries, but link libjasper and libwebp dynamically as these are very easy to install using apt.

2015-04-14 05:57:17 -0600 received badge  Nice Answer (source)
2013-11-03 00:56:15 -0600 received badge  Teacher (source)
2013-10-22 13:09:03 -0600 received badge  Necromancer (source)
2013-10-22 10:43:31 -0600 received badge  Supporter (source)
2013-10-22 10:43:23 -0600 answered a question strange stereorectify error with rotation matrix

I ran in to the same problem. Opening up the source code revealed the problem - The cv::stereoRectify function assumes most of the input matrices are in double precision format (CV_64F). Converting the rotation matrix (rotation_ in your example) to a double precision cv::Mat solves the problem.

cv::Mat r;
rotation_.convertTo(r, CV_64F);
cv::stereoRectify(ints_left_, ints_right_, dtcs_left_, dtcs_right_, 
          cv::Size(640, 480), r, translation_, 
          homography_left_, homography_right_, 
          rppm_left_, rppm_right_, qmat_);

Hope this clarifies things.