pysdic.Image.get_image_pixel_points#

Image.get_image_pixel_points(mask=None)[source]#

Create a grid of pixel points covering the entire image.

The method is equivalent to the following code:

import numpy

pixel_points = numpy.indices((height, width)).reshape(2, -1).T
pixel_points = pixel_points[mask.flatten()] # If mask is provided
pixel_points = pixel_points.astype(numpy.float64)
Parameters:

mask (Optional[ArrayLike], optional) – A boolean mask to filter the pixel points. If None, all pixel points are returned. Default is None. Shape (\(H \times W\),) or (\(H\), \(W\)) where \(H\) is the height and \(W\) is the width of the camera sensor.

Returns:

A 2D array of shape (\(N_p\), 2) where \(N_p\) is the number of pixel points in float64 dtype. Each row represents a pixel point in pixel coordinate system (row, column).

Return type:

numpy.ndarray

Raises:

ValueError – If the image is not set.