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 (default: None)) – A boolean mask to filter the pixel points, with shape \((H \times W,)\) or \((H, W)\) where \(H\) and \(W\) are the height and width of the image. If None, all pixel points are returned.

Returns:

An array of shape \((N_p, 2)\) in float64 dtype. Each row represents a pixel point (row, column).

Return type:

numpy.ndarray

Raises:
  • ValueError – If the mask has a wrong shape.

  • TypeError – If the mask is not a boolean array.