Search for external conditions between cameras

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

+4
source share
2 answers

I am also working on the same issue and run into narrower issues. Here are some suggestions -

  • Change the main matrix before decomposition: Modify the main matrix before decomposition [UW Vt] = SVD (E) and the new E '= diag (s, s, 0), where s = W (0,0) + W (1,1) / 2

  • 2-stage fundamental matrix assessment: Recalculate the main matrix using the RANSAC icons

These steps should make the rotation estimate more susceptible to noise.

+1
source

you need to get 4 different solutions and choose one that has # more points with positive Z coordinates. The solution is generated by inverting the sign of the fundamental matrix, substituting w with w_inv, which you did not, although you calculated w_inv. Are you reusing the code of another?

0
source

Source: https://habr.com/ru/post/1448114/


All Articles