OCR issue #57

Closed
opened 2026-01-29 16:34:07 +00:00 by claunia · 7 comments
Owner

Originally created by @okisseloff on GitHub (Jun 4, 2015).

Originally assigned to: @canihavesomecoffee, @Abhinav95 on GitHub.

I've found a problem with OCR feature, that causes problems with these two samples - https://github.com/CCExtractor/ccextractor/issues/172 and https://github.com/CCExtractor/ccextractor/issues/151.

I've compiled ccextractor with ocr feature and extracted png subs using -out=spupng option. pngs extracted well, but there are not enough subtitles in srt file - some of lines are missing. First thing, that strikes the eye is that there are no multi-line subs there. After that I found that some single-line subs are missing too.

Then I tried to check some of excluded from srt file png sources with tesseract cli tool if it can can recognize the text. Some of multi-line sources were recognized well, and some of them could not be recognized. More than that, lots of single-line sources could not be recognized too. Error messages appeared:

...
Error in pixReduceRankBinary2: hs must be at least 2
Error in pixDilateBrick: pixs not defined
Error in pixExpandReplicate: pixs not defined
Error in pixAnd: pixs1 not defined
Error in pixDilateBrick: pixs not defined
...

led me to tesseracts' bugtracker https://code.google.com/p/tesseract-ocr/issues/detail?id=605, where they say it is a leptonica issue.

I am not so familiar with OCR-related code in ccextractor, but probably some of you guys are.

Originally created by @okisseloff on GitHub (Jun 4, 2015). Originally assigned to: @canihavesomecoffee, @Abhinav95 on GitHub. I've found a problem with OCR feature, that causes problems with these two samples - https://github.com/CCExtractor/ccextractor/issues/172 and https://github.com/CCExtractor/ccextractor/issues/151. I've compiled ccextractor with ocr feature and extracted png subs using -out=spupng option. pngs extracted well, but there are not enough subtitles in srt file - some of lines are missing. First thing, that strikes the eye is that there are no multi-line subs there. After that I found that some single-line subs are missing too. Then I tried to check some of excluded from srt file png sources with tesseract cli tool if it can can recognize the text. Some of multi-line sources were recognized well, and some of them could not be recognized. More than that, lots of single-line sources could not be recognized too. Error messages appeared: ``` ... Error in pixReduceRankBinary2: hs must be at least 2 Error in pixDilateBrick: pixs not defined Error in pixExpandReplicate: pixs not defined Error in pixAnd: pixs1 not defined Error in pixDilateBrick: pixs not defined ... ``` led me to tesseracts' bugtracker https://code.google.com/p/tesseract-ocr/issues/detail?id=605, where they say it is a leptonica issue. I am not so familiar with OCR-related code in ccextractor, but probably some of you guys are.
Author
Owner

@canihavesomecoffee commented on GitHub (Jun 4, 2015):

The issue linked in #172 is not linked to OCR. This is regular DVB, which can be decoded (and actually is) without any OCR. Not 100% sure, but I think it also applies to #151...

@canihavesomecoffee commented on GitHub (Jun 4, 2015): The issue linked in #172 is not linked to OCR. This is regular DVB, which can be decoded (and actually is) without any OCR. Not 100% sure, but I think it also applies to #151...
Author
Owner

@okisseloff commented on GitHub (Jun 4, 2015):

@wforums, I made this conclusion about https://github.com/CCExtractor/ccextractor/issues/172, because when I compile ccextractor without ocr support, launching it with defaults produces an empty srt file. Same with second issue.

@okisseloff commented on GitHub (Jun 4, 2015): @wforums, I made this conclusion about https://github.com/CCExtractor/ccextractor/issues/172, because when I compile ccextractor without ocr support, launching it with defaults produces an empty srt file. Same with second issue.
Author
Owner

@canihavesomecoffee commented on GitHub (Jun 4, 2015):

Yeah, it looks you are right; Windows is not saying anything about DVB, while Linux complains about not having OCR...

@canihavesomecoffee commented on GitHub (Jun 4, 2015): Yeah, it looks you are right; Windows is not saying anything about DVB, while Linux complains about not having OCR...
Author
Owner

@canihavesomecoffee commented on GitHub (May 21, 2016):

Since the #605 issue of Tesseract isn't available anymore, here's an updated link (and verbatim copy below to ensure that it remains readable):
https://groups.google.com/forum/#!topic/tesseract-issues/lLoq9SZt5Po

What is the expected output? What do you see instead?

I expect something to happen. Instead I get error messages

Error in pixReduceRankBinary2: hs must be at least 2

What version of the product are you using? On what operating system?
3.01, apple os x 10.7.2


Please provide any additional information below.
$ tesseract ./p.gif .Tesseract Open Source OCR Engine v3.01 with Leptonica
Error in pixReduceRankBinary2: hs must be at least 2
Error in pixDilateBrick: pixs not defined
Error in pixExpandReplicate: pixs not defined
Error in pixAnd: pixs1 not defined
Error in pixDilateBrick: pixs not defined
Error in pixExpandReplicate: pixs not defined
Error in pixAnd: pixs2 not defined

Reply:

Error in pixReduceRankBinary2: hs must be at least 2
http://code.google.com/p/tesseract-ocr/issues/detail?id=605
This is not tesseract error message, but leptonica. Probably your leptonica  
library do not support gif...

Try programs/examples from leptonica with you image and report it at  
leptonica.

I'll see if this issue is still present in current .80

@canihavesomecoffee commented on GitHub (May 21, 2016): Since the #605 issue of Tesseract isn't available anymore, here's an updated link (and verbatim copy below to ensure that it remains readable): https://groups.google.com/forum/#!topic/tesseract-issues/lLoq9SZt5Po ``` What is the expected output? What do you see instead? I expect something to happen. Instead I get error messages Error in pixReduceRankBinary2: hs must be at least 2 What version of the product are you using? On what operating system? 3.01, apple os x 10.7.2 Please provide any additional information below. $ tesseract ./p.gif .Tesseract Open Source OCR Engine v3.01 with Leptonica Error in pixReduceRankBinary2: hs must be at least 2 Error in pixDilateBrick: pixs not defined Error in pixExpandReplicate: pixs not defined Error in pixAnd: pixs1 not defined Error in pixDilateBrick: pixs not defined Error in pixExpandReplicate: pixs not defined Error in pixAnd: pixs2 not defined ``` Reply: ``` Error in pixReduceRankBinary2: hs must be at least 2 http://code.google.com/p/tesseract-ocr/issues/detail?id=605 This is not tesseract error message, but leptonica. Probably your leptonica library do not support gif... Try programs/examples from leptonica with you image and report it at leptonica. ``` --- I'll see if this issue is still present in current .80
Author
Owner

@cfsmp3 commented on GitHub (Aug 8, 2016):

Assigned to Abhinav95 . Abhinav95 does this stuff still apply? Unsure since both bugs mentioned by Kisselef are now closed.

@cfsmp3 commented on GitHub (Aug 8, 2016): Assigned to Abhinav95 . Abhinav95 does this stuff still apply? Unsure since both bugs mentioned by Kisselef are now closed.
Author
Owner

@Abhinav95 commented on GitHub (Aug 10, 2016):

@cfsmp3 The links to the files in both the issues are currently broken.
For all the DVB samples I have encountered so far, whatever we get as the spupng output, will get an associated OCR text too. So I'm unsure if it still applies (my hunch is that it doesn't, if the stream is not corrupt).
I think we can close this till a similar sample becomes available.

@Abhinav95 commented on GitHub (Aug 10, 2016): @cfsmp3 The links to the files in both the issues are currently broken. For all the DVB samples I have encountered so far, whatever we get as the spupng output, will get an associated OCR text too. So I'm unsure if it still applies (my hunch is that it doesn't, if the stream is not corrupt). I think we can close this till a similar sample becomes available.
Author
Owner

@cfsmp3 commented on GitHub (Aug 10, 2016):

Closing for now, impossible to track this down.

@cfsmp3 commented on GitHub (Aug 10, 2016): Closing for now, impossible to track this down.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#57