tesserocr icon indicating copy to clipboard operation
tesserocr copied to clipboard

SetCvImage

Open mahamanoj opened this issue 8 years ago • 4 comments

Is there a way to set OpenCV images directly like the one in Python Tesseract? Opencv always comes in handy for preprocessing and it would be a waste of resources to save it to a file and read it again

mahamanoj avatar May 09 '17 13:05 mahamanoj

I haven't used OpenCV myself but I'm open for contributions if you'd like to implement it. Currently, you can just convert it into a PIL.Image object using Image.fromarray or Image.fromstring (examples here) and use tesserocr's SetImage method.

sirfz avatar May 09 '17 15:05 sirfz

Please, can you tell us how to use OpenCV instead of PIL ? With actual settings, PIL saved image produce grey pixels around characters on black-white png.

pixels

Thanks

Link009 avatar Dec 15 '17 11:12 Link009

Perhaps you're better off asking for help on StackOverflow, how to inter-change between OpenCV and PIL objects. A quick solution would be saving the image to a file and operate on it instead of a PIL object.

On a side-note, supporting OpenCV should be more-or-less similar to what I'm doing with PIL right now. I'm just not working with imaging at the moment to work on that but I hope someone else would.

sirfz avatar Dec 15 '17 13:12 sirfz

Hi

Just asked on SO: https://stackoverflow.com/questions/47833315/pil-produce-grey-pixels-in-opencv-image

How to pass a non-PIL file to tesserocr ?

Link009 avatar Dec 15 '17 13:12 Link009