MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
mesh_io_ply.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015, Simon Fuhrmann
3 * TU Darmstadt - Graphics, Capture and Massively Parallel Computing
4 * All rights reserved.
5 *
6 * This software may be modified and distributed under the terms
7 * of the BSD 3-Clause license. See the LICENSE.txt file for details.
8 */
9
10#ifndef MVE_PLY_FILE_HEADER
11#define MVE_PLY_FILE_HEADER
12
13#include <istream>
14#include <string>
15
16#include "util/system.h"
17#include "mve/defines.h"
18#include "mve/image.h"
19#include "mve/camera.h"
20#include "mve/view.h"
21#include "mve/mesh.h"
22
25
29TriangleMesh::Ptr
30load_ply_mesh (std::string const& filename);
31
36FloatImage::Ptr
37load_ply_depthmap (std::string const& filename);
38
44void
45load_xf_file (std::string const& filename, float* ctw);
46
51{
52 bool format_binary = true;
53 bool write_vertex_colors = true;
54 bool write_vertex_normals = false;
55 bool write_vertex_confidences = true;
56 bool write_vertex_values = true;
57 bool write_face_colors = true;
58 bool write_face_normals = false;
59 unsigned int verts_per_simplex = 3;
60};
61
67void
68save_ply_mesh (TriangleMesh::ConstPtr mesh, std::string const& filename,
69 SavePLYOptions const& options = SavePLYOptions());
70
79void
80save_ply_view (std::string const& filename, CameraInfo const& camera,
81 FloatImage::ConstPtr depth_map,
82 FloatImage::ConstPtr confidence_map = FloatImage::ConstPtr(nullptr),
83 ByteImage::ConstPtr color_image = ByteImage::ConstPtr(nullptr));
84
89void
90save_ply_view (View::Ptr view, std::string const& filename);
91
97void
98save_ply_view (View::Ptr view, std::string const& filename,
99 std::string const& depthmap, std::string const& confidence,
100 std::string const& color_image);
101
106void
107save_xf_file (std::string const& filename, CameraInfo const& camera);
108
113void
114save_xf_file (std::string const& filename, float const* ctw);
115
116/* ---------------------------------------------------------------- */
117
145
154
163
165template <typename T>
166T
167ply_read_value (std::istream& input, PLYFormat format);
168
171
172#endif /* MVE_PLY_FILE_HEADER */
std::shared_ptr< Image< T > const > ConstPtr
Definition image.h:43
std::shared_ptr< TriangleMesh const > ConstPtr
Definition mesh.h:93
std::shared_ptr< View > Ptr
Definition view.h:68
#define MVE_NAMESPACE_BEGIN
Definition defines.h:13
#define MVE_NAMESPACE_END
Definition defines.h:14
#define MVE_GEOM_NAMESPACE_END
Definition defines.h:20
#define MVE_GEOM_NAMESPACE_BEGIN
Definition defines.h:19
TriangleMesh::Ptr load_ply_mesh(std::string const &filename)
Loads a triangle mesh from a PLY model file.
void load_xf_file(std::string const &filename, float *ctw)
Load XF file, typically with camera to world transformation.
FloatImage::Ptr load_ply_depthmap(std::string const &filename)
Loads a depth map from a PLY file.
void save_ply_view(std::string const &filename, CameraInfo const &camera, FloatImage::ConstPtr depth_map, FloatImage::ConstPtr confidence_map, ByteImage::ConstPtr color_image)
Stores a scanalize-compatible PLY file from a depth map.
PLYFaceProperty
PLY face element properties.
@ PLY_F_VERTEX_INDICES
@ PLY_F_IGNORE_UINT32
@ PLY_F_IGNORE_UINT8
@ PLY_F_IGNORE_FLOAT
void save_ply_mesh(TriangleMesh::ConstPtr mesh, std::string const &filename, SavePLYOptions const &options)
Stores a PLY file from a triangle mesh.
PLYFormat
PLY data encoding formats.
PLYVertexProperty
PLY vertex element properties.
@ PLY_V_IGNORE_FLOAT
@ PLY_V_IGNORE_UINT8
@ PLY_V_IGNORE_UINT32
@ PLY_V_FLOAT_VALUE
@ PLY_V_IGNORE_DOUBLE
void save_xf_file(std::string const &filename, CameraInfo const &camera)
Stores a scanalyze compatible XF file with camera transformation from camera to world coordinates.
Per-view camera information with various helper functions.
Definition camera.h:24
Options struct for saving PLY files.
Definition mesh_io_ply.h:51