wed.chaptors.rotating_face module

This submodule contains a set of functions for editing the following image:

_images/rotating-face.png
class wed.chaptors.rotating_face.RotatingFaceEditor(face_left_image_path: str = '/Users/iwasakishuto/Github/portfolio/Wed-Downtown-OP/data/materials/rotating-face-left.png', face_right_image_path: str = '/Users/iwasakishuto/Github/portfolio/Wed-Downtown-OP/data/materials/rotating-face-right.png', dsize: Tuple[int, int] = (200, 200), margin: int = 20)[source]

Bases: wed.chaptors.base_editor.BaseWedOPEditor

Editor which in charge of editing rotating rectangle.

_images/rotating-face.png

Args:

resize_faces(dsize: Tuple[int, int] = (200, 200), margin: int = 20)[source]
set_face_boxes(margin: int = 20)[source]
edit(frame: numpy.ndarray[Any, numpy.dtype[numpy.uint8]], pos: int)numpy.ndarray[Any, numpy.dtype[numpy.uint8]][source]

Edit the image if it is an assigned chapter (pos)

Parameters
  • frame (npt.NDArray[np.uint8]) – Current frame (BGR image) in the video.

  • pos (int) – Current position in the video.

Returns

Edited frame.

Return type

npt.NDArray[np.uint8]

paste_faces(frame: numpy.ndarray[Any, numpy.dtype[numpy.uint8]], pos: int)numpy.ndarray[Any, numpy.dtype[numpy.uint8]][source]

Paste two rotating faces.

Parameters
  • frame (npt.NDArray[np.uint8]) – Current frame (BGR image) in the video.

  • pos (int) – Current position in the video.

Returns

Edited frame.

Return type

npt.NDArray[np.uint8]