Thanks ger. I found DefaultPageSegMode (this in the c# tessearct package - not tried C++ yet, though I don't see to need to). That worked fine.
Iain On Monday, July 15, 2024 at 3:34:02 PM UTC+1 [email protected] wrote: > A true Python coder would not ever use a terribly written library like > pytesseract in the first place. The way of passing command line params is a > minor thing, compared to that. > > On Monday, July 15, 2024 at 4:12:24 PM UTC+2 zdenop wrote: > >> Code that was posted here is not dangerous. Just a python coder would >> make it the right way. >> >> >> Zdenko >> >> >> po 15. 7. 2024 o 16:09 Mona Dastar <[email protected]> napísal(a): >> >>> Hi everyone >>> Regarding what Zdenko said, after the first section of module 3 I >>> stopped because I had questions and I couldn’t understand the code, I have >>> trouble with the last module what do you think? >>> Since that I didn’t study and I am getting farther and further away. >>> I appreciate your tips. >>> >>> >>> On Mon, 15 Jul 2024 at 10:03 Zdenko Podobny <[email protected]> wrote: >>> >>>> My remark is about code quality. Code quality is relevant. Or >>>> indication that somebody is doing copy&paste without understanding code - >>>> that is dangerous. >>>> >>>> >>>> Zdenko >>>> >>>> >>>> po 15. 7. 2024 o 12:30 René JM Clais <[email protected]> napísal(a): >>>> >>>>> My code is working well and your remarks are out of the context. >>>>> >>>>> Le dim. 14 juil. 2024 à 19:47, Zdenko Podobny <[email protected]> a >>>>> écrit : >>>>> >>>>>> So you do not understand the code you posted? >>>>>> >>>>>> Zdenko >>>>>> >>>>>> >>>>>> ne 14. 7. 2024 o 19:44 René JM Clais <[email protected]> napísal(a): >>>>>> >>>>>>> I don't understand what do you mean ? >>>>>>> >>>>>>> Le dim. 14 juil. 2024 à 16:13, Zdenko Podobny <[email protected]> a >>>>>>> écrit : >>>>>>> >>>>>>>> custom_config = r' -l ' + 'eng' + ' --psm 6 >>>>>>>> >>>>>>>> >>>>>>>> What is the point of this? To slow down the script? >>>>>>>> >>>>>>>> Zdenko >>>>>>>> >>>>>>>> >>>>>>>> ne 14. 7. 2024 o 15:56 René JM Clais <[email protected]> >>>>>>>> napísal(a): >>>>>>>> >>>>>>>>> import cv2 >>>>>>>>> import pytesseract as tesser >>>>>>>>> >>>>>>>>> >>>>>>>>> originalImage = cv2.imread("myfile.jpg") #myfile.jpg ===> >>>>>>>>> original image >>>>>>>>> >>>>>>>>> (thresh, imgbw) = cv2.threshold(originalImage,180,255, >>>>>>>>> cv2.THRESH_BINARY) # black and white >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> cv2.imshow('Black white image', imgbw) >>>>>>>>> cv2.waitKey(0) #make enter >>>>>>>>> cv2.destroyAllWindows() >>>>>>>>> >>>>>>>>> #tesseract transformation >>>>>>>>> # >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> custom_config = r' -l ' + 'eng' + ' --psm 6 ' >>>>>>>>> >>>>>>>>> >>>>>>>>> text= tesser.image_to_string(imgbw,config=custom_config ) >>>>>>>>> print(text) #the text >>>>>>>>> >>>>>>>>> >>>>>>>>> Le sam. 13 juil. 2024 à 18:26, Iain Downs <[email protected]> a >>>>>>>>> écrit : >>>>>>>>> >>>>>>>>>> Can you give me some example code? I'm currently trying to get >>>>>>>>>> tesseract working for C++ in Visual Studio and it's a bit of a >>>>>>>>>> nightmare. >>>>>>>>>> python seems easier though it's not one of my main languages - I can >>>>>>>>>> try it >>>>>>>>>> out though! >>>>>>>>>> >>>>>>>>>> Iain >>>>>>>>>> >>>>>>>>>> On Saturday, July 13, 2024 at 11:20:54 AM UTC+1 >>>>>>>>>> [email protected] wrote: >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> I try your example with tesseract for python - it works well >>>>>>>>>>> >>>>>>>>>>> Le jeu. 11 juil. 2024 à 20:35, Iain Downs <[email protected]> a >>>>>>>>>>> écrit : >>>>>>>>>>> >>>>>>>>>>>> I'm trying to extract page numbers from scanned pages of text. >>>>>>>>>>>> Page Numbers are either at the top or at the bottom - sometimes >>>>>>>>>>>> with titles >>>>>>>>>>>> / authors / chapters. Occasionally elsewhere, but I don't care >>>>>>>>>>>> about the >>>>>>>>>>>> exceptions. >>>>>>>>>>>> >>>>>>>>>>>> I've loaded tesseract 5.4 (windows) and run some tests using >>>>>>>>>>>> the executable. I'm finding that if the page number is a single >>>>>>>>>>>> digit on >>>>>>>>>>>> the line, tesseract ignores it (but otherwise does a fantastic job >>>>>>>>>>>> of OCR >>>>>>>>>>>> even with skewed and noisy images). >>>>>>>>>>>> >>>>>>>>>>>> I've isolated the single line used that as input and tesseract >>>>>>>>>>>> tells me 'the page is empty'. >>>>>>>>>>>> >>>>>>>>>>>> Here is a sample of a single line with a '1' in it resolution >>>>>>>>>>>> is 300dpi. >>>>>>>>>>>> [image: 101_bottom.jpg] >>>>>>>>>>>> >>>>>>>>>>>> Ultimately I would be writing a program using tesseract, but in >>>>>>>>>>>> the first instance I'd like to see it work with the exe. >>>>>>>>>>>> >>>>>>>>>>>> So, can I tell tesseract to be less fussy with individual >>>>>>>>>>>> characters and if not how would I do so programatically - if >>>>>>>>>>>> possible? >>>>>>>>>>>> >>>>>>>>>>>> Thanks >>>>>>>>>>>> >>>>>>>>>>>> Iain >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>> Google Groups "tesseract-ocr" group. >>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from >>>>>>>>>>>> it, send an email to [email protected]. >>>>>>>>>>>> To view this discussion on the web visit >>>>>>>>>>>> https://groups.google.com/d/msgid/tesseract-ocr/c42d435c-4db5-48b5-94d3-5b761d340731n%40googlegroups.com >>>>>>>>>>>> >>>>>>>>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/c42d435c-4db5-48b5-94d3-5b761d340731n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>>>>>> . >>>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>> Google Groups "tesseract-ocr" group. >>>>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>>>> send an email to [email protected]. >>>>>>>>>> To view this discussion on the web visit >>>>>>>>>> https://groups.google.com/d/msgid/tesseract-ocr/2e56b599-4dcf-4b93-8e1b-40a57b36d3e9n%40googlegroups.com >>>>>>>>>> >>>>>>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/2e56b599-4dcf-4b93-8e1b-40a57b36d3e9n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>>>> . >>>>>>>>>> >>>>>>>>> -- >>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>> Groups "tesseract-ocr" group. >>>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>>> send an email to [email protected]. >>>>>>>>> To view this discussion on the web visit >>>>>>>>> https://groups.google.com/d/msgid/tesseract-ocr/CAPJAo_qXNcQyuQYBTVdkx1kLYnVpLJJQ-1a%3DwM7SBCcJsmANvw%40mail.gmail.com >>>>>>>>> >>>>>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/CAPJAo_qXNcQyuQYBTVdkx1kLYnVpLJJQ-1a%3DwM7SBCcJsmANvw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>>>>>> . >>>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "tesseract-ocr" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to [email protected]. >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8wgH%2Bt4ZCs_nE0zoPtmwT6gzmRcF5YDZsJrZBAoghSdmA%40mail.gmail.com >>>>>>>> >>>>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8wgH%2Bt4ZCs_nE0zoPtmwT6gzmRcF5YDZsJrZBAoghSdmA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>>>>> . >>>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "tesseract-ocr" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to [email protected]. >>>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msgid/tesseract-ocr/CAPJAo_qX3dFGnKRZ0UN4Aqq0%2BU-Vzm1hyn6qhYzLDuNn0T9bjw%40mail.gmail.com >>>>>>> >>>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/CAPJAo_qX3dFGnKRZ0UN4Aqq0%2BU-Vzm1hyn6qhYzLDuNn0T9bjw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>>>> . >>>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "tesseract-ocr" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to [email protected]. >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8yQ6N5o3Nav32_b7t72UrmAaKyASUKDj40mDWBVdMS_ww%40mail.gmail.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8yQ6N5o3Nav32_b7t72UrmAaKyASUKDj40mDWBVdMS_ww%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "tesseract-ocr" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/tesseract-ocr/CAPJAo_rj%3DSqNfs3PquEmZZEk8gye8j%2Be3Tw9A_69PyBNPfyBDw%40mail.gmail.com >>>>> >>>>> <https://groups.google.com/d/msgid/tesseract-ocr/CAPJAo_rj%3DSqNfs3PquEmZZEk8gye8j%2Be3Tw9A_69PyBNPfyBDw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "tesseract-ocr" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8yry14vEULwnCG59FCxC-UK-9KyQjwT5H26NMvy3fmKmg%40mail.gmail.com >>>> >>>> <https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8yry14vEULwnCG59FCxC-UK-9KyQjwT5H26NMvy3fmKmg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "tesseract-ocr" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> >> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/tesseract-ocr/CACDAmMv84rXbpoChtBPfz1ekaoP%2BRQWLQBWX%2BA2Y8xCyS%2Bx5LA%40mail.gmail.com >>> >>> <https://groups.google.com/d/msgid/tesseract-ocr/CACDAmMv84rXbpoChtBPfz1ekaoP%2BRQWLQBWX%2BA2Y8xCyS%2Bx5LA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/c2d97d9d-f6c9-4803-ad5d-249e03fd6b6bn%40googlegroups.com.

