Open narolski opened 3 years ago
An error:
error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
occurs when an empty image is passed to the cv2.cvtColor(image, cv2.COLOR_BGR2RGB) method in keras_ocr.tools.
image
cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
keras_ocr.tools
It might be worth to handle such a case better, for instance:
image = cv2.imread(image_path) if np.shape(image) == (): return image return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
An error:
occurs when an empty
image
is passed to thecv2.cvtColor(image, cv2.COLOR_BGR2RGB)
method inkeras_ocr.tools
.It might be worth to handle such a case better, for instance: