Browse Source

Update test submodule and fix pagesegmode_test

The test submodule now adds an image which is needed by the
pagesegmode_test.

That image was newly created for the test. Therefore the box
coordinates in the test had to be fixed by using data from
the hOCR output for the full image.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Stefan Weil 1 year ago
parent
commit
e94392ef10
2 changed files with 10 additions and 11 deletions
  1. 1
    1
      test
  2. 9
    10
      unittest/pagesegmode_test.cc

+ 1
- 1
test

@@ -1 +1 @@
-Subproject commit bb21bdbe20726447c360f8dc313a1a4f11177d42
+Subproject commit e27d9566917d7d167636a7d0cd59bcfb2c61c7eb

+ 9
- 10
unittest/pagesegmode_test.cc

@@ -91,24 +91,23 @@ TEST_F(PageSegModeTest, WordTest) {
   } else {
     SetImage(filename.c_str());
     // Test various rectangles around the inverse page number.
-    VerifyRectText(tesseract::PSM_SINGLE_WORD, "183", 1482, 146, 72, 44);
-    VerifyRectText(tesseract::PSM_SINGLE_WORD, "183", 1474, 134, 82, 72);
-    VerifyRectText(tesseract::PSM_SINGLE_WORD, "183", 1459, 116, 118, 112);
+    VerifyRectText(tesseract::PSM_SINGLE_WORD, "183", 1419, 264, 69, 34);
+    VerifyRectText(tesseract::PSM_SINGLE_WORD, "183", 1411, 252, 78, 62);
+    VerifyRectText(tesseract::PSM_SINGLE_WORD, "183", 1396, 218, 114, 102);
     // Test a random pair of words as a line
     VerifyRectText(tesseract::PSM_SINGLE_LINE,
-                   "What should", 1119, 621, 245, 54);
+                   "What should", 237, 393, 256, 36);
     // Test a random pair of words as a word
     VerifyRectText(tesseract::PSM_SINGLE_WORD,
-                   "Whatshould", 1119, 621, 245, 54);
+                   "Whatshould", 237, 393, 256, 36);
     // Test single block mode.
-    VerifyRectText(tesseract::PSM_SINGLE_BLOCK, "both the\nfrom the", 181, 676,
-                   179, 104);
+    VerifyRectText(tesseract::PSM_SINGLE_BLOCK,
+                   "both the\nfrom the", 237, 450, 172, 94);
     // But doesn't work in line or word mode.
     NotRectText(tesseract::PSM_SINGLE_LINE,
-                "both the\nfrom the", 181, 676, 179,
-                104);
+                "both the\nfrom the", 237, 450, 172, 94);
     NotRectText(tesseract::PSM_SINGLE_WORD,
-                "both the\nfrom the", 181, 676, 179, 104);
+                "both the\nfrom the", 237, 450, 172, 94);
   }
 }