pysdic.Image.from_array#

classmethod Image.from_array(image_data, **kwargs)[source]#

Create an pysdic.Image object from raw image data.

Parameters:
  • image_data (ArrayLike) – The raw image data with shape (height, width) for grayscale images or (height, width, channels) for color images, with an integer or floating point dtype. The dtype is kept.

  • **kwargs – Keyword arguments of pysdic.Image (roi, ku, kv, default_value, auto_construct).

Returns:

An pysdic.Image object initialized with the provided image data.

Return type:

pysdic.Image

Examples

Create an pysdic.Image object from a numpy array of image data.

1import numpy
2from pysdic import Image
3
4image_data = numpy.random.randint(0, 256, size=(480, 640), dtype=numpy.uint8)
5image = Image.from_array(image_data, roi=(100, 50, 200, 100))