IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
XYZImage Class Referencefinal

#include <peak_icv/types/peak_icv_xyz_image.hpp>

Inheritance diagram for XYZImage:

Public Member Functions

 XYZImage (const UndistortedImage &undistortedDepthMap)
 Constructs a cartesian coordinate image from an undistorted depth map.
 
XYZImage TransformToWorkspace (const ExtrinsicParameters &extrinsicParameters) const
 Transforms the camera-centric coordinates into workspace coordinates.
 
bool operator== (const Image &rhs) const
 
Image Copy () const
 Creates a deep copy of the current Image.
 
peak::common::Size GetSize () const
 Provides the size of the image in pixels.
 
uint8_t * GetData () const
 Provides a pointer to the image data buffer.
 
size_t GetSizeInBytes () const
 Provides the size of the image data in bytes.
 
size_t GetBytesPerLine () const
 Computes the number of bytes required to store one line of pixel data (no padding).
 
peak::common::PixelFormat GetPixelFormat () const
 Provides the pixel format of the image.
 
Region GetRegion () const
 Provides the region of the image.
 
void SetRegion (const Region &region) const
 Updates the region on the image.
 
void ResetRegion () const
 Resets the region on the image to the complete image.
 
template<typename DataType >
DataType * At (size_t x, size_t y) const
 Provides a pointer to the data at the specified coordinates.
 
peak::icv::Image ConvertPixelFormat (peak::common::PixelFormat pixelFormat) const
 Converts the image to a different pixel format.
 
peak::icv::Image ConvertPixelFormatWithFactor (peak::common::PixelFormat pixelFormat, const double factor) const
 Converts an image into another pixel format with a factor multiplied to every pixel.
 
std::vector< Image > Deinterleave () const
 Splits an image with an interleaved pixel format into individual images.
 
void SetMetadata (const peak::common::Metadata &metadata)
 Updates the Metadata of an image which is used to store and manage capture information.
 
peak::common::Metadata GetMetadata () const
 Returns the Metadata of an image which contains information about the image capture information.
 
Image Subtract (const Image &subtrahend) const
 Subtracts the specified subtrahend image pixelwise from the current image and returns the resulting image.
 
Image operator- (const Image &subtrahend) const
 Subtracts the specified subtrahend image pixelwise from the current image and returns the resulting image.
 
Image Crop (const peak::common::Rectangle &rect) const
 Crops the image to the given rectangle.
 
Image Scale (const peak::common::Size &targetImageSize, const Interpolation &interpolation=Interpolation::NearestNeighbor) const
 Returns an image scaled to the given image size.
 

Detailed Description

Represents a three-channel image encoding cartesian coordinates (x, y, z) of a 3D point.

This image is derived from an undistorted depth map that contains embedded intrinsic parameters and uses radial coordinates.

In contrast to radial coordinates, which measure the direct distance from the optical center to the object, cartesian coordinates project these measurements onto a uniform plane.

For example: If the camera faces a flat wall, only the cartesian coordinates will form a flat plane, whereas radial values will increase towards the image edges.

Since
ids_peak_icv 1.1

Definition at line 44 of file peak_icv_xyz_image.hpp.

Constructor & Destructor Documentation

◆ XYZImage()

XYZImage ( const UndistortedImage & undistortedDepthMap)
inlineexplicit

Constructs a cartesian coordinate image from an undistorted depth map.

To convert a distorted depth map into the required format, use the Undistortion class beforehand.

Supported pixel formats
  • Coord3D_C32f

See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.

Parameters
undistortedDepthMapAn image encoding radial distances to 3D points that contains embedded intrinsic camera parameters.
Since
ids_peak_icv 1.1

Definition at line 96 of file peak_icv_xyz_image.hpp.

Member Function Documentation

◆ At()

template<typename DataType >
DataType * At ( size_t x,
size_t y ) const
inlineinherited

Provides a pointer to the data at the specified coordinates.

Template Parameters
DataTypeThe type of the data to retrieve.
Parameters
xThe x-coordinate.
yThe y-coordinate.
Returns
A pointer to the data at the specified coordinates.
Since
ids_peak_icv 1.0

Definition at line 300 of file peak_icv_image.hpp.

◆ ConvertPixelFormat()

Image ConvertPixelFormat ( peak::common::PixelFormat pixelFormat) const
inlineinherited

Converts the image to a different pixel format.

If the input image has the same pixel format as the specified pixel format parameter, the image will be copied.

Restrictions:

  • Conversion to Bayer formats is only supported from a bayer format with the same pattern, e.g. from BayerRG10p to BayerRG10 or BayerRG8.
  • Conversion to packed formats is not supported.
  • Conversions from RGB or BGR formats to RGBa or BGRa formats is not supported.
  • RGBa and BGRa formats support only conversions into different bit depths of the same channel layout or to Mono formats.
  • Confidence and Coord3D formats can only be converted to other bit depths of the same format type.
Note
For a full list of supported conversions see Supported Pixel Format Conversions.
Parameters
pixelFormatThe target pixel format.
Returns
A new Image with the target pixel format.
Since
ids_peak_icv 1.0

Definition at line 430 of file peak_icv_image.ipp.

◆ ConvertPixelFormatWithFactor()

Image ConvertPixelFormatWithFactor ( peak::common::PixelFormat pixelFormat,
const double factor ) const
inlineinherited

Converts an image into another pixel format with a factor multiplied to every pixel.

If the input image has the same pixel format as the specified pixel format parameter, the image will be copied.

Supported conversions: From PixelFormat::Coord3D_C8 or PixelFormat::Coord3D_C16 to PixelFormat::Coord3D_C32f

Parameters
pixelFormatThe target pixel format.
factorThe multiplication factor
Returns
A new Image with the target pixel format.
Since
ids_peak_icv 1.1

Definition at line 441 of file peak_icv_image.ipp.

◆ Copy()

Image Copy ( ) const
inlineinherited

Creates a deep copy of the current Image.

Returns
The copied image.
Since
ids_peak_icv 1.0

Definition at line 310 of file peak_icv_image.ipp.

◆ Crop()

Image Crop ( const peak::common::Rectangle & rect) const
inlineinherited

Crops the image to the given rectangle.

Returns
The cropped image.
Exceptions
OutOfRangeExceptionThe given rectangle is (partly) outside the image.
Since
ids_peak_icv 1.0

Definition at line 502 of file peak_icv_image.ipp.

◆ Deinterleave()

std::vector< Image > Deinterleave ( ) const
inlineinherited

Splits an image with an interleaved pixel format into individual images.

The function separates e.g. multiple exposures embedded in the combined HDR raw image and provides them as independent images, each with the correctly associated exposure information.

Supported pixel formats
  • Mono10g40IDS_I_A_B
  • BayerRG10g40IDS_I_A_B
  • BayerBG10g40IDS_I_A_B
  • BayerGR10g40IDS_I_A_B
  • BayerGB10g40IDS_I_A_B
  • Mono12g24IDS_I_A_B
  • BayerRG12g24IDS_I_A_B
  • BayerBG12g24IDS_I_A_B
  • BayerGR12g24IDS_I_A_B
  • BayerGB12g24IDS_I_A_B
  • Mono8_I_A_B
  • BayerRG8_I_A_B
  • BayerBG8_I_A_B
  • BayerGR8_I_A_B
  • BayerGB8_I_A_B
  • Mono10_I_A_B
  • BayerRG10_I_A_B
  • BayerBG10_I_A_B
  • BayerGR10_I_A_B
  • BayerGB10_I_A_B
  • Mono12_I_A_B
  • BayerRG12_I_A_B
  • BayerBG12_I_A_B
  • BayerGR12_I_A_B
  • BayerGB12_I_A_B
  • Mono10p_I_A_B
  • BayerRG10p_I_A_B
  • BayerBG10p_I_A_B
  • BayerGR10p_I_A_B
  • BayerGB10p_I_A_B
  • Mono12p_I_A_B
  • BayerRG12p_I_A_B
  • BayerBG12p_I_A_B
  • BayerGR12p_I_A_B
  • BayerGB12p_I_A_B
  • Mono8_I_AB_CD
  • Mono10_I_AB_CD
  • Mono12_I_AB_CD
  • Mono10p_I_AB_CD
  • Mono12p_I_AB_CD
  • Mono10g40IDS_I_AB_CD
  • Mono12g24IDS_I_AB_CD

See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.

Returns
A vector where each element represents one of the interleaved images.
Since
ids_peak_icv 1.3

Definition at line 523 of file peak_icv_image.ipp.

◆ GetBytesPerLine()

size_t GetBytesPerLine ( ) const
inlineinherited

Computes the number of bytes required to store one line of pixel data (no padding).

This returns the exact number of bytes used for one scanline of pixel data based on the image's width, number of channels, and bits per pixel.

Returns
Number of bytes per line of pixel data.
Since
ids_peak_icv 1.0

Definition at line 337 of file peak_icv_image.ipp.

◆ GetData()

uint8_t * GetData ( ) const
inlineinherited

Provides a pointer to the image data buffer.

Returns
A pointer to the image data buffer.
Since
ids_peak_icv 1.0

Definition at line 327 of file peak_icv_image.ipp.

◆ GetMetadata()

peak::common::Metadata GetMetadata ( ) const
inlineinherited

Returns the Metadata of an image which contains information about the image capture information.

Returns
The Metadata of the image
Since
ids_peak_icv 1.1

Definition at line 463 of file peak_icv_image.ipp.

◆ GetPixelFormat()

peak::common::PixelFormat GetPixelFormat ( ) const
inlineinherited

Provides the pixel format of the image.

Returns
The pixel format of the image.
Since
ids_peak_icv 1.0

Definition at line 347 of file peak_icv_image.ipp.

◆ GetRegion()

Region GetRegion ( ) const
inlineinherited

Provides the region of the image.

Returns
The region of the image.
Since
ids_peak_icv 1.1

Definition at line 404 of file peak_icv_image.ipp.

◆ GetSize()

peak::common::Size GetSize ( ) const
inlineinherited

Provides the size of the image in pixels.

Returns
The size of the image in pixels.
Since
ids_peak_icv 1.0

Definition at line 322 of file peak_icv_image.ipp.

◆ GetSizeInBytes()

size_t GetSizeInBytes ( ) const
inlineinherited

Provides the size of the image data in bytes.

Returns
The size of the image data in bytes.
Since
ids_peak_icv 1.0

Definition at line 332 of file peak_icv_image.ipp.

◆ operator-()

Image operator- ( const Image & subtrahend) const
inlineinherited

Subtracts the specified subtrahend image pixelwise from the current image and returns the resulting image.

This function performs a pixelwise subtraction of the given subtrahend image from the current image. The resulting image is returned as a new Image object. The operation requires that both images have the same pixel format and dimensions.

Parameters
subtrahendThe image to subtract from the current image.
Returns
The resulting image after pixelwise subtraction.
Since
ids_peak_icv 1.1

Definition at line 497 of file peak_icv_image.ipp.

◆ operator==()

bool operator== ( const Image & rhs) const
inlineinherited
Since
ids_peak_icv 1.0

Definition at line 284 of file peak_icv_image.ipp.

◆ ResetRegion()

void ResetRegion ( ) const
inlineinherited

Resets the region on the image to the complete image.

Since
ids_peak_icv 1.1

Definition at line 423 of file peak_icv_image.ipp.

◆ Scale()

Image Scale ( const peak::common::Size & targetImageSize,
const Interpolation & interpolation = Interpolation::NearestNeighbor ) const
inlineinherited

Returns an image scaled to the given image size.

Internally the scale factors are computed as follows:

  • Horizontal scale factor (X-axis) = Image width / Size width
  • Vertical scale factor (Y-axis) = Image height / Size height

These factors determine how the input image is resized to match the desired output dimensions.

Parameters
targetImageSizeThe image size to which the original image is scaled.
interpolationThe interpolation method used to scale the image.
Returns
The scaled image.
Exceptions
NotPossibleExceptionThe given targetImageSize is empty (i.e. width × height == 0).
NotSupportedExceptionThe interpolation method is not supported.
Since
ids_peak_icv 1.0

Definition at line 513 of file peak_icv_image.ipp.

◆ SetMetadata()

void SetMetadata ( const peak::common::Metadata & metadata)
inlineinherited

Updates the Metadata of an image which is used to store and manage capture information.

Parameters
metadataMetadata to be updated
Since
ids_peak_icv 1.1

Definition at line 452 of file peak_icv_image.ipp.

◆ SetRegion()

void SetRegion ( const Region & region) const
inlineinherited

Updates the region on the image.

Sets a region of interest (ROI) for the specified image handle, which defines a sub-area of the image where operations or analyses are focused. Any points in the region that fall outside the bounds of the image are automatically discarded (clipped).

Parameters
regionRegion to update
Since
ids_peak_icv 1.1

Definition at line 414 of file peak_icv_image.ipp.

◆ Subtract()

Image Subtract ( const Image & subtrahend) const
inlineinherited

Subtracts the specified subtrahend image pixelwise from the current image and returns the resulting image.

This function performs a pixelwise subtraction of the given subtrahend image from the current image. The resulting image is returned as a new Image object. The operation requires that both images have the same pixel format and dimensions.

Parameters
subtrahendThe image to subtract from the current image.
Returns
The resulting image after pixelwise subtraction.
Since
ids_peak_icv 1.1

Definition at line 485 of file peak_icv_image.ipp.

◆ TransformToWorkspace()

XYZImage TransformToWorkspace ( const ExtrinsicParameters & extrinsicParameters) const
inline

Transforms the camera-centric coordinates into workspace coordinates.

This applies the inverse of the provided extrinsic matrix to map the 3D points from the camera's perspective into the physical workspace.

Parameters
extrinsicParametersThe extrinsic parameters defining the workspace.
Since
ids_peak_icv 1.1

Definition at line 111 of file peak_icv_xyz_image.hpp.