src/tools/lvr2_image_normals/Main.cpp
Go to the documentation of this file.
1 
28 // Program options for this tool
29 
30 
31 #include "lvr2/io/ModelFactory.hpp"
34 #include "Options.hpp"
35 using namespace lvr2;
36 
37 
41 int main(int argc, char** argv)
42 {
44  cout << opt << endl;
45 
47 
48  // Determine coordinate system
50 
51  if(opt.coordinateSystem() == "SLAM6D")
52  {
53  system = ModelToImage::SLAM6D;
54  }
55  else if(opt.coordinateSystem() == "UOS")
56  {
57  system = ModelToImage::UOS;
58  }
59 
60  ModelToImage mti(
61  model->m_pointCloud,
63  opt.imageWidth(), opt.imageHeight(),
64  opt.minZ(), opt.maxZ(),
65  opt.minH(), opt.maxH(),
66  opt.minV(), opt.maxV(),
67  opt.optimize(), system);
68 
69  mti.writePGM(opt.imageFile(), 3000);
70 
71  PanoramaNormals normals(&mti);
72  PointBufferPtr buffer = normals.computeNormals(opt.regionWidth(), opt.regionHeight(), false);
73 
74  ModelPtr out_model(new Model(buffer));
75 
76  ModelFactory::saveModel(out_model, "normals.ply");
77 }
78 
lvr2::ModelFactory::saveModel
static void saveModel(ModelPtr m, std::string file)
Definition: ModelFactory.cpp:225
lvr2::PanoramaNormals
The PanoramaNormals class computes normals for a given panorama.
Definition: PanoramaNormals.hpp:41
image_normals::Options::minV
int minV() const
Definition: src/tools/lvr2_image_normals/Options.hpp:86
lvr2::PanoramaNormals::computeNormals
PointBufferPtr computeNormals(int with, int height, bool interpolate)
Definition: PanoramaNormals.cpp:58
lvr2::PointBufferPtr
std::shared_ptr< PointBuffer > PointBufferPtr
Definition: PointBuffer.hpp:130
image_normals::Options::imageHeight
int imageHeight() const
Definition: src/tools/lvr2_image_normals/Options.hpp:102
lvr2::Model
Definition: Model.hpp:51
PanoramaNormals.hpp
image_normals::Options::inputFile
string inputFile() const
Definition: src/tools/lvr2_image_normals/Options.hpp:64
image_normals::Options::regionWidth
int regionWidth() const
Definition: src/tools/lvr2_image_normals/Options.hpp:107
lvr2::ModelToImage::NATIVE
@ NATIVE
Definition: ModelToImage.hpp:112
Options.hpp
image_normals::Options::optimize
bool optimize() const
Definition: src/tools/lvr2_image_normals/Options.hpp:137
image_normals::Options::imageFile
string imageFile() const
Definition: src/tools/lvr2_image_normals/Options.hpp:70
lvr2::ModelToImage::CYLINDRICAL
@ CYLINDRICAL
Definition: ModelToImage.hpp:100
lvr2::ModelToImage::UOS
@ UOS
Definition: ModelToImage.hpp:112
image_normals::Options::minZ
float minZ() const
Definition: src/tools/lvr2_image_normals/Options.hpp:122
image_normals::Options::minH
int minH() const
Definition: src/tools/lvr2_image_normals/Options.hpp:75
lvr2::ModelToImage::CoordinateSystem
CoordinateSystem
Definition: ModelToImage.hpp:110
argc
int argc
Definition: tests_high_five_parallel.cpp:27
lvr2::ModelToImage
The ModelToImage class provides methods to re-project 3D laser scans to image planes.
Definition: ModelToImage.hpp:55
lvr2::ModelToImage::writePGM
void writePGM(string filename, float cutoff)
Writes the scan panaroma to an pgm file.
Definition: ModelToImage.cpp:192
lvr2::ModelToImage::SLAM6D
@ SLAM6D
Definition: ModelToImage.hpp:112
image_normals::Options
A class to parse the program options for the reconstruction executable.
Definition: src/tools/lvr2_image_normals/Options.hpp:52
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::ModelPtr
std::shared_ptr< Model > ModelPtr
Definition: Model.hpp:80
ModelToImage.hpp
image_normals::Options::maxV
int maxV() const
Definition: src/tools/lvr2_image_normals/Options.hpp:91
lvr2::ModelFactory::readModel
static ModelPtr readModel(std::string filename)
Definition: ModelFactory.cpp:65
ModelFactory.hpp
image_normals::Options::maxZ
float maxZ() const
Definition: src/tools/lvr2_image_normals/Options.hpp:117
image_normals::Options::imageWidth
int imageWidth() const
Definition: src/tools/lvr2_image_normals/Options.hpp:96
image_normals::Options::regionHeight
int regionHeight() const
Definition: src/tools/lvr2_image_normals/Options.hpp:112
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28
main
int main(int argc, char **argv)
Main entry point for the LSSR surface executable.
Definition: src/tools/lvr2_image_normals/Main.cpp:41
image_normals::Options::coordinateSystem
string coordinateSystem() const
Definition: src/tools/lvr2_image_normals/Options.hpp:142
image_normals::Options::maxH
int maxH() const
Definition: src/tools/lvr2_image_normals/Options.hpp:80


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:24