 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
47 Image(int64_t rows = 0,
106 return data_[r][c][0];
114 return data_[r][c][ch];
156 double offset = 0.0)
const;
218 float value_sigma = 20.0f,
219 float distance_sigma = 10.0f)
const;
231 std::pair<Image, Image>
FilterSobel(
int kernel_size = 3)
const;
271 float clip_fill = 0.0f)
const;
286 float invalid_fill = 0.0f);
337 static constexpr
bool HAVE_IPP =
true;
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
Dtype GetDtype() const
Definition: Tensor.h:1164
Image ClipTransform(float scale, float min_value, float max_value, float clip_fill=0.0f) const
Return new image after scaling and clipping image values.
Definition: Image.cpp:417
@ Nearest
Nearest neighbors interpolation.
SizeVector GetShape() const
Definition: Tensor.h:1127
Image To(const core::Device &device, bool copy=false) const
Transfer the image to a specified device.
Definition: Image.h:132
int offset
Definition: FileIOFactory.cpp:135
bool copy
Definition: VtkUtils.cpp:74
core::Tensor GetMinBound() const
Compute min 2D coordinates for the data (always {0, 0}).
Definition: Image.h:315
Image CreateVertexMap(const core::Tensor &intrinsics, float invalid_fill=0.0f)
Create a vertex map from a depth image using unprojection.
Definition: Image.cpp:449
Image Resize(float sampling_rate=0.5f, InterpType interp_type=InterpType::Nearest) const
Return a new image after resizing with specified interpolation type.
Definition: Image.cpp:156
Image & Reset(int64_t rows=0, int64_t cols=0, int64_t channels=1, core::Dtype dtype=core::Float32, const core::Device &device=core::Device("CPU:0"))
Reinitialize image with new parameters.
Definition: Image.cpp:56
Image Filter(const core::Tensor &kernel) const
Return a new image after filtering with the given kernel.
Definition: Image.cpp:278
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:29
Image & LinearTransform(double scale=1.0, double offset=0.0)
Function to linearly transform pixel intensities in place.
Definition: Image.h:167
int64_t GetRows() const
Get the number of rows of the image.
Definition: Image.h:84
core::Device GetDevice() const override
Get device of the image.
Definition: Image.h:96
Image(int64_t rows=0, int64_t cols=0, int64_t channels=1, core::Dtype dtype=core::Float32, const core::Device &device=core::Device("CPU:0"))
Constructor for image.
Definition: Image.cpp:31
Image RGBToGray() const
Converts a 3-channel RGB image to a new 1-channel Grayscale image.
Definition: Image.cpp:120
core::Dtype GetDtype() const
Get dtype of the image.
Definition: Image.h:93
Image ColorizeDepth(float scale, float min_value, float max_value)
Colorize an input depth image (with Dtype UInt16 or Float32).
Definition: Image.cpp:482
Image CPU() const
Backward-compatible convenience method to obtain a CPU-resident copy.
Definition: Image.h:140
Image CreateNormalMap(float invalid_fill=0.0f)
Create a normal map from a vertex map.
Definition: Image.cpp:467
Image & Clear() override
Clear image contents by resetting the rows and cols to 0, while keeping channels, dtype and device un...
Definition: Image.h:65
static Tensor Zeros(const SizeVector &shape, Dtype dtype, const Device &device=Device("CPU:0"))
Create a tensor fill with zeros.
Definition: Tensor.cpp:406
core::Tensor AsTensor() const
Returns the underlying Tensor of the Image.
Definition: Image.h:124
Image PyrDown() const
Return a new downsampled image with pyramid downsampling.
Definition: Image.cpp:395
InterpType
Image interpolation algorithms.
Definition: Image.h:178
std::pair< Image, Image > FilterSobel(int kernel_size=3) const
Return a pair of new gradient images (dx, dy) after Sobel filtering.
Definition: Image.cpp:345
@ Lanczos
Lanczos filter interpolation.
static Image FromLegacy(const cloudViewer::geometry::Image &image_legacy, const core::Device &Device=core::Device("CPU:0"))
Create from a legacy CloudViewer Image.
Definition: Image.cpp:505
Device GetDevice() const override
Definition: Tensor.cpp:1435
cloudViewer::geometry::Image ToLegacy() const
Convert to legacy Image type.
Definition: Image.cpp:534
std::string ToString() const
Text description.
Definition: Image.cpp:555
int64_t GetCols() const
Get the number of columns of the image.
Definition: Image.h:87
const void * GetDataPtr() const
Get raw buffer of the Image data.
Definition: Image.h:121
const Dtype Float32
Definition: Dtype.cpp:42
Image Dilate(int kernel_size=3) const
Return a new image after performing morphological dilation.
Definition: Image.cpp:203
Image PyrDownDepth(float diff_threshold, float invalid_fill=0.f) const
Edge and invalid value preserving downsampling by 2 specifically for depth images.
Definition: Image.cpp:400
Definition: Optional.h:44
static constexpr bool HAVE_IPP
Do we use IPP for accelerating image processing operations?
Definition: Image.h:339
Image FilterBilateral(int kernel_size=3, float value_sigma=20.0f, float distance_sigma=10.0f) const
Return a new image after bilateral filtering.
Definition: Image.cpp:239
core::Tensor GetMaxBound() const
Compute max 2D coordinates for the data ({rows, cols}).
Definition: Image.h:320
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:113
@ Cubic
Bicubic interpolation.
void * GetDataPtr()
Get raw buffer of the Image data.
Definition: Image.h:118
core::Tensor data_
Definition: Image.h:346
constexpr nullopt_t nullopt
Definition: Optional.h:136
bool IsEmpty() const override
Returns true if rows * cols * channels == 0.
Definition: Image.h:71
int64_t GetChannels() const
Get the number of channels of the image.
Definition: Image.h:90
Image FilterGaussian(int kernel_size=3, float sigma=1.0f) const
Return a new image after Gaussian filtering.
Definition: Image.cpp:309
@ Super
Super sampling interpolation (only downsample).
@ Linear
Bilinear interpolation.
const Dtype Int64
Definition: Dtype.cpp:47
Tensor To(Dtype dtype, bool copy=false) const
Definition: Tensor.cpp:739
The base geometry class.
Definition: Geometry.h:23
The Image class stores image with customizable width, height, num of channels and bytes per channel.
Definition: Image.h:33
virtual ~Image() override
Definition: Image.h:60
Image Clone() const
Returns copy of the image on the same device.
Definition: Image.h:143
T * GetDataPtr()
Definition: Tensor.h:1144
core::Tensor At(int64_t r, int64_t c) const
Get pixel(s) in the image.
Definition: Image.h:104