Open3D (C++ API)
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions
open3d::geometry::Image Class Reference

#include <Image.h>

Inheritance diagram for open3d::geometry::Image:
open3d::geometry::Geometry2D open3d::geometry::Geometry

Public Types

enum  ColorToIntensityConversionType { ColorToIntensityConversionType::Equal, ColorToIntensityConversionType::Weighted }
 
enum  FilterType {
  FilterType::Gaussian3, FilterType::Gaussian5, FilterType::Gaussian7, FilterType::Sobel3Dx,
  FilterType::Sobel3Dy
}
 
- Public Types inherited from open3d::geometry::Geometry
enum  GeometryType {
  GeometryType::Unspecified = 0, GeometryType::PointCloud = 1, GeometryType::VoxelGrid = 2, GeometryType::Octree = 3,
  GeometryType::LineSet = 4, GeometryType::TriangleMesh = 5, GeometryType::HalfEdgeTriangleMesh = 6, GeometryType::Image = 7,
  GeometryType::RGBDImage = 8, GeometryType::TetraMesh = 9, GeometryType::OrientedBoundingBox = 10, GeometryType::AxisAlignedBoundingBox = 11
}
 

Public Member Functions

 Image ()
 
 ~Image () override
 
ImageClear () override
 
bool IsEmpty () const override
 
Eigen::Vector2d GetMinBound () const override
 
Eigen::Vector2d GetMaxBound () const override
 
bool TestImageBoundary (double u, double v, double inner_margin=0.0) const
 
virtual bool HasData () const
 
ImagePrepare (int width, int height, int num_of_channels, int bytes_per_channel)
 
int BytesPerLine () const
 
std::pair< bool, double > FloatValueAt (double u, double v) const
 
std::shared_ptr< ImageCreateFloatImage (Image::ColorToIntensityConversionType type=Image::ColorToIntensityConversionType::Weighted) const
 Return a gray scaled float type image. More...
 
template<typename T >
T * PointerAt (int u, int v) const
 Function to access the raw data of a single-channel Image. More...
 
template<typename T >
T * PointerAt (int u, int v, int ch) const
 Function to access the raw data of a multi-channel Image. More...
 
std::shared_ptr< ImageConvertDepthToFloatImage (double depth_scale=1000.0, double depth_trunc=3.0) const
 
std::shared_ptr< ImageFlip () const
 
std::shared_ptr< ImageFilter (Image::FilterType type) const
 Function to filter image with pre-defined filtering type. More...
 
std::shared_ptr< ImageFilter (const std::vector< double > &dx, const std::vector< double > &dy) const
 Function to filter image with arbitrary dx, dy separable filters. More...
 
std::shared_ptr< ImageFilterHorizontal (const std::vector< double > &kernel) const
 
std::shared_ptr< ImageDownsample () const
 Function to 2x image downsample using simple 2x2 averaging. More...
 
std::shared_ptr< ImageDilate (int half_kernel_size=1) const
 Function to dilate 8bit mask map. More...
 
ImageLinearTransform (double scale=1.0, double offset=0.0)
 
ImageClipIntensity (double min=0.0, double max=1.0)
 
template<typename T >
std::shared_ptr< ImageCreateImageFromFloatImage () const
 
ImagePyramid CreatePyramid (size_t num_of_levels, bool with_gaussian_filter=true) const
 Function to create image pyramid. More...
 
std::shared_ptr< ImageCreateDepthBoundaryMask (double depth_threshold_for_discontinuity_check=0.1, int half_dilation_kernel_size_for_discontinuity_map=3) const
 Function to create a depthmap boundary mask from depth image. More...
 
- Public Member Functions inherited from open3d::geometry::Geometry2D
 ~Geometry2D () override
 
- Public Member Functions inherited from open3d::geometry::Geometry
virtual ~Geometry ()
 
GeometryType GetGeometryType () const
 
int Dimension () const
 

Static Public Member Functions

static std::shared_ptr< ImageCreateDepthToCameraDistanceMultiplierFloatImage (const camera::PinholeCameraIntrinsic &intrinsic)
 
static ImagePyramid FilterPyramid (const ImagePyramid &input, Image::FilterType type)
 Function to filter image pyramid. More...
 

Data Fields

int width_ = 0
 
int height_ = 0
 
int num_of_channels_ = 0
 
int bytes_per_channel_ = 0
 
std::vector< uint8_t > data_
 

Protected Member Functions

void AllocateDataBuffer ()
 
- Protected Member Functions inherited from open3d::geometry::Geometry2D
 Geometry2D (GeometryType type)
 
- Protected Member Functions inherited from open3d::geometry::Geometry
 Geometry (GeometryType type, int dimension)
 

Member Enumeration Documentation

◆ ColorToIntensityConversionType

Enumerator
Equal 
Weighted 

◆ FilterType

Enumerator
Gaussian3 
Gaussian5 
Gaussian7 
Sobel3Dx 
Sobel3Dy 

Constructor & Destructor Documentation

◆ Image()

open3d::geometry::Image::Image ( )
inline

◆ ~Image()

open3d::geometry::Image::~Image ( )
inlineoverride

Member Function Documentation

◆ AllocateDataBuffer()

void open3d::geometry::Image::AllocateDataBuffer ( )
inlineprotected

◆ BytesPerLine()

int open3d::geometry::Image::BytesPerLine ( ) const
inline

◆ Clear()

Image & open3d::geometry::Image::Clear ( )
overridevirtual

◆ ClipIntensity()

Image & open3d::geometry::Image::ClipIntensity ( double  min = 0.0,
double  max = 1.0 
)

Function to clipping pixel intensities min is lower bound max is upper bound

◆ ConvertDepthToFloatImage()

std::shared_ptr< Image > open3d::geometry::Image::ConvertDepthToFloatImage ( double  depth_scale = 1000.0,
double  depth_trunc = 3.0 
) const

◆ CreateDepthBoundaryMask()

std::shared_ptr< Image > open3d::geometry::Image::CreateDepthBoundaryMask ( double  depth_threshold_for_discontinuity_check = 0.1,
int  half_dilation_kernel_size_for_discontinuity_map = 3 
) const

Function to create a depthmap boundary mask from depth image.

◆ CreateDepthToCameraDistanceMultiplierFloatImage()

std::shared_ptr< Image > open3d::geometry::Image::CreateDepthToCameraDistanceMultiplierFloatImage ( const camera::PinholeCameraIntrinsic intrinsic)
static

Factory function to create a float image composed of multipliers that convert depth values into camera distances (ImageFactory.cpp) The multiplier function M(u,v) is defined as: M(u, v) = sqrt(1 + ((u - cx) / fx) ^ 2 + ((v - cy) / fy) ^ 2) This function is used as a convenient function for performance optimization in volumetric integration (see Core/Integration/TSDFVolume.h).

◆ CreateFloatImage()

std::shared_ptr< Image > open3d::geometry::Image::CreateFloatImage ( Image::ColorToIntensityConversionType  type = Image::ColorToIntensityConversionType::Weighted) const

Return a gray scaled float type image.

◆ CreateImageFromFloatImage()

template<typename T >
template std::shared_ptr< Image > open3d::geometry::Image::CreateImageFromFloatImage< uint16_t > ( ) const

Function to change data types of image crafted for specific usage such as single channel float image -> 8-bit RGB or 16-bit depth image

◆ CreatePyramid()

ImagePyramid open3d::geometry::Image::CreatePyramid ( size_t  num_of_levels,
bool  with_gaussian_filter = true 
) const

Function to create image pyramid.

◆ Dilate()

std::shared_ptr< Image > open3d::geometry::Image::Dilate ( int  half_kernel_size = 1) const

Function to dilate 8bit mask map.

◆ Downsample()

std::shared_ptr< Image > open3d::geometry::Image::Downsample ( ) const

Function to 2x image downsample using simple 2x2 averaging.

◆ Filter() [1/2]

std::shared_ptr< Image > open3d::geometry::Image::Filter ( Image::FilterType  type) const

Function to filter image with pre-defined filtering type.

◆ Filter() [2/2]

std::shared_ptr< Image > open3d::geometry::Image::Filter ( const std::vector< double > &  dx,
const std::vector< double > &  dy 
) const

Function to filter image with arbitrary dx, dy separable filters.

◆ FilterHorizontal()

std::shared_ptr< Image > open3d::geometry::Image::FilterHorizontal ( const std::vector< double > &  kernel) const

◆ FilterPyramid()

ImagePyramid open3d::geometry::Image::FilterPyramid ( const ImagePyramid input,
Image::FilterType  type 
)
static

Function to filter image pyramid.

◆ Flip()

std::shared_ptr< Image > open3d::geometry::Image::Flip ( ) const

◆ FloatValueAt()

std::pair< bool, double > open3d::geometry::Image::FloatValueAt ( double  u,
double  v 
) const

Function to access the bilinear interpolated float value of a (single-channel) float image. Returns a tuple, where the first bool indicates if the u,v coordinates are withing the image dimensions, and the second double value is the interpolated pixel value.

◆ GetMaxBound()

Eigen::Vector2d open3d::geometry::Image::GetMaxBound ( ) const
overridevirtual

◆ GetMinBound()

Eigen::Vector2d open3d::geometry::Image::GetMinBound ( ) const
overridevirtual

◆ HasData()

virtual bool open3d::geometry::Image::HasData ( ) const
inlinevirtual

◆ IsEmpty()

bool open3d::geometry::Image::IsEmpty ( ) const
overridevirtual

◆ LinearTransform()

Image & open3d::geometry::Image::LinearTransform ( double  scale = 1.0,
double  offset = 0.0 
)

Function to linearly transform pixel intensities image_new = scale * image + offset

◆ PointerAt() [1/2]

template<typename T >
template uint16_t * open3d::geometry::Image::PointerAt< uint16_t > ( int  u,
int  v 
) const

Function to access the raw data of a single-channel Image.

◆ PointerAt() [2/2]

template<typename T >
template uint16_t * open3d::geometry::Image::PointerAt< uint16_t > ( int  u,
int  v,
int  ch 
) const

Function to access the raw data of a multi-channel Image.

◆ Prepare()

Image& open3d::geometry::Image::Prepare ( int  width,
int  height,
int  num_of_channels,
int  bytes_per_channel 
)
inline

◆ TestImageBoundary()

bool open3d::geometry::Image::TestImageBoundary ( double  u,
double  v,
double  inner_margin = 0.0 
) const

Field Documentation

◆ bytes_per_channel_

int open3d::geometry::Image::bytes_per_channel_ = 0

◆ data_

std::vector<uint8_t> open3d::geometry::Image::data_

◆ height_

int open3d::geometry::Image::height_ = 0

◆ num_of_channels_

int open3d::geometry::Image::num_of_channels_ = 0

◆ width_

int open3d::geometry::Image::width_ = 0

The documentation for this class was generated from the following files: