def METHOD_NAME(self, x, gs_area, gs_coords, shape):
    gs_size = int(np.sqrt(gs_area))
    patch_coords = shape_coords(gs_size, gs_size, shape)
    h, _ = cv2.findHomography(patch_coords, gs_coords)
    inscribed_patch_mask = create_mask(shape, gs_size, gs_size)
    img_mask = cv2.warpPerspective(
        inscribed_patch_mask, h, (x.shape[1], x.shape[0]), cv2.INTER_CUBIC
    )
    return img_mask