Open3D (C++ API)  0.18.0+252c867
RGBDImage.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
11 #include "open3d/geometry/Image.h"
12 
13 namespace open3d {
14 namespace geometry {
15 
16 class RGBDImage;
17 
19 typedef std::vector<std::shared_ptr<RGBDImage>> RGBDImagePyramid;
20 
27 class RGBDImage : public Geometry2D {
28 public:
35  RGBDImage(const Image &color, const Image &depth)
37  color_(color),
38  depth_(depth) {}
39 
40  ~RGBDImage() override {
41  color_.Clear();
42  depth_.Clear();
43  };
44 
45  RGBDImage &Clear() override;
46  bool IsEmpty() const override;
47  Eigen::Vector2d GetMinBound() const override;
48  Eigen::Vector2d GetMaxBound() const override;
49 
62  static std::shared_ptr<RGBDImage> CreateFromColorAndDepth(
63  const Image &color,
64  const Image &depth,
65  double depth_scale = 1000.0,
66  double depth_trunc = 3.0,
67  bool convert_rgb_to_intensity = true);
68 
75  static std::shared_ptr<RGBDImage> CreateFromRedwoodFormat(
76  const Image &color,
77  const Image &depth,
78  bool convert_rgb_to_intensity = true);
79 
86  static std::shared_ptr<RGBDImage> CreateFromTUMFormat(
87  const Image &color,
88  const Image &depth,
89  bool convert_rgb_to_intensity = true);
90 
97  static std::shared_ptr<RGBDImage> CreateFromSUNFormat(
98  const Image &color,
99  const Image &depth,
100  bool convert_rgb_to_intensity = true);
101 
108  static std::shared_ptr<RGBDImage> CreateFromNYUFormat(
109  const Image &color,
110  const Image &depth,
111  bool convert_rgb_to_intensity = true);
112 
114  const RGBDImagePyramid &rgbd_image_pyramid, Image::FilterType type);
115 
117  size_t num_of_levels,
118  bool with_gaussian_filter_for_color = true,
119  bool with_gaussian_filter_for_depth = false) const;
120 
121 public:
126 };
127 
128 } // namespace geometry
129 } // namespace open3d
math::float4 color
Definition: LineSetBuffers.cpp:45
The base geometry class for 2D geometries.
Definition: Geometry2D.h:22
The base geometry class.
Definition: Geometry.h:18
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:23
The Image class stores image with customizable width, height, num of channels and bytes per channel.
Definition: Image.h:34
Image & Clear() override
Clear all elements in the geometry.
Definition: Image.cpp:26
FilterType
Specifies the Image filter type.
Definition: Image.h:53
RGBDImage is for a pair of registered color and depth images,.
Definition: RGBDImage.h:27
~RGBDImage() override
Definition: RGBDImage.h:40
Eigen::Vector2d GetMinBound() const override
Returns min bounds for geometry coordinates.
Definition: RGBDImage.cpp:23
static std::shared_ptr< RGBDImage > CreateFromColorAndDepth(const Image &color, const Image &depth, double depth_scale=1000.0, double depth_trunc=3.0, bool convert_rgb_to_intensity=true)
Factory function to create an RGBD Image from color and depth Images.
Definition: RGBDImageFactory.cpp:13
RGBDImage(const Image &color, const Image &depth)
Parameterized Constructor.
Definition: RGBDImage.h:35
static std::shared_ptr< RGBDImage > CreateFromSUNFormat(const Image &color, const Image &depth, bool convert_rgb_to_intensity=true)
Factory function to create an RGBD Image from SUN3D dataset.
Definition: RGBDImageFactory.cpp:54
RGBDImagePyramid CreatePyramid(size_t num_of_levels, bool with_gaussian_filter_for_color=true, bool with_gaussian_filter_for_depth=false) const
Definition: RGBDImage.cpp:48
static std::shared_ptr< RGBDImage > CreateFromTUMFormat(const Image &color, const Image &depth, bool convert_rgb_to_intensity=true)
Factory function to create an RGBD Image from TUM dataset.
Definition: RGBDImageFactory.cpp:44
Image depth_
The depth image.
Definition: RGBDImage.h:125
static std::shared_ptr< RGBDImage > CreateFromRedwoodFormat(const Image &color, const Image &depth, bool convert_rgb_to_intensity=true)
Factory function to create an RGBD Image from Redwood dataset.
Definition: RGBDImageFactory.cpp:34
RGBDImage & Clear() override
Clear all elements in the geometry.
Definition: RGBDImage.cpp:13
Image color_
The color image.
Definition: RGBDImage.h:123
bool IsEmpty() const override
Returns true iff the geometry is empty.
Definition: RGBDImage.cpp:19
Eigen::Vector2d GetMaxBound() const override
Returns max bounds for geometry coordinates.
Definition: RGBDImage.cpp:27
static std::shared_ptr< RGBDImage > CreateFromNYUFormat(const Image &color, const Image &depth, bool convert_rgb_to_intensity=true)
Factory function to create an RGBD Image from NYU dataset.
Definition: RGBDImageFactory.cpp:76
RGBDImage()
Default Comnstructor.
Definition: RGBDImage.h:30
static RGBDImagePyramid FilterPyramid(const RGBDImagePyramid &rgbd_image_pyramid, Image::FilterType type)
Definition: RGBDImage.cpp:31
char type
Definition: FilePCD.cpp:41
std::vector< std::shared_ptr< RGBDImage > > RGBDImagePyramid
Typedef and functions for RGBDImagePyramid.
Definition: RGBDImage.h:16
Definition: PinholeCameraIntrinsic.cpp:16