Audiveris / audiveris

Latest generation of Audiveris OMR engine
https://audiveris.github.io/audiveris
GNU Affero General Public License v3.0
1.52k stars 227 forks source link

NullPointerException (From Tesseract?) in TEXT step, both in pre-packaged and 'git installed' version #411

Closed jcjveraa closed 4 years ago

jcjveraa commented 4 years ago

Hi there, Note that I have first show a non-working case (input file + logs), and at the bottom of this issue I also show a case which is working fine. I would expect both to fail or both to work.

I'm getting the issue below when trying to parse this image, at the TEXT step. It happens with this piece specifically - some others (more simple) have worked fine. When I try to parse the full score (not just this snippet), I get a specific 'Tesseract error', with the shorter input file posted below it still fails in the same point but without the Tesseract error. WARN [output] TesseractOrder 182 | Error in Tesseract recognize, exit code: -1

I have used the pre-packaged Windows installer and a 'manually installed' version from git with manual install of Tesseract and both fail at the same point with the same image input. As far as I see this is not a copy of an earlier issue/my install 'should work' (as I get identical results with the pre-packaged version and the 'git installed' version).

Input file output-ext

Dump from pre-packaged version

INFO  []                      Main 334  | Environment:
- Audiveris:    5.1.0:4687c3527
- OS:           Windows 10 10.0
- Architecture: amd64
- Java VM:      Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
- OCR Engine:   Tesseract OCR, version 3.04.01
INFO  []                       CLI 217  | CLI args: []
INFO  []             AliasPatterns 128  | Alias patterns: [(IMSLP[0-9]*)-.*]
INFO  []                   MainGui 499  | Audiveris version 5.1.0
INFO  []                   MainGui 500  |
LogUtil. Property logback.configurationFile not defined, skipped.
LogUtil. No C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\config\logback.xml, skipped.
LogUtil. Configuration found jar:file:/C:/Program%20Files/Audiveris/lib/audiveris.jar!/res/logback.xml
LogUtil. Logging to C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\log\20200715T204207.log

INFO  []            PluginsManager 235  | No C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\config\plugins.xml file found
INFO  []           BasicClassifier 362  | Classifier loaded XML norms.
INFO  []        AbstractClassifier 348  | Classifier data loaded from default uri jar:file:/C:/Program%20Files/Audiveris/lib/audiveris.jar!/res/basic-classifier.zip
INFO  [output-ext]                      Book 473  | 1 sheet in C:\Users\jcjve\Documents\Audiveris\output\output-ext.png
INFO  [output-ext]                      Book 1226 | Loaded image 1 1706x438 from C:\Users\jcjve\Documents\Audiveris\output\output-ext.png
INFO  [output-ext]                      Book 1327 | Book reaching PAGE on sheets:[#1]
INFO  [output-ext]              ScaleBuilder 557  | Second combo peak too different (109,109,109), ignored
INFO  [output-ext]              ScaleBuilder 492  | Beam minHeight:5 maxHeight:16 quorum:386
INFO  [output-ext]              ScaleBuilder 235  | No beam key found, guessed value: 10
INFO  [output-ext]                 ScaleStep 84   | Scale{line(2,2,2) interline(18,18,18) beam(10 extra)}
INFO  [output-ext]            LinesRetriever 447  | Global slope: 0.00000
INFO  [output-ext]         ClustersRetriever 235  | Retrieved line clusters: 2 of size: 5 with interline: interline(18,18,18)
INFO  [output-ext]                 PeakGraph 177  | Systems: #1[1, 2]
INFO  [output-ext]             SystemManager 731  | 1 part along 1 system
INFO  [output-ext]             StemSeedsStep 93   | stem(3 max:4)
INFO  [output-ext]            BlackHeadSizer 95   | Spots black-head retrieval diameter: 16.2
INFO  [output-ext]            BlackHeadSizer 243  | Core black head count: 13 blackHead(width:23.7~0.5 height:20.4~0.5)
INFO  [output-ext]            BlackHeadSizer 248  | MusicFont{name:MusicalSymbols pointSize:79}
WARN  [output-ext]                 SheetStub 845  | Error in performing [SCALE, GRID, HEADERS, STEM_SEEDS, BEAMS, LEDGERS, HEADS, STEMS, REDUCTION, CUE_BEAMS, TEXTS, MEASURES, CHORDS, CURVES, SYMBOLS, LINKS, RHYTHMS, PAGE] java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.audiveris.omr.sheet.SheetStub.doOneStep(SheetStub.java:1111)
        at org.audiveris.omr.sheet.SheetStub.reachStep(SheetStub.java:832)
        at org.audiveris.omr.sheet.Book.reachBookStep(Book.java:1393)
        at org.audiveris.omr.sheet.Book.transcribe(Book.java:1718)
        at org.audiveris.omr.sheet.ui.BookActions$TranscribeBookTask.doInBackground(BookActions.java:2057)
        at org.audiveris.omr.sheet.ui.BookActions$TranscribeBookTask.doInBackground(BookActions.java:2037)
        at javax.swing.SwingWorker$1.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at javax.swing.SwingWorker.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
        at org.audiveris.omr.step.AbstractSystemStep.doitPerSystem(AbstractSystemStep.java:221)
        at org.audiveris.omr.step.AbstractSystemStep.doit(AbstractSystemStep.java:101)
        at org.audiveris.omr.step.Step.doit(Step.java:184)
        at org.audiveris.omr.sheet.SheetStub$4.call(SheetStub.java:1101)
        at org.audiveris.omr.sheet.SheetStub$4.call(SheetStub.java:1089)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        ... 3 common frames omitted
Caused by: java.lang.NullPointerException: null
        at java.awt.Rectangle.intersects(Unknown Source)
        at org.audiveris.omr.text.TextBuilder.retrieveSystemLines(TextBuilder.java:227)
        at org.audiveris.omr.text.TextsStep.doSystem(TextsStep.java:64)
        at org.audiveris.omr.text.TextsStep.doSystem(TextsStep.java:42)
        at org.audiveris.omr.step.AbstractSystemStep$1.call(AbstractSystemStep.java:193)
        at org.audiveris.omr.step.AbstractSystemStep$1.call(AbstractSystemStep.java:176)
        at org.audiveris.omr.step.AbstractSystemStep.doitPerSystem(AbstractSystemStep.java:214)
        ... 8 common frames omitted
INFO  [output-ext]                      Book 1451 | Scores built: 1

Dump from git-installed version

$ ./gradlew run
targetOS=windows-x86_64
:git_build
:generateProgramId
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:run
INFO  []                      Main 334  | Environment:
- Audiveris:    5.1.1:5e15ef8ca
- OS:           Windows 10 10.0
- Architecture: amd64
- Java VM:      Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
- OCR Engine:   Tesseract OCR, version 3.04.01
INFO  []                       CLI 217  | CLI args: []
INFO  []             AliasPatterns 128  | Alias patterns: [(IMSLP[0-9]*)-.*]
INFO  []                   MainGui 499  | Audiveris version 5.1.1
INFO  []                   MainGui 500  |
LogUtil. Property logback.configurationFile not defined, skipped.
LogUtil. No C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\config\logback.xml, skipped.
LogUtil. Configuration found file:///C:/Users/jcjve/Downloads/audiveris/res/logback.xml
LogUtil. Logging to C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\log\20200715T204950.log

INFO  []            PluginsManager 235  | No C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\config\plugins.xml file found
INFO  []           BasicClassifier 362  | Classifier loaded XML norms.
INFO  []        AbstractClassifier 348  | Classifier data loaded from default uri file:///C:/Users/jcjve/Downloads/audiveris/res/basic-classifier.zip
INFO  [output-ext]                      Book 473  | 1 sheet in C:\Users\jcjve\Documents\Audiveris\output\output-ext.png
INFO  [output-ext]                      Book 1226 | Loaded image 1 1706x438 from C:\Users\jcjve\Documents\Audiveris\output\output-ext.png
INFO  [output-ext]                      Book 1327 | Book reaching PAGE on sheets:[#1]
INFO  [output-ext]              ScaleBuilder 557  | Second combo peak too different (109,109,109), ignored
INFO  [output-ext]              ScaleBuilder 492  | Beam minHeight:5 maxHeight:16 quorum:386
INFO  [output-ext]              ScaleBuilder 235  | No beam key found, guessed value: 10
INFO  [output-ext]                 ScaleStep 84   | Scale{line(2,2,2) interline(18,18,18) beam(10 extra)}
INFO  [output-ext]            LinesRetriever 447  | Global slope: 0.00000
INFO  [output-ext]         ClustersRetriever 235  | Retrieved line clusters: 2 of size: 5 with interline: interline(18,18,18)
INFO  [output-ext]                 PeakGraph 177  | Systems: #1[1, 2]
INFO  [output-ext]             SystemManager 731  | 1 part along 1 system
INFO  [output-ext]             StemSeedsStep 93   | stem(3 max:4)
INFO  [output-ext]            BlackHeadSizer 95   | Spots black-head retrieval diameter: 16.2
INFO  [output-ext]            BlackHeadSizer 243  | Core black head count: 13 blackHead(width:23.7~0.5 height:20.4~0.5)
INFO  [output-ext]            BlackHeadSizer 248  | MusicFont{name:MusicalSymbols pointSize:79}
WARN  [output-ext]                 SheetStub 845  | Error in performing [SCALE, GRID, HEADERS, STEM_SEEDS, BEAMS, LEDGERS, HEADS, STEMS, REDUCTION, CUE_BEAMS, TEXTS, MEASURES, CHORDS, CURVES, SYMBOLS, LINKS, RHYTHMS, PAGE] java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)
        at org.audiveris.omr.sheet.SheetStub.doOneStep(SheetStub.java:1111)
        at org.audiveris.omr.sheet.SheetStub.reachStep(SheetStub.java:832)
        at org.audiveris.omr.sheet.Book.reachBookStep(Book.java:1393)
        at org.audiveris.omr.sheet.Book.transcribe(Book.java:1718)
        at org.audiveris.omr.sheet.ui.BookActions$TranscribeBookTask.doInBackground(BookActions.java:2057)
        at org.audiveris.omr.sheet.ui.BookActions$TranscribeBookTask.doInBackground(BookActions.java:2037)
        at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at javax.swing.SwingWorker.run(SwingWorker.java:334)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
        at org.audiveris.omr.step.AbstractSystemStep.doitPerSystem(AbstractSystemStep.java:221)
        at org.audiveris.omr.step.AbstractSystemStep.doit(AbstractSystemStep.java:101)
        at org.audiveris.omr.step.Step.doit(Step.java:184)
        at org.audiveris.omr.sheet.SheetStub$4.call(SheetStub.java:1101)
        at org.audiveris.omr.sheet.SheetStub$4.call(SheetStub.java:1089)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        ... 3 common frames omitted
Caused by: java.lang.NullPointerException: null
        at java.awt.Rectangle.intersects(Rectangle.java:786)
        at org.audiveris.omr.text.TextBuilder.retrieveSystemLines(TextBuilder.java:227)
        at org.audiveris.omr.text.TextsStep.doSystem(TextsStep.java:64)
        at org.audiveris.omr.text.TextsStep.doSystem(TextsStep.java:42)
        at org.audiveris.omr.step.AbstractSystemStep$1.call(AbstractSystemStep.java:193)
        at org.audiveris.omr.step.AbstractSystemStep$1.call(AbstractSystemStep.java:176)
        at org.audiveris.omr.step.AbstractSystemStep.doitPerSystem(AbstractSystemStep.java:214)
        ... 8 common frames omitted
INFO  [output-ext]                      Book 1451 | Scores built: 1

This example is working fine p_intermediate-ext

Dump from pre-packaged version

INFO  []                      Main 334  | Environment:
- Audiveris:    5.1.0:4687c3527
- OS:           Windows 10 10.0
- Architecture: amd64
- Java VM:      Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
- OCR Engine:   Tesseract OCR, version 3.04.01
INFO  []                       CLI 217  | CLI args: []
INFO  []             AliasPatterns 128  | Alias patterns: [(IMSLP[0-9]*)-.*]
INFO  []                   MainGui 499  | Audiveris version 5.1.0
INFO  []                   MainGui 500  |
LogUtil. Property logback.configurationFile not defined, skipped.
LogUtil. No C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\config\logback.xml, skipped.
LogUtil. Configuration found jar:file:/C:/Program%20Files/Audiveris/lib/audiveris.jar!/res/logback.xml
LogUtil. Logging to C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\log\20200715T205758.log

INFO  []            PluginsManager 235  | No C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\config\plugins.xml file found
INFO  []           BasicClassifier 362  | Classifier loaded XML norms.
INFO  []        AbstractClassifier 348  | Classifier data loaded from default uri jar:file:/C:/Program%20Files/Audiveris/lib/audiveris.jar!/res/basic-classifier.zip
INFO  [p_intermediate-ext]                      Book 473  | 1 sheet in C:\Users\jcjve\Documents\Audiveris\p_intermediate\p_intermediate-ext.png
INFO  [p_intermediate-ext]                      Book 1226 | Loaded image 1 1568x339 from C:\Users\jcjve\Documents\Audiveris\p_intermediate\p_intermediate-ext.png
INFO  [p_intermediate-ext]                      Book 1327 | Book reaching PAGE on sheets:[#1]
INFO  [p_intermediate-ext]              ScaleBuilder 492  | Beam minHeight:5 maxHeight:16 quorum:302
INFO  [p_intermediate-ext]              ScaleBuilder 235  | No beam key found, guessed value: 10
INFO  [p_intermediate-ext]                 ScaleStep 84   | Scale{line(2,2,2) interline(18,18,18) beam(10 extra)}
INFO  [p_intermediate-ext]            LinesRetriever 447  | Global slope: 0.00000
INFO  [p_intermediate-ext]         ClustersRetriever 235  | Retrieved line clusters: 2 of size: 5 with interline: interline(18,18,18)
INFO  [p_intermediate-ext]                 PeakGraph 177  | Systems: #1[1, 2]
INFO  [p_intermediate-ext]             SystemManager 731  | 1 part along 1 system
INFO  [p_intermediate-ext]             StemSeedsStep 93   | stem(3 max:4)
INFO  [p_intermediate-ext]            BlackHeadSizer 95   | Spots black-head retrieval diameter: 16.2
Empty page!!
Empty page!!
INFO  [p_intermediate-ext]                      Page 251  | 5 raw measures: [5 in system#1]
INFO  [p_intermediate-ext]              SlursBuilder 156  | Slurs: 0
INFO  [p_intermediate-ext]           SegmentsBuilder 110  | Segments: 0
INFO  [p_intermediate-ext]                      Book 1451 | Scores built: 1
hbitteur commented 4 years ago

@jcjveraa According to the error messages, the NPE occurred in Audiveris Java code, not in Tesseract binary code. Your two examples are different, so there is no reason that OMR behaves the same in both cases.

I noticed you used old 5.1 version. You definitely should use 5.2 alpha version (simply clone and build Audiveris from its "development" branch).

Could you do so, and retest your two examples with latest Audiveris version. Please keep us informed.

odelphi commented 4 years ago

I am having the same issue when I get to the TEXT step on a particular page of a multi-sheet score. My log file is almost identical. The previous pages worked fine, so I know it has something to do with this particular page. I too am using the 5.1 version. Isn't it the latest stable version? I execute through GIT.

"You definitely should use 5.2 alpha version (simply clone and build Audiveris from its "development" branch)." hbitteur: You are going to have to take us step by step to clone anything from its development branch. Thank you

odelphi commented 4 years ago

UPDATE: The page that was getting the error has been fixed. The page had a large graphic on the page. Got rid of the graphic, page now scans.

jcjveraa commented 4 years ago

I'm getting similar results on the development branch, but had not taken the time to post the logs here. Will do this weekend.

Op vr 17 jul. 2020 22:25 schreef odelphi notifications@github.com:

UPDATE: The page that was getting the error has been fixed. The page had a large graphic on the page. Got rid of the graphic, page now scans.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Audiveris/audiveris/issues/411#issuecomment-660321919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6CPHIPBIN6A4X2FUGTRWDR4CXURANCNFSM4O2Z4NJA .

jcjveraa commented 4 years ago

@hbitteur I did a clean re-install after discovering that Audiveris was happy to run stating that Tesseract was installed, while it was in fact not installed properly anymore (?). Now the above example works fine in the Development branch.

$ ./gradlew run

> Configure project :
targetOS=windows-x86_64

> Task :run
INFO  []                      Main 399  | Environment:
- Audiveris:    5.2.1-alpha:bce9ff7ef
- OS:           Windows 10 10.0
- Architecture: amd64
- Java VM:      Java HotSpot(TM) 64-Bit Server VM (build 11.0.8+10-LTS, mixed mode)
- OCR Engine:   Tesseract OCR, version 3.04.01
INFO  []                       CLI 237  | CLI args: []
INFO  []             AliasPatterns 128  | Alias patterns: [(IMSLP[0-9]*)-.*]
INFO  []                   MainGui 425  | Audiveris version 5.2.1-alpha
INFO  []                   MainGui 426  |
LogUtil. Property logback.configurationFile not defined, skipped.
LogUtil. No C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\config\logback.xml, skipped.
LogUtil. Configuration found file:///C:/Users/jcjve/Downloads/audiveris/res/logback.xml
LogUtil. Logging to C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\log\20200719T103024.log

INFO  []            PluginsManager 237  | No C:\Users\jcjve\AppData\Roaming\AudiverisLtd\audiveris\config\plugins.xml file found
INFO  []           BasicClassifier 362  | Classifier loaded XML norms.
INFO  []        AbstractClassifier 348  | Classifier data loaded from default uri file:///C:/Users/jcjve/Downloads/audiveris/res/basic-classifier.zip
INFO  []                  Versions 341  | Versions. Poll frequency: Weekly, next poll on: 24-Jul-2020
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jgoodies.common.internal.RenderingUtils (file:/C:/Users/jcjve/.gradle/caches/modules-2/files-2.1/com.jgoodies/jgoodies-common/1.8.1/dffc159cf71bde5dcbb65916305684f6b43d45b1/jgoodies-common-1.8.1.jar) to method sun.swing.SwingUtilities2.drawStringUnderlineCharAt(javax.swing.JComponent,java.awt.Graphics,java.lang.String,int,int,int)
WARNING: Please consider reporting this to the maintainers of com.jgoodies.common.internal.RenderingUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO  [test_ottava]                      Book 496  | 1 sheet in C:\Users\jcjve\Downloads\test_ottava.png
INFO  [test_ottava]                      Book 1302 | Loaded image 1 1706x438 from C:\Users\jcjve\Downloads\test_ottava.png
INFO  [test_ottava]                      Book 1405 | Book reaching PAGE on sheets:[#1]
INFO  [test_ottava]              ScaleBuilder 545  | Other combo peak too different (109,109,109), discarded
INFO  [test_ottava]              ScaleBuilder 492  | Beam minHeight:5 maxHeight:16 quorum:386
INFO  [test_ottava]              ScaleBuilder 235  | No beam key found, guessed value: 10
INFO  [test_ottava]                 ScaleStep 88   | Scale{line(2,2,2) interline(18,18,18) beam(10 extra)}
INFO  [test_ottava]                 ScaleStep 96   | Sheet - Unsufficient beam scaling data: beam(10 extra)
INFO  [test_ottava]            LinesRetriever 449  | Global slope: 0.00000
INFO  [test_ottava]         ClustersRetriever 306  | Retrieved line clusters: 2 of sizes [5] with interline(18,18,18)
INFO  [test_ottava]                 PeakGraph 177  | Systems: #1[1, 2]
INFO  [test_ottava]             SystemManager 830  | 1 part along 1 system
INFO  [test_ottava]             StemSeedsStep 93   | stem(3 max:4)
INFO  [test_ottava]            BlackHeadSizer 95   | Spots black-head retrieval diameter: 16.2
INFO  [test_ottava]            BlackHeadSizer 243  | Core black head count: 13 blackHead(width:23.7~0.5 height:20.4~0.5)
INFO  [test_ottava]            BlackHeadSizer 248  | MusicFont{name:MusicalSymbols pointSize:79}
INFO  [test_ottava]                      Page 255  | 4 raw measures: [4 in system#1]
INFO  [test_ottava]              SlursBuilder 156  | Slurs: 1
INFO  [test_ottava]           SegmentsBuilder 110  | Segments: 0
INFO  [test_ottava]                      Book 1529 | Scores built: 1