Blender V4.3
intern/homography.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "intern/homography.h"
9
10void libmv_homography2DFromCorrespondencesEuc(/* const */ double (*x1)[2],
11 /* const */ double (*x2)[2],
12 int num_points,
13 double H[3][3]) {
14 libmv::Mat x1_mat, x2_mat;
15 libmv::Mat3 H_mat;
16
17 x1_mat.resize(2, num_points);
18 x2_mat.resize(2, num_points);
19
20 for (int i = 0; i < num_points; i++) {
21 x1_mat.col(i) = libmv::Vec2(x1[i][0], x1[i][1]);
22 x2_mat.col(i) = libmv::Vec2(x2[i][0], x2[i][1]);
23 }
24
25 LG << "x1: " << x1_mat;
26 LG << "x2: " << x2_mat;
27
30 x1_mat, x2_mat, options, &H_mat);
31
32 LG << "H: " << H_mat;
33
34 memcpy(H, H_mat.data(), 9 * sizeof(double));
35}
CCL_NAMESPACE_BEGIN struct Options options
void libmv_homography2DFromCorrespondencesEuc(double(*x1)[2], double(*x2)[2], int num_points, double H[3][3])
#define LG
#define H(x, y, z)
Eigen::Matrix< double, 3, 3 > Mat3
Definition numeric.h:72
Eigen::Vector2d Vec2
Definition numeric.h:105
Eigen::MatrixXd Mat
Definition numeric.h:60
bool EstimateHomography2DFromCorrespondences(const Mat &x1, const Mat &x2, const EstimateHomographyOptions &options, Mat3 *H)