IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
Image Class Reference
Inheritance diagram for Image:

Data Structures

class  Handle
 

Public Member Functions

 Image (IImageView imageView)
 Constructs an Image from an IImageView instance.
 
 Image (PixelFormat pixelFormat, Size imageSize)
 Constructs an Image with a given size in pixels and pixel format.
 
 Image (PixelFormat pixelFormat, Size imageSize, IntPtr buffer, uint bufferSize)
 Constructs an Image from a pointer to a buffer.
 
 Image (string filePath)
 Constructs an Image from a file path.
 
 Image (string filePath, PixelFormat pixelFormat)
 Constructs an Image from a file path with a specified pixel format.
 
void Dispose ()
 Releases the resources used by the Image class.
 
void ResetRegion ()
 Resets the region on the image to the complete image.
 
Image Copy ()
 Creates a deep copy of the current Image.
 
Image ConvertPixelFormat (PixelFormat pixelFormat)
 Converts the image to a different pixel format.
 
Image ConvertPixelFormatWithFactor (PixelFormat pixelFormat, double factor)
 Converts an image into another pixel format with a factor multiplied to every pixel.
 
Image Subtract (Image subtrahend)
 Subtracts the specified subtrahend image pixel-wise from the current image and returns the resulting image.
 
List< Image > Deinterleave ()
 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.
 

Static Public Member Functions

static Image operator- (Image minuend, Image subtrahend)
 Performs pixel-wise subtraction of two images.
 

Properties

PixelFormat PixelFormat [get]
 Gets the pixel format from the image.
 
Size Size [get]
 Gets the image size in pixels from the image.
 
uint Width [get]
 Gets the image width in pixels from the image.
 
uint Height [get]
 Gets the image height in pixels from the image.
 
IntPtr Data [get]
 Gets the image buffer from the image.
 
long SizeInBytes [get]
 Gets the size of the image data in bytes.
 
Metadata Metadata [get, set]
 Gets or sets the metadata of the image.
 
Region Region [get, set]
 Gets or 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).
 
static IEqualityComparer< Image > Comparer = new ImageEqualityComparer() [get]
 Gets a default equality comparer for comparing Image data values.
 

Detailed Description

Constructs an Image from an IImageView Instance.

This can be a buffer or a possibility to convert other libraries Images into this Image type.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 17 of file Image.cs.

Constructor & Destructor Documentation

◆ Image() [1/5]

Image ( IImageView imageView)
inline

Constructs an Image from an IImageView instance.

This can be a buffer or a mechanism to convert images from other libraries into this Image type.

Parameters
imageViewAbstract image source.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 51 of file Image.cs.

◆ Image() [2/5]

Image ( PixelFormat pixelFormat,
Size imageSize )
inline

Constructs an Image with a given size in pixels and pixel format.

Parameters
pixelFormatThe pixel format of the image.
imageSizeThe size of the image in pixels.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 66 of file Image.cs.

◆ Image() [3/5]

Image ( PixelFormat pixelFormat,
Size imageSize,
IntPtr buffer,
uint bufferSize )
inline

Constructs an Image from a pointer to a buffer.

Parameters
pixelFormatThe pixel format of the image.
imageSizeThe size of the image in pixels.
bufferThe pointer to the buffer containing image data.
bufferSizeThe size of the buffer.
Exceptions
IcvNotSupportedExceptionThrown when the given pixel format is not supported.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 89 of file Image.cs.

◆ Image() [4/5]

Image ( string filePath)
inline

Constructs an Image from a file path.

The following image formats are supported:

  • PNG: (.png)
  • BMP: (.bmp)
  • JPEG: (.jpeg, .jpg)
  • RAW: (.raw)

Supported image and pixel formats

  • BMP:

    • Mono8
    • Mono10
    • Mono12
    • Mono16
    • RGBa8
    • RGB10p32
    • BGR8
    • BGRa8
    • BGR10p32
    • BayerRG8
    • BayerRG10
    • BayerRG12
    • BayerGR8
    • BayerGR10
    • BayerGR12
    • BayerGB8
    • BayerGB10
    • BayerGB12
    • BayerBG8
    • BayerBG10
    • BayerBG12
    • Confidence8
    • Confidence16
    • Coord3D_C16
    • Coord3D_C8

  • JPEG:

    • BayerGB8
    • BayerGR8
    • RGBa8
    • RGB8
    • BayerBG8
    • BayerRG8
    • BGRa8
    • BGR8
    • Mono8

  • PNG:

    • Mono8
    • Mono10
    • Mono12
    • RGB8
    • RGBa8
    • RGBa10
    • RGBa12
    • BayerRG8
    • BayerRG10
    • BayerRG12
    • BayerGR8
    • BayerGR10
    • BayerGR12
    • BayerGB8
    • BayerGB10
    • BayerGB12
    • BayerBG8
    • BayerBG10
    • BayerBG12
    • Confidence8
    • Confidence16
    • Coord3D_C8
    • Coord3D_C16

  • RAW:

    • BayerGR8
    • BayerGR10
    • BayerGR12
    • BayerRG8
    • BayerRG10
    • BayerRG12
    • BayerGB8
    • BayerGB10
    • BayerGB12
    • BayerBG8
    • BayerBG10
    • BayerBG12
    • Mono8
    • Mono10
    • Mono12
    • Mono16
    • Confidence8
    • Confidence16
    • Coord3D_C8
    • Coord3D_C16
    • Coord3D_C32f
    • Coord3D_ABC32f
    • YUV420_8_YY_UV_SemiplanarIDS
    • YUV420_8_YY_VU_SemiplanarIDS
    • YUV422_8_UYVY
    • RGB8
    • RGB10
    • RGB12
    • BGR8
    • BGR10
    • BGR12
    • RGBa8
    • RGBa10
    • RGBa12
    • BGRa8
    • BGRa10
    • BGRa12
    • BayerBG10p
    • BayerBG12p
    • BayerGB10p
    • BayerGB12p
    • BayerGR10p
    • BayerGR12p
    • BayerRG10p
    • BayerRG12p
    • Mono10p
    • Mono12p
    • RGB10p32
    • BGR10p32
    • BayerRG10g40IDS
    • BayerGB10g40IDS
    • BayerGR10g40IDS
    • BayerBG10g40IDS
    • BayerRG12g24IDS
    • BayerGB12g24IDS
    • BayerGR12g24IDS
    • BayerBG12g24IDS
    • Mono10g40IDS
    • Mono12g24IDS

Parameters
filePathThe file path to the image.

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

Since
IDSImaging.Peak.ICV 1.3

Definition at line 142 of file Image.cs.

◆ Image() [5/5]

Image ( string filePath,
PixelFormat pixelFormat )
inline

Constructs an Image from a file path with a specified pixel format.

This constructor loads an image from the given file path and forces the use of the specified pixel format. The function attempts to interpret the file using the provided format. If interpretation fails, an exception is thrown. Explicit conversion between image formats must be handled manually by the user.

The following image formats are supported:

  • PNG: (.png)
  • BMP: (.bmp)
  • JPEG: (.jpeg, .jpg)
  • RAW: (.raw)

Supported image and pixel formats

  • BMP:

    • Mono8
    • Mono10
    • Mono12
    • Mono16
    • RGBa8
    • RGB10p32
    • BGR8
    • BGRa8
    • BGR10p32
    • BayerRG8
    • BayerRG10
    • BayerRG12
    • BayerGR8
    • BayerGR10
    • BayerGR12
    • BayerGB8
    • BayerGB10
    • BayerGB12
    • BayerBG8
    • BayerBG10
    • BayerBG12
    • Confidence8
    • Confidence16
    • Coord3D_C16
    • Coord3D_C8

  • JPEG:

    • BayerGB8
    • BayerGR8
    • RGBa8
    • RGB8
    • BayerBG8
    • BayerRG8
    • BGRa8
    • BGR8
    • Mono8

  • PNG:

    • Mono8
    • Mono10
    • Mono12
    • RGB8
    • RGBa8
    • RGBa10
    • RGBa12
    • BayerRG8
    • BayerRG10
    • BayerRG12
    • BayerGR8
    • BayerGR10
    • BayerGR12
    • BayerGB8
    • BayerGB10
    • BayerGB12
    • BayerBG8
    • BayerBG10
    • BayerBG12
    • Confidence8
    • Confidence16
    • Coord3D_C8
    • Coord3D_C16

  • RAW: Only the following formats are supported and must match the format used when saving:

    • Mono8
    • Mono10
    • Mono10p
    • Mono12
    • Mono12p
    • Mono16
    • BayerRG8
    • BayerRG10
    • BayerRG10p
    • BayerRG12
    • BayerRG12p
    • BayerGR8
    • BayerGR10
    • BayerGR10p
    • BayerGR12
    • BayerGR12p
    • BayerBG8
    • BayerBG10
    • BayerBG10p
    • BayerBG12
    • BayerBG12p
    • BayerGB8
    • BayerGB10
    • BayerGB10p
    • BayerGB12
    • BayerGB12p
    • Confidence8
    • Confidence16
    • Coord3D_C8
    • Coord3D_C16

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

Since
IDSImaging.Peak.ICV 1.3

Definition at line 200 of file Image.cs.

Member Function Documentation

◆ ConvertPixelFormat()

Image ConvertPixelFormat ( PixelFormat pixelFormat)
inline

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.
Parameters
pixelFormatThe target pixel format.
Returns
A new Image with the target pixel format.

For a full list of supported conversions see Supported Pixel Format Conversions.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 388 of file Image.cs.

◆ ConvertPixelFormatWithFactor()

Image ConvertPixelFormatWithFactor ( PixelFormat pixelFormat,
double factor )
inline

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
IDSImaging.Peak.ICV 1.3

Definition at line 420 of file Image.cs.

◆ Copy()

Image Copy ( )
inline

Creates a deep copy of the current Image.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 336 of file Image.cs.

◆ Deinterleave()

List< Image > Deinterleave ( )
inline

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.

Warning
This function is still in development and not released.
Returns
A list of images, where each element represents one of the interleaved images.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 620 of file Image.cs.

◆ Dispose()

void Dispose ( )
inline

Releases the resources used by the Image class.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 317 of file Image.cs.

◆ operator-()

static Image operator- ( Image minuend,
Image subtrahend )
inlinestatic

Performs pixel-wise subtraction of two images.

This operator performs a pixel-wise subtraction of subtrahend from minuend . Both images must have the same pixel format and dimensions.

Parameters
minuendThe image from which the subtrahend is subtracted.
subtrahendThe image to subtract from the minuend .
Returns
A new Image object representing the result of the subtraction.
Exceptions
IcvMismatchExceptionThe images have different dimensions or pixel formats.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 476 of file Image.cs.

◆ ResetRegion()

void ResetRegion ( )
inline

Resets the region on the image to the complete image.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 327 of file Image.cs.

◆ Subtract()

Image Subtract ( Image subtrahend)
inline

Subtracts the specified subtrahend image pixel-wise 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 pixel-wise subtraction.
Exceptions
IcvMismatchExceptionThrown if the images have different dimensions or pixel formats.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 448 of file Image.cs.

Property Documentation

◆ Comparer

IEqualityComparer<Image> Comparer = new ImageEqualityComparer()
staticget

Gets a default equality comparer for comparing Image data values.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 607 of file Image.cs.

◆ Data

IntPtr Data
get

Gets the image buffer from the image.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 241 of file Image.cs.

◆ Height

uint Height
get

Gets the image height in pixels from the image.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 235 of file Image.cs.

◆ Metadata

Gets or sets the metadata of the image.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 253 of file Image.cs.

◆ PixelFormat

Gets the pixel format from the image.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 217 of file Image.cs.

◆ Region

Region Region
getset

Gets or 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).

Since
IDSImaging.Peak.ICV 1.3

Definition at line 300 of file Image.cs.

◆ Size

Size Size
get

Gets the image size in pixels from the image.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 223 of file Image.cs.

◆ SizeInBytes

long SizeInBytes
get

Gets the size of the image data in bytes.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 247 of file Image.cs.

◆ Width

uint Width
get

Gets the image width in pixels from the image.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 229 of file Image.cs.