22#include <allheaders.h>
36#ifndef DISABLED_LEGACY_ENGINE
37static void OSDTester(
int expected_deg,
const char *imgname,
const char *tessdatadir) {
39 auto api = std::make_unique<tesseract::TessBaseAPI>();
40 ASSERT_FALSE(api->Init(tessdatadir,
"osd")) <<
"Could not initialize tesseract.";
41 Image image = pixRead(imgname);
42 ASSERT_TRUE(image !=
nullptr) <<
"Failed to read test image.";
46 const char *script_name;
49 api->DetectOrientationScript(&orient_deg, &orient_conf, &script_name, &script_conf);
52 "************ Orientation in degrees: %d, Orientation confidence: %.2f\n"
53 " Script: %s, Script confidence: %.2f\n",
54 orient_deg, orient_conf, script_name, script_conf);
66#ifdef DISABLED_LEGACY_ENGINE
70 OSDTester(std::get<0>(GetParam()), std::get<1>(GetParam()), std::get<2>(GetParam()));
77 TESTING_DIR
"/eurotext.tif",
78 TESTING_DIR
"/hebrew.png"),
84 TESTING_DIR
"/eurotext.tif",
85 TESTING_DIR
"/hebrew.png"),
91 TESTING_DIR
"/eurotext.tif",
92 TESTING_DIR
"/hebrew.png"),
98 "/phototest-rotated-R.png"),
104 "/phototest-rotated-180.png"),
110 "/phototest-rotated-L.png"),
116 "/devatest-rotated-270.png"),
#define EXPECT_EQ(val1, val2)
#define ASSERT_FALSE(condition)
#define ASSERT_TRUE(condition)
INSTANTIATE_TEST_SUITE_P(Eng, MatchGroundTruth, ::testing::Values("eng"))
TEST_P(MatchGroundTruth, FastPhototestOCR)
internal::CartesianProductHolder< Generator... > Combine(const Generator &... g)
internal::ValueArray< T... > Values(T... v)