Open3D (C++ API)  0.17.0
ImageIO.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
10#include <string>
11
12#include "open3d/io/ImageIO.h"
14
15namespace open3d {
16namespace t {
17namespace io {
18
21std::shared_ptr<geometry::Image> CreateImageFromFile(
22 const std::string &filename);
23
30bool ReadImage(const std::string &filename, geometry::Image &image);
31
33
54bool WriteImage(const std::string &filename,
56 int quality = kOpen3DImageIODefaultQuality);
57
58bool ReadImageFromPNG(const std::string &filename, geometry::Image &image);
59
60bool WriteImageToPNG(const std::string &filename,
62 int quality = kOpen3DImageIODefaultQuality);
63
64bool ReadImageFromJPG(const std::string &filename, geometry::Image &image);
65
66bool WriteImageToJPG(const std::string &filename,
68 int quality = kOpen3DImageIODefaultQuality);
69
75public:
80 explicit DepthNoiseSimulator(const std::string &noise_model_path);
81
92 float depth_scale = 1000.0);
93
95 core::Tensor GetNoiseModel() const { return model_; }
96
99 void EnableDeterministicDebugMode() { deterministic_debug_mode_ = true; }
100
101private:
102 core::Tensor model_; // ndims==3
103 bool deterministic_debug_mode_ = false;
104};
105
106} // namespace io
107} // namespace t
108} // namespace open3d
std::shared_ptr< core::Tensor > image
Definition: FilamentRenderer.cpp:183
Definition: Tensor.h:32
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:29
Definition: ImageIO.h:74
DepthNoiseSimulator(const std::string &noise_model_path)
Constructor.
Definition: ImageIO.cpp:88
geometry::Image Simulate(const geometry::Image &im_src, float depth_scale=1000.0)
Apply noise model to a depth image.
Definition: ImageIO.cpp:146
core::Tensor GetNoiseModel() const
Return the noise model.
Definition: ImageIO.h:95
void EnableDeterministicDebugMode()
Enable deterministic debug mode. All normally distributed noise will be replaced by 0.
Definition: ImageIO.h:99
bool WriteImageToPNG(const std::string &filename, const geometry::Image &image, int quality)
Definition: FilePNG.cpp:72
bool ReadImageFromJPG(const std::string &filename, geometry::Image &image)
Definition: FileJPG.cpp:22
bool ReadImageFromPNG(const std::string &filename, geometry::Image &image)
Definition: FilePNG.cpp:38
bool WriteImageToJPG(const std::string &filename, const geometry::Image &image, int quality)
Definition: FileJPG.cpp:83
bool WriteImage(const std::string &filename, const geometry::Image &image, int quality)
Definition: ImageIO.cpp:69
constexpr int kOpen3DImageIODefaultQuality
Definition: ImageIO.h:32
std::shared_ptr< geometry::Image > CreateImageFromFile(const std::string &filename)
Definition: ImageIO.cpp:44
bool ReadImage(const std::string &filename, geometry::Image &image)
Definition: ImageIO.cpp:51
Definition: PinholeCameraIntrinsic.cpp:16