31 #include <Utils/TriangleMesh.hh>
32 #include <Utils/ThreeDOut.hh>
33 #include <Base/Image/ImageIO.hh>
34 #include <Base/Image/ImageConvert.hh>
35 #include <Image/HomographyMapping.hh>
41 void usage(
char* name)
44 cout<<name<<
" <depthmap> <texture> [outputFile]\n";
47 int main(
int argc,
char* argv[])
55 if(ImageIO::Load(argv[1], depthMap)!=0) {
56 cout<<
"depth map could not be loaded!\n";
62 ImageConvert::ConvertST(depthMap, source, ImageBase::ST_float);
70 HMapper.
Map(source, enlarged);
72 if(ImageIO::Load(argv[2], texture)!=0) {
73 cout<<
"texture could not be loaded!\n";
78 cout<<
"meshing..."; cout.flush();
88 cout<<
"Writing VRML to ";
90 cout<<argv[3]<<
"... ";cout.flush();
94 cout<<
"DenseTriangleMesh.wrl... ";cout.flush();
95 vrmlOut.
VRMLOut(
"DenseTriangleMesh.wrl");
unsigned int AddTriangleMesh(const TriangleMesh &mesh, const std::string &name="", const std::string &textureOutputName="", bool writeOutTexture=true, bool calcNormals=false)
Adds triangle mesh as IndexedFaceSet to ThreeDOut mem.
int GenerateDenseMesh(const BIAS::Image< float > &DenseDepthMap, const BIAS::Image< unsigned char > &Texture)
Calculate a triangle mesh from dense depth map without PMatrix.
int VRMLOut(const std::string &sFilename)
flush all 3d objects to a vrml file with name sFilename, this is the function most users would call ...
a 3x3 Matrix describing projective transformations between planes
Maps image src to image sink with homography H (software implementation)
Unified output of 3D entities via OpenGL or VRML.
unsigned int GetWidth() const
Create and represent a 3D triangle mesh.
unsigned int GetHeight() const
int Map(const Image< InputStorageType > &src, Image< OutputStorageType > &sink, InterpolationMethod=MapTrilinear, bool newSink=false, double SuperSampling=1.0)
backward mapping with various interpolations
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
This is the base class for images in BIAS.
void SetHomography(const HMatrix &H)
set your homography H (source = H * sink) before calling Map()