rotate_image

laserbeamsize.image_tools.rotate_image(original: ndarray, x0: float, y0: float, phi: float) ndarray[source]

Create image rotated about specified centerpoint.

The image is rotated about a centerpoint (x0, y0) and then cropped to the original size such that the centerpoint remains in the same location.

Parameters:
  • original – the image to work with

  • x0 – column

  • y0 – row

  • phi – angle [radians]

Returns:

image – rotated 2D array with same dimensions as original