Skip to content

Add unit test for OSD, update apiexample test #1359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 4, 2018
Merged

Add unit test for OSD, update apiexample test #1359

merged 3 commits into from
Mar 4, 2018

Conversation

Shreeshrii
Copy link
Collaborator

New versions of

#1299
#1302

@Shreeshrii
Copy link
Collaborator Author

apiexample_test.log

Running main() from gtest_main.cc
[==========] Running 5 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 1 test from EuroText
[ RUN      ] EuroText.FastOCR
[       OK ] EuroText.FastOCR (7813 ms)
[----------] 1 test from EuroText (7814 ms total)

[----------] 4 tests from EngLatinDevaArabLang/MatchGroundTruth
[ RUN      ] EngLatinDevaArabLang/MatchGroundTruth.FastPhototestOCR/0
[       OK ] EngLatinDevaArabLang/MatchGroundTruth.FastPhototestOCR/0 (2666 ms)
[ RUN      ] EngLatinDevaArabLang/MatchGroundTruth.FastPhototestOCR/1
[       OK ] EngLatinDevaArabLang/MatchGroundTruth.FastPhototestOCR/1 (4960 ms)
[ RUN      ] EngLatinDevaArabLang/MatchGroundTruth.FastPhototestOCR/2
[       OK ] EngLatinDevaArabLang/MatchGroundTruth.FastPhototestOCR/2 (3077 ms)
[ RUN      ] EngLatinDevaArabLang/MatchGroundTruth.FastPhototestOCR/3
[       OK ] EngLatinDevaArabLang/MatchGroundTruth.FastPhototestOCR/3 (3589 ms)
[----------] 4 tests from EngLatinDevaArabLang/MatchGroundTruth (14295 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 2 test cases ran. (22110 ms total)
[  PASSED  ] 5 tests.

@Shreeshrii
Copy link
Collaborator Author

osd_test.log

Running main() from gtest_main.cc
[==========] Running 14 tests from 8 test cases.
[----------] Global test environment set-up.
[----------] 3 tests from TessdataEngEuroHebrew/OSDTest
[ RUN      ] TessdataEngEuroHebrew/OSDTest.MatchOrientationDegrees/0
[ LOG MSG  ] ../../tessdata for image: ../testing/phototest.tif
************ Orientation in degrees: 0, Orientation confidence: 10.86
             Script: Latin, Script confidence: 10.56
[       OK ] TessdataEngEuroHebrew/OSDTest.MatchOrientationDegrees/0 (1552 ms)
[ RUN      ] TessdataEngEuroHebrew/OSDTest.MatchOrientationDegrees/1
[ LOG MSG  ] ../../tessdata for image: ../testing/eurotext.tif
************ Orientation in degrees: 0, Orientation confidence: 30.13
             Script: Latin, Script confidence: 5.75
[       OK ] TessdataEngEuroHebrew/OSDTest.MatchOrientationDegrees/1 (1901 ms)
[ RUN      ] TessdataEngEuroHebrew/OSDTest.MatchOrientationDegrees/2
[ LOG MSG  ] ../../tessdata for image: ../testing/hebrew.png
************ Orientation in degrees: 0, Orientation confidence: 25.54
             Script: Hebrew, Script confidence: 41.11
[       OK ] TessdataEngEuroHebrew/OSDTest.MatchOrientationDegrees/2 (1229 ms)
[----------] 3 tests from TessdataEngEuroHebrew/OSDTest (4683 ms total)

[----------] 3 tests from TessdataBestEngEuroHebrew/OSDTest
[ RUN      ] TessdataBestEngEuroHebrew/OSDTest.MatchOrientationDegrees/0
[ LOG MSG  ] ../../tessdata_best for image: ../testing/phototest.tif
************ Orientation in degrees: 0, Orientation confidence: 10.86
             Script: Latin, Script confidence: 10.56
[       OK ] TessdataBestEngEuroHebrew/OSDTest.MatchOrientationDegrees/0 (1284 ms)
[ RUN      ] TessdataBestEngEuroHebrew/OSDTest.MatchOrientationDegrees/1
[ LOG MSG  ] ../../tessdata_best for image: ../testing/eurotext.tif
************ Orientation in degrees: 0, Orientation confidence: 30.13
             Script: Latin, Script confidence: 5.75
[       OK ] TessdataBestEngEuroHebrew/OSDTest.MatchOrientationDegrees/1 (1833 ms)
[ RUN      ] TessdataBestEngEuroHebrew/OSDTest.MatchOrientationDegrees/2
[ LOG MSG  ] ../../tessdata_best for image: ../testing/hebrew.png
************ Orientation in degrees: 0, Orientation confidence: 25.54
             Script: Hebrew, Script confidence: 41.11
[       OK ] TessdataBestEngEuroHebrew/OSDTest.MatchOrientationDegrees/2 (1225 ms)
[----------] 3 tests from TessdataBestEngEuroHebrew/OSDTest (4342 ms total)

[----------] 3 tests from TessdataFastEngEuroHebrew/OSDTest
[ RUN      ] TessdataFastEngEuroHebrew/OSDTest.MatchOrientationDegrees/0
[ LOG MSG  ] ../../tessdata_fast for image: ../testing/phototest.tif
************ Orientation in degrees: 0, Orientation confidence: 10.86
             Script: Latin, Script confidence: 10.56
[       OK ] TessdataFastEngEuroHebrew/OSDTest.MatchOrientationDegrees/0 (1271 ms)
[ RUN      ] TessdataFastEngEuroHebrew/OSDTest.MatchOrientationDegrees/1
[ LOG MSG  ] ../../tessdata_fast for image: ../testing/eurotext.tif
************ Orientation in degrees: 0, Orientation confidence: 30.13
             Script: Latin, Script confidence: 5.75
[       OK ] TessdataFastEngEuroHebrew/OSDTest.MatchOrientationDegrees/1 (1820 ms)
[ RUN      ] TessdataFastEngEuroHebrew/OSDTest.MatchOrientationDegrees/2
[ LOG MSG  ] ../../tessdata_fast for image: ../testing/hebrew.png
************ Orientation in degrees: 0, Orientation confidence: 25.54
             Script: Hebrew, Script confidence: 41.11
[       OK ] TessdataFastEngEuroHebrew/OSDTest.MatchOrientationDegrees/2 (1260 ms)
[----------] 3 tests from TessdataFastEngEuroHebrew/OSDTest (4353 ms total)

[----------] 1 test from TessdataFastRotated90/OSDTest
[ RUN      ] TessdataFastRotated90/OSDTest.MatchOrientationDegrees/0
[ LOG MSG  ] ../../tessdata_fast for image: ../testing/phototest-rotated-R.png
************ Orientation in degrees: 90, Orientation confidence: 9.30
             Script: Latin, Script confidence: 8.06
[       OK ] TessdataFastRotated90/OSDTest.MatchOrientationDegrees/0 (1257 ms)
[----------] 1 test from TessdataFastRotated90/OSDTest (1258 ms total)

[----------] 1 test from TessdataFastRotated180/OSDTest
[ RUN      ] TessdataFastRotated180/OSDTest.MatchOrientationDegrees/0
[ LOG MSG  ] ../../tessdata_fast for image: ../testing/phototest-rotated-180.png
************ Orientation in degrees: 180, Orientation confidence: 10.99
             Script: Latin, Script confidence: 5.83
[       OK ] TessdataFastRotated180/OSDTest.MatchOrientationDegrees/0 (1276 ms)
[----------] 1 test from TessdataFastRotated180/OSDTest (1276 ms total)

[----------] 1 test from TessdataFastRotated270/OSDTest
[ RUN      ] TessdataFastRotated270/OSDTest.MatchOrientationDegrees/0
[ LOG MSG  ] ../../tessdata_fast for image: ../testing/phototest-rotated-L.png
************ Orientation in degrees: 270, Orientation confidence: 9.62
             Script: Latin, Script confidence: 3.03
[       OK ] TessdataFastRotated270/OSDTest.MatchOrientationDegrees/0 (1234 ms)
[----------] 1 test from TessdataFastRotated270/OSDTest (1235 ms total)

[----------] 1 test from TessdataFastDevaRotated270/OSDTest
[ RUN      ] TessdataFastDevaRotated270/OSDTest.MatchOrientationDegrees/0
[ LOG MSG  ] ../../tessdata_fast for image: ../testing/devatest-rotated-270.png
************ Orientation in degrees: 270, Orientation confidence: 7.07
             Script: Devanagari, Script confidence: inf
[       OK ] TessdataFastDevaRotated270/OSDTest.MatchOrientationDegrees/0 (1001 ms)
[----------] 1 test from TessdataFastDevaRotated270/OSDTest (1001 ms total)

[----------] 1 test from TessdataFastDeva/OSDTest
[ RUN      ] TessdataFastDeva/OSDTest.MatchOrientationDegrees/0
[ LOG MSG  ] ../../tessdata_fast for image: ../testing/devatest.png
************ Orientation in degrees: 0, Orientation confidence: 18.96
             Script: Devanagari, Script confidence: 43.33
[       OK ] TessdataFastDeva/OSDTest.MatchOrientationDegrees/0 (1537 ms)
[----------] 1 test from TessdataFastDeva/OSDTest (1537 ms total)

[----------] Global test environment tear-down
[==========] 14 tests from 8 test cases ran. (19686 ms total)
[  PASSED  ] 14 tests.

@stweil
Copy link
Member

stweil commented Mar 3, 2018

Could we move all images and other binaries for testing to a new extra repository https://github.com/tesseract-ocr/testing? Keeping the source code repository small saves disk space for all use cases which want to compile the code without running tests. We can still integrate that external repository as a submodule (like it is already done with googletest). @zdenop?

@Shreeshrii
Copy link
Collaborator Author

Shreeshrii commented Mar 4, 2018 via email

@Shreeshrii
Copy link
Collaborator Author

You might want to add at least 2 rotated images and add tests that use them.

@amitdo I have added the rotated images and tests to check that rotation degrees match.

Is there a way to programmatically rotate the images to test, rather than add more images to testdata?

@amitdo
Copy link
Collaborator

amitdo commented Mar 4, 2018

@zdenop zdenop merged commit 5845e1a into tesseract-ocr:master Mar 4, 2018
@Shreeshrii Shreeshrii deleted the patch-1 branch March 4, 2018 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants