Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
24 changes: 13 additions & 11 deletions src/colmap/exe/model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ int RunModelAligner(int argc, char** argv) {
Reconstruction reconstruction;
reconstruction.Read(input_path);
Sim3d tform;
bool alignment_success = true;

if (alignment_type == "plane") {
PrintHeading2("Aligning reconstruction to principal plane");
Expand All @@ -356,6 +355,13 @@ int RunModelAligner(int argc, char** argv) {
ransac_options,
&tform);

if (!alignment_success) {
LOG(ERROR) << "=> Alignment failed";
return EXIT_FAILURE;
}

reconstruction.Transform(tform);

std::vector<double> errors;
errors.reserve(ref_image_names.size());

Expand Down Expand Up @@ -402,17 +408,13 @@ int RunModelAligner(int argc, char** argv) {
}
}

if (alignment_success) {
LOG(INFO) << "=> Alignment succeeded";
reconstruction.Write(output_path);
if (!transform_path.empty()) {
tform.ToFile(transform_path);
}
return EXIT_SUCCESS;
} else {
LOG(INFO) << "=> Alignment failed";
return EXIT_FAILURE;
LOG(INFO) << "=> Alignment succeeded";
reconstruction.Write(output_path);
if (!transform_path.empty()) {
tform.ToFile(transform_path);
}

return EXIT_SUCCESS;
}

int RunModelAnalyzer(int argc, char** argv) {
Expand Down