EasyOCR
EasyOCR copied to clipboard
Cannot process high bit-depth grayscale numpy array
Where you convert from a grayscale numpy array to a cv2 image https://github.com/JaidedAI/EasyOCR/blob/b7ddee30c6a02f7643fc2ac52b6da84263752f92/easyocr/utils.py#L709 cv2 gives an error for high bit-depth images
> Unsupported depth of input image:
> 'VDepth::contains(depth)'
> where
> 'depth' is 4 (CV_32S)
I have solved it in my code using
numpy.divide(img, (img.max()+256)/256).astype(numpy.uint8)
Do you think that's the best approach, or should it be handled inside easyocr, or is it really a bug in cv2 ?