python3 idcardocr.py
0.3333333333333333 1280
X server found. dri2 connection failed!
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
X server found. dri2 connection failed!
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
进入身份证光学识别流程...
Traceback (most recent call last):
File "idcardocr.py", line 527, in
idocr = idcardocr(cv2.UMat(cv2.imread('./testimages/1.jpg')))
File "idcardocr.py", line 31, in idcardocr
result_dict['sex'] = get_sex(sex_pic)
File "idcardocr.py", line 310, in get_sex
return get_result_fix_length(red, 1, 'sex', '-psm 10')
File "idcardocr.py", line 423, in get_result_fix_length
result_string += pytesseract.image_to_string(cv2.UMat.get(color_img)[y:y + h, x:x + w], lang=langset, config=custom_config)
File "/home/ddc/.local/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 294, in image_to_string
return run_and_get_output(*args)
File "/home/ddc/.local/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 202, in run_and_get_output
run_tesseract(**kwargs)
File "/home/ddc/.local/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 178, in run_tesseract
raise TesseractError(status_code, get_errors(error_string))
pytesseract.pytesseract.TesseractError: (1, 'Tesseract Open Source OCR Engine v3.04.01 with Leptonica Error opening data file /usr/share/tesseract-ocr/tessdata/sex.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language \'sex\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')
python3 idcardocr.py 0.3333333333333333 1280 X server found. dri2 connection failed! DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 X server found. dri2 connection failed! DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware (If you have multiple ICDs installed and OpenCL works, you can ignore this message) 进入身份证光学识别流程... Traceback (most recent call last): File "idcardocr.py", line 527, in
idocr = idcardocr(cv2.UMat(cv2.imread('./testimages/1.jpg')))
File "idcardocr.py", line 31, in idcardocr
result_dict['sex'] = get_sex(sex_pic)
File "idcardocr.py", line 310, in get_sex
return get_result_fix_length(red, 1, 'sex', '-psm 10')
File "idcardocr.py", line 423, in get_result_fix_length
result_string += pytesseract.image_to_string(cv2.UMat.get(color_img)[y:y + h, x:x + w], lang=langset, config=custom_config)
File "/home/ddc/.local/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 294, in image_to_string
return run_and_get_output(*args)
File "/home/ddc/.local/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 202, in run_and_get_output
run_tesseract(**kwargs)
File "/home/ddc/.local/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 178, in run_tesseract
raise TesseractError(status_code, get_errors(error_string))
pytesseract.pytesseract.TesseractError: (1, 'Tesseract Open Source OCR Engine v3.04.01 with Leptonica Error opening data file /usr/share/tesseract-ocr/tessdata/sex.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language \'sex\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')