dictionary.py 文件源码

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

项目:BAR4Py 作者: bxtkezhan 项目源码 文件源码
def poolFrame(self, frame, pool_size=(28, 28)):
        '''
        frame is OpenCV image frame
        return pooled frame
        '''
        if len(frame.shape) == 2:
            gray_frame = frame
        else:
            gray_frame = bgr2gray(frame)
        pool_frame = cv2.resize(gray_frame, pool_size)
        _, pool_frame = cv2.threshold(pool_frame, pool_frame.mean(), 1, cv2.THRESH_OTSU)
        return pool_frame
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号