File indexing completed on 2025-01-19 03:57:50
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2022-08-26 0007 * Description : CLI tool for OCR Text Converter plugin 0008 * 0009 * SPDX-FileCopyrightText: 2022 by Quoc Hung Tran <quochungtran1999 at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #include "ocrtesseractengine.h" 0016 0017 // Qt includes 0018 0019 #include <QString> 0020 #include <QStringList> 0021 #include <QProcess> 0022 #include <QFile> 0023 #include <QUrl> 0024 #include <QDebug> 0025 #include <QApplication> 0026 #include <QDir> 0027 0028 using namespace DigikamGenericTextConverterPlugin; 0029 0030 int main(int argc, char *argv[]) 0031 { 0032 QApplication app(argc, argv); 0033 0034 QScopedPointer<OcrTesseractEngine> ocrEngine (new OcrTesseractEngine()); 0035 0036 ocrEngine->setInputFile(QLatin1String("./data/scanned_img.jpg")); 0037 ocrEngine->setOutputFile(QLatin1String("./")); 0038 0039 int check = ocrEngine->runOcrProcess(); 0040 Q_UNUSED(check); 0041 0042 return app.exec(); 0043 }