Created
March 28, 2017 13:05
-
-
Save gadomski/a777aff8b6ef1af757f3635835ff0a5b to your computer and use it in GitHub Desktop.
CPD rigid with scaling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cpd/jsoncpp.hpp> | |
#include <cpd/rigid.hpp> | |
#include <fstream> | |
#include <iostream> | |
int main(int argc, char** argv) { | |
if (argc != 4) { | |
std::cout << "ERROR: invalid usage" << std::endl; | |
std::cout << "USAGE: cpd-rigid <fixed> <moving> <outfile>" << std::endl; | |
return 1; | |
} | |
cpd::Matrix fixed = cpd::matrix_from_path(argv[1]); | |
cpd::Matrix moving = cpd::matrix_from_path(argv[2]); | |
std::string outfile = argv[3]; | |
cpd::Rigid rigid; | |
rigid.scale(true); | |
cpd::RigidResult result = rigid.run(fixed, moving); | |
std::ofstream out(outfile); | |
out << result.points; | |
out.close(); | |
std::cout << cpd::to_json(result) << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment