63 Image(int64_t rows = 0,
113 return data_[r][c][0];
121 return data_[r][c][ch];
int64_t GetChannels() const
Get the number of channels of the image.
Definition: Image.h:99
core::Tensor GetMaxBound() const
Compute max 2D coordinates for the data ({rows, cols}).
Definition: Image.h:139
int64_t GetRows() const
Get the number of rows of the image.
Definition: Image.h:93
core::Tensor At(int64_t r, int64_t c, int64_t ch) const
Get pixel(s) in the image. Returns a tensor with shape {}.
Definition: Image.h:120
void * GetDataPtr()
Definition: Tensor.h:961
bool IsEmpty() const override
Returns true if rows * cols * channels == 0.
Definition: Image.h:87
void * GetDataPtr()
Get raw buffer of the Image data.
Definition: Image.h:125
virtual ~Image() override
Definition: Image.h:76
Device GetDevice() const
Definition: Tensor.cpp:955
std::string ToString() const
Text description.
Definition: Image.cpp:122
Dtype GetDtype() const
Definition: Tensor.h:965
The Image class stores image with customizable rols, cols, channels, dtype and device.
Definition: Image.h:45
open3d::geometry::Image ToLegacyImage() const
Convert to legacy Image type.
Definition: Image.cpp:101
core::Tensor data_
Definition: Image.h:158
core::Device GetDevice() const
Get device of the image.
Definition: Image.h:105
int64_t GetCols() const
Get the number of columns of the image.
Definition: Image.h:96
core::Tensor At(int64_t r, int64_t c) const
Definition: Image.h:111
static Tensor Zeros(const SizeVector &shape, Dtype dtype, const Device &device=Device("CPU:0"))
Create a tensor fill with zeros.
Definition: Tensor.cpp:182
Image(int64_t rows=0, int64_t cols=0, int64_t channels=1, core::Dtype dtype=core::Dtype::Float32, const core::Device &device=core::Device("CPU:0"))
Constructor for image.
Definition: Image.cpp:38
static const Dtype Float32
Definition: Dtype.h:42
const void * GetDataPtr() const
Get raw buffer of the Image data.
Definition: Image.h:128
core::Tensor GetMinBound() const
Compute min 2D coordinates for the data (always {0, 0}).
Definition: Image.h:134
SizeVector GetShape() const
Definition: Tensor.h:945
The base geometry class.
Definition: Geometry.h:38
static const Dtype Int64
Definition: Dtype.h:45
Definition: PinholeCameraIntrinsic.cpp:35
Image & Clear() override
Definition: Image.h:81
static Image FromLegacyImage(const open3d::geometry::Image &image_legacy, const core::Device &Device=core::Device("CPU:0"))
Create from a legacy Open3D Image.
Definition: Image.cpp:72
core::Dtype GetDtype() const
Get dtype of the image.
Definition: Image.h:102
The Image class stores image with customizable width, height, num of channels and bytes per channel...
Definition: Image.h:53
core::Tensor AsTensor() const
Retuns the underlying Tensor of the Image.
Definition: Image.h:131