I am in a situation where I need to find the relative position of the camera between two or more cameras based on the correspondence of the images (so that the cameras are not at the same point). To solve this problem, I tried the same approach as described here (code below).
cv::Mat calibration_1 = ...; cv::Mat calibration_2 = ...; cv::Mat calibration_target = calibration_1; calibration_target.at<float>(0, 2) = 0.5f * frame_width; // principal point calibration_target.at<float>(1, 2) = 0.5f * frame_height; // principal point auto fundamental_matrix = cv::findFundamentalMat(left_matches, right_matches, CV_RANSAC); fundamental_matrix.convertTo(fundamental_matrix, CV_32F); cv::Mat essential_matrix = calibration_2.t() * fundamental_matrix * calibration_1; cv::SVD svd(essential_matrix); cv::Matx33f w(0,-1,0, 1,0,0, 0,0,1); cv::Matx33f w_inv(0,1,0, -1,0,0, 0,0,1); cv::Mat rotation_between_cameras = svd.u * cv::Mat(w) * svd.vt; //HZ 9.19
But in most of my cases I get extremely strange results. So my next thought was to use a full-fledged ligament control (which should do what I'm looking for ?!). Currently, my only big dependency is OpenCV, and they only have the implementation of documents without documents.
So the question is:
- Is there a package regulator that has no dependencies and uses a license that allows commercial use?
- Is there any other easy way to find looks?
- Are objects with very different distances for cameras a problem? (heavy parallax)
Thank you in advance
source share