Open3D (C++ API)
TriangleMeshAndImageUtilities.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2018 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
29 #include <memory>
30 #include <vector>
31 #include <Open3D/Utility/Eigen.h>
32 
33 namespace open3d {
34 
35 namespace geometry {
36 class Image;
37 }
38 namespace geometry {
39 class RGBDImage;
40 }
41 namespace geometry {
42 class TriangleMesh;
43 }
44 namespace camera {
45 class PinholeCameraTrajectory;
46 }
47 
48 namespace color_map {
49 
50 class ImageWarpingField;
51 class ColorMapOptimizationOption;
52 
53 inline std::tuple<float, float, float> Project3DPointAndGetUVDepth(
54  const Eigen::Vector3d X,
55  const camera::PinholeCameraTrajectory& camera,
56  int camid);
57 
58 std::tuple<std::vector<std::vector<int>>, std::vector<std::vector<int>>>
60  const geometry::TriangleMesh& mesh,
61  const std::vector<std::shared_ptr<geometry::Image>>& images_rgbd,
62  const std::vector<std::shared_ptr<geometry::Image>>& images_mask,
63  const camera::PinholeCameraTrajectory& camera,
64  double maximum_allowable_depth,
65  double depth_threshold_for_visiblity_check);
66 
67 template <typename T>
68 std::tuple<bool, T> QueryImageIntensity(
69  const geometry::Image& img,
70  const Eigen::Vector3d& V,
71  const camera::PinholeCameraTrajectory& camera,
72  int camid,
73  int ch = -1,
74  int image_boundary_margin = 10);
75 
76 template <typename T>
77 std::tuple<bool, T> QueryImageIntensity(
78  const geometry::Image& img,
79  const ImageWarpingField& field,
80  const Eigen::Vector3d& V,
81  const camera::PinholeCameraTrajectory& camera,
82  int camid,
83  int ch = -1,
84  int image_boundary_margin = 10);
85 
87  const geometry::TriangleMesh& mesh,
88  const std::vector<std::shared_ptr<geometry::Image>>& images_gray,
89  const std::vector<ImageWarpingField>& warping_field,
90  const camera::PinholeCameraTrajectory& camera,
91  const std::vector<std::vector<int>>& visiblity_vertex_to_image,
92  std::vector<double>& proxy_intensity,
93  int image_boundary_margin);
94 
96  const geometry::TriangleMesh& mesh,
97  const std::vector<std::shared_ptr<geometry::Image>>& images_gray,
98  const camera::PinholeCameraTrajectory& camera,
99  const std::vector<std::vector<int>>& visiblity_vertex_to_image,
100  std::vector<double>& proxy_intensity,
101  int image_boundary_margin);
102 
104  geometry::TriangleMesh& mesh,
105  const std::vector<std::shared_ptr<geometry::Image>>& images_rgbd,
106  const camera::PinholeCameraTrajectory& camera,
107  const std::vector<std::vector<int>>& visiblity_vertex_to_image,
108  int image_boundary_margin = 10);
109 
111  geometry::TriangleMesh& mesh,
112  const std::vector<std::shared_ptr<geometry::Image>>& images_rgbd,
113  const std::vector<ImageWarpingField>& warping_fields,
114  const camera::PinholeCameraTrajectory& camera,
115  const std::vector<std::vector<int>>& visiblity_vertex_to_image,
116  int image_boundary_margin = 10);
117 } // namespace color_map
118 } // namespace open3d
std::tuple< std::vector< std::vector< int > >, std::vector< std::vector< int > > > CreateVertexAndImageVisibility(const geometry::TriangleMesh &mesh, const std::vector< std::shared_ptr< geometry::Image >> &images_depth, const std::vector< std::shared_ptr< geometry::Image >> &images_mask, const camera::PinholeCameraTrajectory &camera, double maximum_allowable_depth, double depth_threshold_for_visiblity_check)
Definition: TriangleMeshAndImageUtilities.cpp:54
void SetProxyIntensityForVertex(const geometry::TriangleMesh &mesh, const std::vector< std::shared_ptr< geometry::Image >> &images_gray, const std::vector< ImageWarpingField > &warping_field, const camera::PinholeCameraTrajectory &camera, const std::vector< std::vector< int >> &visiblity_vertex_to_image, std::vector< double > &proxy_intensity, int image_boundary_margin)
Definition: TriangleMeshAndImageUtilities.cpp:159
std::tuple< float, float, float > Project3DPointAndGetUVDepth(const Eigen::Vector3d X, const camera::PinholeCameraTrajectory &camera, int camid)
Definition: TriangleMeshAndImageUtilities.cpp:37
std::tuple< bool, T > QueryImageIntensity(const geometry::Image &img, const Eigen::Vector3d &V, const camera::PinholeCameraTrajectory &camera, int camid, int ch, int image_boundary_margin)
Definition: TriangleMeshAndImageUtilities.cpp:105
void SetGeometryColorAverage(geometry::TriangleMesh &mesh, const std::vector< std::shared_ptr< geometry::Image >> &images_color, const camera::PinholeCameraTrajectory &camera, const std::vector< std::vector< int >> &visiblity_vertex_to_image, int image_boundary_margin)
Definition: TriangleMeshAndImageUtilities.cpp:230
Definition: PinholeCameraIntrinsic.cpp:33