from numpy import ndarray
from willow.image import Image, RGBImageBuffer

class BaseOpenCVImage(Image):
    image: ndarray
    size: tuple[int, int]
    def __init__(self, image: ndarray, size: tuple[int, int]) -> None: ...
    @classmethod
    def check(cls) -> None: ...
    def get_size(self) -> tuple[int, int]: ...
    def get_frame_count(self) -> int: ...
    def has_alpha(self) -> bool: ...
    def has_animation(self) -> bool: ...

class OpenCVColorImage(BaseOpenCVImage):
    @classmethod
    def check(cls) -> None: ...
    @classmethod
    def from_buffer_rgb(cls, image_buffer: RGBImageBuffer) -> OpenCVColorImage: ...

class OpenCVGrayscaleImage(BaseOpenCVImage):
    face_haar_flags: int
    face_min_neighbors: int
    face_haar_scale: float
    face_min_size: tuple[int, int]
    def detect_features(self) -> list[list[float]]: ...
    def detect_faces(
        self, cascade_filename: str = "haarcascade_frontalface_alt2.xml"
    ) -> list[tuple[int, int, int, int]]: ...
    @classmethod
    def from_color(cls, colour_image: OpenCVColorImage) -> OpenCVGrayscaleImage: ...

willow_image_classes: list[type[BaseOpenCVImage]]
