Open3D (C++ API)  0.16.0
RGBDImage.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-2021 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
31
32namespace open3d {
33namespace geometry {
34
35class RGBDImage;
36
38typedef std::vector<std::shared_ptr<RGBDImage>> RGBDImagePyramid;
39
46class RGBDImage : public Geometry2D {
47public:
54 RGBDImage(const Image &color, const Image &depth)
57 depth_(depth) {}
58
59 ~RGBDImage() override {
60 color_.Clear();
61 depth_.Clear();
62 };
63
64 RGBDImage &Clear() override;
65 bool IsEmpty() const override;
66 Eigen::Vector2d GetMinBound() const override;
67 Eigen::Vector2d GetMaxBound() const override;
68
81 static std::shared_ptr<RGBDImage> CreateFromColorAndDepth(
82 const Image &color,
83 const Image &depth,
84 double depth_scale = 1000.0,
85 double depth_trunc = 3.0,
86 bool convert_rgb_to_intensity = true);
87
94 static std::shared_ptr<RGBDImage> CreateFromRedwoodFormat(
95 const Image &color,
96 const Image &depth,
97 bool convert_rgb_to_intensity = true);
98
105 static std::shared_ptr<RGBDImage> CreateFromTUMFormat(
106 const Image &color,
107 const Image &depth,
108 bool convert_rgb_to_intensity = true);
109
116 static std::shared_ptr<RGBDImage> CreateFromSUNFormat(
117 const Image &color,
118 const Image &depth,
119 bool convert_rgb_to_intensity = true);
120
127 static std::shared_ptr<RGBDImage> CreateFromNYUFormat(
128 const Image &color,
129 const Image &depth,
130 bool convert_rgb_to_intensity = true);
131
133 const RGBDImagePyramid &rgbd_image_pyramid, Image::FilterType type);
134
136 size_t num_of_levels,
137 bool with_gaussian_filter_for_color = true,
138 bool with_gaussian_filter_for_depth = false) const;
139
140public:
145};
146
147} // namespace geometry
148} // namespace open3d
math::float4 color
Definition: LineSetBuffers.cpp:64
The base geometry class for 2D geometries.
Definition: Geometry2D.h:41
The base geometry class.
Definition: Geometry.h:37
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:42
The Image class stores image with customizable width, height, num of channels and bytes per channel.
Definition: Image.h:53
Image & Clear() override
Clear all elements in the geometry.
Definition: Image.cpp:45
FilterType
Specifies the Image filter type.
Definition: Image.h:72
RGBDImage is for a pair of registered color and depth images,.
Definition: RGBDImage.h:46
~RGBDImage() override
Definition: RGBDImage.h:59
Eigen::Vector2d GetMinBound() const override
Returns min bounds for geometry coordinates.
Definition: RGBDImage.cpp:42
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:32
RGBDImage(const Image &color, const Image &depth)
Parameterized Constructor.
Definition: RGBDImage.h:54
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:71
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:67
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:61
Image depth_
The depth image.
Definition: RGBDImage.h:144
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:51
RGBDImage & Clear() override
Clear all elements in the geometry.
Definition: RGBDImage.cpp:32
Image color_
The color image.
Definition: RGBDImage.h:142
bool IsEmpty() const override
Returns true iff the geometry is empty.
Definition: RGBDImage.cpp:38
Eigen::Vector2d GetMaxBound() const override
Returns max bounds for geometry coordinates.
Definition: RGBDImage.cpp:46
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:91
RGBDImage()
Default Comnstructor.
Definition: RGBDImage.h:49
static RGBDImagePyramid FilterPyramid(const RGBDImagePyramid &rgbd_image_pyramid, Image::FilterType type)
Definition: RGBDImage.cpp:50
char type
Definition: FilePCD.cpp:60
std::vector< std::shared_ptr< RGBDImage > > RGBDImagePyramid
Typedef and functions for RGBDImagePyramid.
Definition: RGBDImage.h:38
Definition: PinholeCameraIntrinsic.cpp:35