Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教 #2

Open
jt387 opened this issue Jun 7, 2018 · 3 comments
Open

请教 #2

jt387 opened this issue Jun 7, 2018 · 3 comments

Comments

@jt387
Copy link

jt387 commented Jun 7, 2018

你好! 安装完依赖库后在解压的源码目录下命令行执行如下:

import idcard_recognize
0.3333333333333333 1280
print (idcard_recognize.process('testimages/3.jpg'))
[ INFO:0] Initialize OpenCL runtime...
integer argument expected, got float
{'error': 1}
没有其他提示, 我不知道该怎么定位错误, 请指点!多谢!

@BIGPPWONG
Copy link
Owner

应该是opencl初始化失败,import之后运行cv2.ocl.setUseOpenCL(False)试试

@jt387
Copy link
Author

jt387 commented Jun 7, 2018

多谢回复, 不过试了之后还是同样的错误:

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}

@jt387
Copy link
Author

jt387 commented Jun 7, 2018

我把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()转换,还是一样的错误

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants