Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed translational matrix initialisation #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void icp(MatrixXd mat1, MatrixXd mat2, int max_iteration_num) {
my_kd_tree_t mat_index(3, std::cref(mat2), 10 /* max leaf */);
mat_index.index->buildIndex();
Mat rotation_matrix = Mat::eye(3, 3, CV_64F);
Mat translation_matrix = Mat::eye(3, 1, CV_64F);
Mat translation_matrix = Mat::zeros(3, 1, CV_64F);
for (int iters_ = 0; iters_ < max_iters_; iters_++) {
findNearestNeighbours(cvSource, mat_index, cvSource.rows, 3);
Mat cvNewTarget = Mat::zeros(cvSource.rows, 3, CV_64F);
Expand Down Expand Up @@ -296,7 +296,7 @@ void tricp(MatrixXd mat1, MatrixXd mat2, int max_iteration_num) {
int max_iters_ = max_iteration_num;//100;
my_kd_tree_t mat_index(3, std::cref(mat2), 10 /* max leaf */);
Mat rotation_matrix = Mat::eye(3, 3, CV_64F);
Mat translation_matrix = Mat::eye(3, 1, CV_64F);
Mat translation_matrix = Mat::zeros(3, 1, CV_64F);
mat_index.index->buildIndex();

for (int iters_ = 0; iters_ < max_iters_; iters_++) {
Expand Down