functions.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:cvloop 作者: shoeffner 项目源码 文件源码
def __init__(self, hat_path=os.path.join(os.curdir, 'hat.png'),
                 cascade_path=os.path.join(
                     OPENCV_CASCADE_PATH, 'haarcascades',
                     'haarcascade_frontalface_default.xml'),
                 w_offset=1.3, x_offset=-20, y_offset=80, draw_box=False):
        # pragma pylint: disable=line-too-long
        """Initializes a `DrawHat` instance.

        Args:
            hat_path: The path to the hat file. Defaults to ./hat.png .
            cascade_path: The path to the face cascade file.
                          Defaults to
                          `cvloop.OPENCV_CASCADE_PATH/haarcascades/haarcascade_frontalface_default.xml`
            w_offset: Hat width additional scaling.
            x_offset: Number of pixels right to move hat.
            y_offset: Number of pixels down to move hat.
            draw_box: If True, draws boxes around detected faces.
        """
        # pragma pylint: enable=line-too-long
        self.w_offset = w_offset
        self.x_offset = x_offset
        self.y_offset = y_offset
        self.draw_box = draw_box

        self.cascade = cv2.CascadeClassifier(cascade_path)
        self.hat = self.load_hat(hat_path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号