tolmdb.py 文件源码

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

项目:crnn 作者: wulivicte 项目源码 文件源码
def checkImageIsValid(imageBin):
    if imageBin is None:
        return False
    try:
        imageBuf = np.fromstring(imageBin, dtype=np.uint8)
        img = cv2.imdecode(imageBuf, cv2.IMREAD_GRAYSCALE)
        imgH, imgW = img.shape[0], img.shape[1]
    except:
        return False
    else:
        if imgH * imgW == 0:
            return False        
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号