10#ifndef MVE_DEPTHMAP_HEADER
11#define MVE_DEPTHMAP_HEADER
108 float dd_factor = DD_FACTOR_DEFAULT,
119 math::Matrix3f const& invproj,
float dd_factor = DD_FACTOR_DEFAULT,
130 CameraInfo const& cam,
float dd_factor = DD_FACTOR_DEFAULT,
172 std::size_t w = dm->
width();
173 std::size_t h = dm->
height();
175 for (std::size_t y = 0; y < h; ++y)
176 for (std::size_t x = 0; x < w; ++x, ++pos)
179 math::Vec3f px((
float)x + 0.5f, (
float)y + 0.5f, 1.0f);
182 double len = px.
norm();
184 dm->
at(pos) *= (to_mve ? len : 1.0 / len);
Matrix class for arbitrary dimensions and types.
Vector class for arbitrary dimensions and types.
T norm(void) const
Computes the norm (length) of the vector.
int64_t height(void) const
Returns the height of the image.
int64_t width(void) const
Returns the width of the image.
Multi-channel image class of arbitrary but homogenous data type.
std::shared_ptr< Image< T > > Ptr
std::shared_ptr< Image< T > const > ConstPtr
T const & at(int64_t index) const
Linear indexing of image data.
std::shared_ptr< TriangleMesh > Ptr
#define MVE_IMAGE_NAMESPACE_END
#define MVE_NAMESPACE_BEGIN
#define MVE_IMAGE_NAMESPACE_BEGIN
#define MVE_NAMESPACE_END
#define MVE_GEOM_NAMESPACE_END
#define MVE_GEOM_NAMESPACE_BEGIN
void rangegrid_triangulate(Image< unsigned int > const &grid, TriangleMesh::Ptr mesh)
Algorithm to triangulate range grids.
const float DD_FACTOR_DEFAULT
math::Vec3f pixel_3dpos(int64_t x, int64_t y, float depth, math::Matrix3f const &invproj)
Function that calculates the pixel 3D position in camera coordinates for pixel (x,...
TriangleMesh::Ptr depthmap_triangulate(FloatImage::ConstPtr dm, math::Matrix3f const &invproj, float dd_factor, mve::Image< unsigned int > *vids)
Algorithm to triangulate depth maps.
void depthmap_mesh_confidences(TriangleMesh::Ptr mesh, int iterations)
Algorithm to assign per-vertex confidence values to vertices of a triangulated depth map.
float pixel_footprint(int64_t x, int64_t y, float depth, math::Matrix3f const &invproj)
Function that calculates the pixel footprint (pixel width) in 3D coordinates for pixel (x,...
void depthmap_mesh_peeling(TriangleMesh::Ptr mesh, int iterations)
Algorithm that peels away triangles at the mesh bounary of a triangulated depth map.
void depthmap_confidence_clean(FloatImage::Ptr dm, FloatImage::ConstPtr cm)
Removes the backplane according to the confidence map IN-PLACE.
FloatImage::Ptr depthmap_cleanup(FloatImage::ConstPtr dm, int64_t thres)
Algorithm to clean small confident islands in the depth maps.
void depthmap_convert_conventions(typename Image< T >::Ptr dm, math::Matrix3f const &invproj, bool to_mve)
Converts between depth map conventions IN-PLACE.
FloatImage::Ptr depthmap_bilateral_filter(FloatImage::ConstPtr dm, math::Matrix3f const &invproj, float gc_sigma, float pc_fator)
Filters the given depthmap using a bilateral filter.
Per-view camera information with various helper functions.