$search
00001 /* 00002 James R. Diebel 00003 Stanford University 00004 00005 Started: 8 July 2005 00006 00007 map2msh.cc - Utility to convert a disparity map to a mesh 00008 */ 00009 00010 00011 #include <iostream> 00012 #include "bmtk/mesh.hh" 00013 #include "bmtk/timer.hh" 00014 #include <trimesh/trimesh.h> 00015 00016 using namespace std; 00017 using namespace bmtk; 00018 00019 int main (int argc, char *argv[]) { 00020 // if bad command line args, give usage instructions and exit 00021 if (argc < 4) { 00022 cout << endl 00023 << "Usage: map2msh mapfile.bmp params.txt outfile.msh" << endl 00024 << " mapfile.bmp must be a grayscale image file" << endl 00025 << " params.txt must contain camera intrinsics" << endl 00026 << " outfile.msh is the name of the output msh file" << endl; 00027 exit(1); 00028 } 00029 00030 // create empty Mesh and then fill it with data from ply file 00031 Mesh m; 00032 m.buildFromMAP(argv[1],argv[2]); 00033 00034 // output it to the specified file 00035 m.writeMesh(argv[3]); 00036 00037 return 0; 00038 } 00039 00040