MCPcopy Create free account
hub / github.com/danini/magsac / findEssentialMatrix_

Function findEssentialMatrix_

src/pymagsac/src/magsac_python.cpp:290–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290int findEssentialMatrix_(std::vector<double>& correspondences,
291 std::vector<bool>& inliers,
292 std::vector<double>& E,
293 std::vector<double>& src_K,
294 std::vector<double>& dst_K,
295 std::vector<double>& inlier_probabilities,
296 double sourceImageWidth,
297 double sourceImageHeight,
298 double destinationImageWidth,
299 double destinationImageHeight,
300 int sampler_id,
301 bool use_magsac_plus_plus,
302 double sigma_max,
303 double conf,
304 int min_iters,
305 int max_iters,
306 int partition_num)
307{
308 int num_tents = correspondences.size() / 4;
309 cv::Mat points(num_tents, 4, CV_64F, &correspondences[0]);
310
311 Eigen::Matrix3d intrinsics_src,
312 intrinsics_dst;
313
314 for (int i = 0; i < 3; i++) {
315 for (int j = 0; j < 3; j++) {
316 intrinsics_src(i, j) = src_K[i * 3 + j];
317 }
318 }
319
320 for (int i = 0; i < 3; i++) {
321 for (int j = 0; j < 3; j++) {
322 intrinsics_dst(i, j) = dst_K[i * 3 + j];
323 }
324 }
325
326 const double &fx1 = intrinsics_src(0, 0);
327 const double &fy1 = intrinsics_src(1, 1);
328 const double &fx2 = intrinsics_dst(0, 0);
329 const double &fy2 = intrinsics_dst(1, 1);
330
331 const double threshold_normalizer =
332 (fx1 + fx2 + fy1 + fy2) / 4.0;
333 const double normalized_sigma_max =
334 sigma_max / threshold_normalizer;
335
336 cv::Mat normalized_points(points.size(), CV_64F);
337 gcransac::utils::normalizeCorrespondences(points,
338 intrinsics_src,
339 intrinsics_dst,
340 normalized_points);
341
342 magsac::utils::DefaultEssentialMatrixEstimator estimator(
343 intrinsics_src,
344 intrinsics_dst); // The robust essential matrix estimator class
345 gcransac::EssentialMatrix model; // The estimated model
346
347 MAGSAC<cv::Mat, magsac::utils::DefaultEssentialMatrixEstimator> magsac(

Callers 1

findEssentialMatrixFunction · 0.85

Calls 8

setMaximumThresholdMethod · 0.80
setCoreNumberMethod · 0.80
setPartitionNumberMethod · 0.80
setIterationLimitMethod · 0.80
setReferenceThresholdMethod · 0.80
getReferenceThresholdMethod · 0.80
runMethod · 0.80

Tested by

no test coverage detected