EasyOCR icon indicating copy to clipboard operation
EasyOCR copied to clipboard

I'm trying to select the image using OpenCV selectROI then save it, then use the saved image for OCR but it is showing this error

Open vsatyamesc opened this issue 3 years ago • 3 comments

I'm trying to select the image using OpenCV selectROI then save it, then use the saved image for OCR but it is showing this error

Traceback (most recent call last): File "e:\Python\OCR\tempCodeRunnerFile.py", line 11, in bounds = reader.readtext("x.jpg", detail=0) File "C:\Users\lenovo\AppData\Local\Programs\Python\Python38\lib\site-packages\easyocr\easyocr.py", line 385, in readtext horizontal_list, free_list = self.detect(img, min_size, text_threshold,
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python38\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\lenovo\AppData\Local\Programs\Python\Python38\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\lenovo\AppData\Local\Programs\Python\Python38\lib\site-packages\easyocr\detection.py", line 55, in test_net boxes, polys, mapper = getDetBoxes( File "C:\Users\lenovo\AppData\Local\Programs\Python\Python38\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\lenovo\AppData\Local\Programs\Python\Python38\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

vsatyamesc avatar Mar 01 '22 06:03 vsatyamesc

https://github.com/JaidedAI/EasyOCR/issues/630 Try downgrading opencv-python to 4.5.4.60

mprusakx avatar Mar 23 '22 09:03 mprusakx

#630 Try downgrading opencv-python to 4.5.4.60

but Easy OCR isn't supporting cv 4.5.4.60 so I'm using even lower version

vsatyamesc avatar Mar 23 '22 09:03 vsatyamesc

#630 Try downgrading opencv-python to 4.5.4.60

I'm using cv headless 4.5.2.52

vsatyamesc avatar Mar 23 '22 09:03 vsatyamesc