Open jt387 opened 6 years ago
应该是opencl初始化失败,import之后运行cv2.ocl.setUseOpenCL(False)试试
多谢回复, 不过试了之后还是同样的错误:
import idcard_recognize 0.3333333333333333 1280 import cv2 cv2.ocl.setUseOpenCL(False) print (idcard_recognize.process('testimages/3.jpg')) integer argument expected, got float {'error': 1}
我把process中的try catch去掉后执行,发现错误如下:
idcard_recognize.process('testimages/3.jpg') Traceback (most recent call last): File "
", line 1, in File "/home/dell/soft/idcardocr-master/idcard_recognize.py", line 14, in process idcard_img = idfind.find('idcard_mask.jpg', img_name) File "/home/dell/soft/idcardocr-master/findidcard.py", line 16, in find img1 = self.img_resize(img1, 640) File "/home/dell/soft/idcardocr-master/findidcard.py", line 92, in img_resize crop = cv2.resize(src=crop, dsize=(dwidth, height), interpolation=cv2.INTER_CUBIC) TypeError: integer argument expected, got float 可能是dwidth, height不是整数吧, 我用int()转换,还是一样的错误
你好! 安装完依赖库后在解压的源码目录下命令行执行如下: