![]() ![]() Tesseract also sometimes gives better results if you resize the image to twice its original size. So some deskewing might be in order if your text is recorded at an angle. (You might need to keep the picture size though, so you should replace it with white colour). What tesseract likes when detecting scanned text is removed frames, so you can try to destroy as much of non character space from the image. Or convert your image to YUV and then use just Y channel for further processing.Īlso, if you do not have a monochrome background consider performing some background substraction. ![]() Perhaps use Image.split() and rge() to binarise each colour separately and then bring them back together. ![]() Apply sharpness and contrast on the RGB image, then binarise it. I would advise you to try some PIL built-in filters like sharpness filter. In the end, the resulting C program was able to read the subtitles out of the video stream with 100% accuracy in real time. (Months later, requiring more performances, I added a varying probability matrix to test first the most likely characters). Then it would determine which rectangle was closest to the corresponding rectangle on the screen, and advance to the next one. The program would start at position (0,0), measure the average color to determine the color, then access the whole set of bitmaps generated from characters in all available fonts in that color. I only had A-Za-z0-9 and a bunch of punctuation characters to worry about. I measured the kerning width of each character. I could not detect reliably text changes to average frames and reduce the interference.the text was semitransparent, so the underlying image interfered, and it was a variable image to boot.I knew exactly which fonts and colors were going to be used.I knew exactly in which area of the screen the text was going to go.In my own, very limited scenario, it worked like a charm where several other OCR engines either failed or had unacceptable running times. I can only offer a butcher's solution, potentially a nightmare to maintain. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |