-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
53 lines (50 loc) · 1.73 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "screencontroller/controller.h"
#include "dbconnector/dbconnector.h"
#include <QPixmap>
#include <QApplication>
#include <QDebug>
#include <QScreen>
#include "cards/imagecard.h"
#include "extractor/imageextractor.h"
#include "extractor/textextractor.h"
#include "extractor/realcardextractor.h"
#include "extractor/screenshotextractor.h"
#include "cards/card.h"
#include "cards/recognizedcard.h"
#include "util.h"
#include "mongo/bson/bsonobj.h"
#include <QFile>
#include <locale.h>
int main(int argc, char *argv[])
{
// cv::Mat basicImage=cv::imread("nocard.png",1);
// ScreenShotExtractor scr;
// ImageCard img = scr.extractCardFromScreen(basicImage);
// if(!img.isEmpty()){
// img.saveDescription("","descr.png");
// img.saveHealth("","health.png");
// img.saveAttack("","attack.png");
// img.saveMana("","mana.png");
// ImageExtractor extr;
// TextExtractor textExtr;
// RealCardExtractor realExtr;
// Card card = extr.getExtractedCard(scr.extractCardFromScreen(basicImage));
// RecognizedCard crd = textExtr.getExtractedCard(card);
// DBConnector db(QString("localhost"));
// db.connect();
// std::vector<DetectedCard> result = db.getCardsByStats(crd.getMana(),crd.getHealth(),crd.getAttack());
// DetectedCard real = realExtr.getRealCard(result,crd);
// qDebug() << real.getName();
// }
QApplication a(argc, argv);
Controller w;
// QScreen *screen = QGuiApplication::primaryScreen();
// if (screen){
// QPixmap originalPixmap = screen->grabWindow(0);
// QFile file("screen.png");
// file.open(QIODevice::WriteOnly);
// originalPixmap.save(&file, "PNG");
// }
w.show();
return a.exec();
}