
Public Member Functions | |
| Image | create_from_pixel_format_and_size (cls, PixelFormat pixel_format, Size size) |
| Creates an instance of Image using a size.Size and a pixel format. | |
| Image | create_from_ids_peak_ipl_image (cls, ids_peak_ipl.Image ids_peak_ipl_image) |
| Creates an instance of Image using a ids_peak_ipl image. | |
| Image | create_from_np_array (cls, PixelFormat pixel_format, Size size, np.ndarray data) |
| Creates an instance of Image using a PixelFormat, size.Size and numpy image buffer. | |
| Image | create_from_file (cls, str image_path, PixelFormat|None forced_pixel_format=None) |
| Creates an Image from a file path. | |
| Image | create_from_image_view (cls, IImageView image_view) |
| Creates an instance of Image using an IImageView interface. | |
| None | __init__ (self, *Any args, **Any kwargs) |
| In order to create an Image, please refer to the classmethods. | |
| None | __del__ (self) |
| Destructor for Image class. | |
| None | save (self, str output_file_path) |
| Saves the image to a file. | |
| Size | size (self) |
| Provides the size.Size of the image. | |
| int | width (self) |
| Provides the width of the image. | |
| int | height (self) |
| Provides the height of the image. | |
| np.ndarray | to_numpy_array (self, bool copy=True) |
| Provides a numpy representation of the image. | |
| Image | convert_pixel_format (self, PixelFormat pixel_format) |
| Converts the image to a different pixel format. | |
| Image | convert_pixel_format_with_factor (self, PixelFormat pixel_format, float factor) |
| Converts an image into another pixel format with a factor multiplied to every pixel. | |
| Region | region (self) |
| Retrieves the region.Region associated with the specified image_handle. | |
| None | region (self, Region region) |
| Updates the region.Region on the image. | |
| None | reset_region (self) |
| Resets the region.Region on the image to the complete image. | |
| Metadata | metadata (self) |
| Retrieves the metadata.Metadata of an image which contains information about the image capture settings. | |
| None | metadata (self, Metadata metadata) |
| Updates the metadata.Metadata of an image which is used to store and manage capture settings. | |
| Image | subtract (self, Image subtrahend) |
| Subtracts the specified subtrahend image pixelwise from the current image and returns the resulting image. | |
| List[Image] | deinterleave (self) |
| Splits an image with an interleaved pixel format into individual images. | |
| Image | copy (self) |
| Image | __sub__ (self, Image subtrahend) |
| Subtracts the specified subtrahend image pixelwise from the current image and returns the resulting image. | |
| bool | __eq__ (self, object other) |
| PixelFormat | pixel_format (self) |
Data Fields | |
| Size | _handle = other.size: |
Protected Member Functions | |
| Image | _create_from_pixel_format_size_and_zero_init (cls, PixelFormat pixel_format, Size size, bool zero_init) |
| Image | _create_from_np_array (cls, PixelFormat pixel_format, Size size, np.ndarray data) |
Protected Attributes | |
| _handle | |
| Metadata|None | _metadata = None |
| _pixel_format = PixelFormat(image_info.pixel_format) | |
| _size = Size(image_info.size.width, image_info.size.height) | |
| str | _ids_peak_ipl_image = kwargs["_ids_peak_ipl_image"] if "_ids_peak_ipl_image" in kwargs else None |
| _raw_data = None | |
Static Protected Attributes | |
| np | _data .ndarray |
Image Class for working with algorithms.
| None __init__ | ( | self, | |
| *Any | args, | ||
| **Any | kwargs ) |
In order to create an Image, please refer to the classmethods.
Reimplemented in UndistortedImage, and XYZImage.
| None __del__ | ( | self | ) |
Destructor for Image class.
| bool __eq__ | ( | self, | |
| object | other ) |
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.
| subtrahend | The image to subtract from the current image. |
|
protected |
|
protected |
| Image convert_pixel_format | ( | self, | |
| PixelFormat | pixel_format ) |
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:
| pixel_format | The target pixel format. |
| Image convert_pixel_format_with_factor | ( | self, | |
| PixelFormat | pixel_format, | ||
| float | factor ) |
Converts an image into another pixel format with a factor multiplied to every pixel.
Supported conversions: From PixelFormat::Coord3D_C8 or PixelFormat::Coord3D_C16 to PixelFormat::Coord3D_C32f
| pixel_format | The target pixel format. |
| factor | The multiplication factor. |
| Image copy | ( | self | ) |
| Image create_from_file | ( | cls, | |
| str | image_path, | ||
| PixelFormat | None | forced_pixel_format = None ) |
Creates an Image from a file path.
This method loads an image from the given file path.
If a PixelFormat is provided via forced_pixel_format, the method attempts to interpret the file using that format. If interpretation fails, an exception is raised. Explicit conversion between image formats must be handled manually by the user.
The following image formats are supported:
forced_pixel_format is specified)forced_pixel_format is specified)
|
|
|
|
|
|
|
If forced_pixel_format is None any raw image can be loaded.
If forced_pixel_format is specified, only the following formats are supported and must match the format used when saving:
|
|
|
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
| image_path | File path on disk, pointing to an image. |
| forced_pixel_format | Pixel format the loaded image is forced to use. |
| Image create_from_ids_peak_ipl_image | ( | cls, | |
| ids_peak_ipl.Image | ids_peak_ipl_image ) |
Creates an instance of Image using a ids_peak_ipl image.
| ids_peak_ipl_image | ids_peak_ipl image |
| Image create_from_image_view | ( | cls, | |
| IImageView | image_view ) |
Creates an instance of Image using an IImageView interface.
| image_view | An object implementing the IImageView interface, which can be constructed from a buffer provided by a camera. |
Image instance created from the given image view.| Image create_from_np_array | ( | cls, | |
| PixelFormat | pixel_format, | ||
| Size | size, | ||
| np.ndarray | data ) |
Creates an instance of Image using a PixelFormat, size.Size and numpy image buffer.
| pixel_format | Pixel format of the image |
| size | Image size in pixels |
| data | Numpy array holding the buffer data |
| OutOfRangeException | If the input array is 2D and the expected number of channels is not 1, or if it is 3D and the channel count does not match, or if it has a number of dimensions other than 2 or 3. |
| Image create_from_pixel_format_and_size | ( | cls, | |
| PixelFormat | pixel_format, | ||
| Size | size ) |
Creates an instance of Image using a size.Size and a pixel format.
| size | Image size in pixels |
| pixel_format | Pixel format of the image |
| List[Image] deinterleave | ( | self | ) |
Splits an image with an interleaved pixel format into individual images.
The function separates e.g. multiple exposures or gains embedded in the combined HDR raw image and provides them as independent images, each with the correctly associated exposure information.
|
|
|
|
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
| int height | ( | self | ) |
| Metadata metadata | ( | self | ) |
Retrieves the metadata.Metadata of an image which contains information about the image capture settings.
The retrieved metadata object is a reference to the image metadata, meaning that changes within the metadata object will result in changes within the metadata of the image.
| None metadata | ( | self, | |
| Metadata | metadata ) |
Updates the metadata.Metadata of an image which is used to store and manage capture settings.
| metadata | The metadata to be updated. |
| PixelFormat pixel_format | ( | self | ) |
| Region region | ( | self | ) |
Retrieves the region.Region associated with the specified image_handle.
| None region | ( | self, | |
| Region | region ) |
Updates the region.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).
| region | The region to be set. |
| None reset_region | ( | self | ) |
Resets the region.Region on the image to the complete image.
| None save | ( | self, | |
| str | output_file_path ) |
Saves the image to a file.
The file format is determined by the specified file extension of the file name.
Supported image formats (with required file extensions):
Compression settings:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
| output_file_path | The path of the file to store the image to disk. |
| Size size | ( | self | ) |
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.
| subtrahend | The image to subtract from the current image. |
| np.ndarray to_numpy_array | ( | self, | |
| bool | copy = True ) |
Provides a numpy representation of the image.
Note that the image is copied by default and the caller must not take care of the original Instance being still available.
| copy | True: The image is copied, False: The image only references the internal memory. |
| int width | ( | self | ) |
|
staticprotected |
|
protected |
| Size _handle = other.size: |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |