error when reading an png
See original GitHub issueTraceback (most recent call last):
File "testocr.py", line 5, in <module>
result = reader.readtext('1.png')
File "C:\Users\karl\Desktop\test\venv\lib\site-packages\easyocr\easyocr.py", line 385, in readtext
horizontal_list, free_list = self.detect(img, min_size, text_threshold,\
File "C:\Users\karl\Desktop\test\venv\lib\site-packages\easyocr\easyocr.py", line 275, in detect
text_box_list = get_textbox(self.detector, img, canvas_size, mag_ratio,
File "C:\Users\karl\Desktop\test\venv\lib\site-packages\easyocr\detection.py", line 95, in get_textbox
bboxes_list, polys_list = test_net(canvas_size, mag_ratio, detector,
File "C:\Users\karl\Desktop\test\venv\lib\site-packages\easyocr\detection.py", line 55, in test_net
boxes, polys, mapper = getDetBoxes(
File "C:\Users\karl\Desktop\test\venv\lib\site-packages\easyocr\craft_utils.py", line 236, in getDetBoxes
boxes, labels, mapper = getDetBoxes_core(textmap, linkmap, text_threshold, link_threshold, low_text, estimate_num_chars)
File "C:\Users\karl\Desktop\test\venv\lib\site-packages\easyocr\craft_utils.py", line 31, in getDetBoxes_core
nLabels, labels, stats, centroids = cv2.connectedComponentsWithStats(text_score_comb.astype(np.uint8), connectivity=4)
cv2.error: Unknown C++ exception from OpenCV code
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
exception: I/O error reading PNG header! for image reading size
PS: Checked the source code PNGImageReader , and it seems that the PNG is corrupted. You should get more info from the stack...
Read more >Fatal error reading PNG image file: Not a PNG file - Reddit
r/pop_os - Fatal error reading PNG image file: Not a PNG file ... The png file is corrupted and unreadable.
Read more >Error reading PNG image data - Usage & Issues
Hello everyone, I created an ImageJ macro for enhancing the histrogram of all “raw” images in a directory and saving the enhanced images ......
Read more >14 I/O error reading PNG header - Tess4J - SourceForge
It works fine if I give JPG or BMP image as a input. But it is showing error while reading the PNG format...
Read more >Error when trying to view .png files: "windows photo viewer
a. Right click on .png file of the picture and select Open With and click Change Default program. b.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@MicalKarl solved this problem by opencv-python-headless и opencv-python of version 4.5.1.48
I was getting the same issue (which hadn’t happened before, I have no idea how this broke out of nowhere)
Fixed it with the
pip install opencv-python-headless==4.5.1.48
@Aslyamovt mentioned and was changed in https://github.com/xuyichenmo/EasyOCR/commit/3333f241349ddaf45477cc1bcda768da56d338dd