Thresh_img = cv2.threshold(gray_img, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU) # Converting grey image to binary image by Thresholding Gray_img = cv2.cvtColor(images, cv2.COLOR_BGR2GRAY) Images = cv2.resize(img, (width//2, height//2)) Img = cv2.imread('input/restaurant_bill.jpg') After conversion, we can write the output text into a text file. Now finally we can convert our pre-processed image to text. Treat the image as a single text line, bypass hack by Tesseract-specific Convert Image to Text Find as much text as possible not in a particular order 12 Sparse text using OSD 13 Raw line. From the table below, you can choose the one that best suits your requirements: PSM IDs Work Description opsm Orientation and script detection (OSD) only 1 Automatic page segmentation with OSD 2 Automatic page segmentation, but not using OSD, or OCR 3 Fully automatic page segmentation, but not using OSD (Default configuration) 4 Assume a single column of text of variable sizes 5 Assume a single uniform block that has a vertically aligned text 6 Assume a single uniform block of text 7 Treat image as a single text line 8 Treat image as a single word 9 Treat image as a single word in a circle 10 Treat the image as a single character 11 Sparse text.
0 Comments
Leave a Reply. |