completed image ocr
This commit is contained in:
parent
5c6700f621
commit
e5435c67e3
|
@ -1,3 +1,3 @@
|
||||||
# checks-parser
|
# checks-parser
|
||||||
|
|
||||||
C++/QT desktop program for parsing checks to xlsx/csv
|
C++/QT desktop program for parsing checks to csv
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include "image/checkimage.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent), ui(new Ui::MainWindow) {
|
: QMainWindow(parent), ui(new Ui::MainWindow) {
|
||||||
|
@ -36,20 +37,20 @@ void MainWindow::setupStoresList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_checkType_currentIndexChanged(int index) {
|
void MainWindow::on_checkType_currentIndexChanged(int index) {
|
||||||
|
|
||||||
ui->inputHolder->setCurrentIndex(index);
|
ui->inputHolder->setCurrentIndex(index);
|
||||||
// switch (index) {
|
|
||||||
// case 0:
|
|
||||||
// ui->checkInfoText->setVisible(true);
|
|
||||||
// break;
|
|
||||||
// case 1:
|
|
||||||
// ui->checkInfoText->setVisible(false);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_parseButton_clicked() {
|
void MainWindow::on_parseButton_clicked() {
|
||||||
QString s(ui->checkContent->toPlainText());
|
QString s;
|
||||||
|
switch (ui->checkType->currentIndex()) {
|
||||||
|
case 0:
|
||||||
|
s = ui->checkContent->toPlainText();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
s = ui->checkContentFromImage->toPlainText();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
std::wstring check_plaintext = s.toStdWString();
|
std::wstring check_plaintext = s.toStdWString();
|
||||||
parser.set_module(parser.search_modules()[0]);
|
parser.set_module(parser.search_modules()[0]);
|
||||||
|
|
||||||
|
@ -81,6 +82,12 @@ void MainWindow::on_chooseImageButton_clicked() {
|
||||||
std::cout << filename.toStdString() << std::endl;
|
std::cout << filename.toStdString() << std::endl;
|
||||||
|
|
||||||
// this->options.set_path(filename.toStdString());
|
// this->options.set_path(filename.toStdString());
|
||||||
ui->pathLabel->setText("Path to export: " + filename);
|
std::string new_text = "Path to export: " + filename.toStdString();
|
||||||
|
ui->pathLabel->setText(QString::fromStdString(new_text));
|
||||||
|
|
||||||
|
CheckImage i(filename.toStdString());
|
||||||
|
std::string parsed = i.parse_text();
|
||||||
|
|
||||||
|
ui->checkContentFromImage->setPlainText(QString::fromStdString(parsed));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>110</x>
|
<x>110</x>
|
||||||
<y>20</y>
|
<y>20</y>
|
||||||
<width>161</width>
|
<width>381</width>
|
||||||
<height>18</height>
|
<height>18</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -134,8 +134,44 @@
|
||||||
<string>Choose</string>
|
<string>Choose</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>50</y>
|
||||||
|
<width>571</width>
|
||||||
|
<height>18</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Here is recognised check text. Please, edit it if something's wrong:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPlainTextEdit" name="checkContentFromImage">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>471</width>
|
||||||
|
<height>371</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="parseButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>560</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>26</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Parse</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menubar">
|
<widget class="QMenuBar" name="menubar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
|
|
Loading…
Reference in New Issue