etho.services.dlp.dlp_make_warpfiles#

etho.services.dlp.dlp_make_warpfiles.create_warpfile(projection_height: int, projection_width: int, projector_dir: str)[source]#

Function to create and save a warp mesh file

Parameters
  • projection_height (int) – Height of the projection in pixels (eg. 1080).

  • projection_width (int) – Width of the projection in pixels (eg. 1920).

  • projector_dir (str) – Directory where the roi file is stored and where the warp file will be stored

Returns

warpfile – Absolute path to the created warp file. The name of the warpfile will be “warpmesh_{projection_height}x{projection_width}.data” and will be stored under projector_dir

Return type

str

etho.services.dlp.dlp_make_warpfiles.get_transformation_matrices(image_height, image_width, proj_rois)[source]#

Get transformation matrices from normalized projection coordinates to normalized image coordinates

Parameters
  • image_height (int) – Normalized height of the image (0 to 1).

  • image_width (int) – Normalized width of the image (0 to 1).

  • proj_rois (numpy.ndarray) – Normalized coordinates of the corners of the roi in the projection. Should be nb_screens x 4(corners - clockwise from top-left) x 2(coordinates: y,x)

Returns

transformation_matrices – Homography matrices which transform normalized projection coordinates to normalized image coordinates. Will be of shape nb_screensx3x3

Return type

numpy.ndarray