dispmap/main.cpp

39 lines
1.0 KiB
C++
Raw Normal View History

2014-07-14 18:05:08 +04:00
#include <QApplication>
2014-07-11 20:35:48 +04:00
#include <QQmlApplicationEngine>
#include <QQmlComponent>
#include <QQmlContext>
#include <QPixmap>
#include "svimage.h"
#include "svprocessor.h"
#include "svimageprovider.h"
int main(int argc, char *argv[])
{
QGuiApplication a(argc, argv);
2014-07-14 18:05:08 +04:00
2014-07-11 20:35:48 +04:00
QQmlApplicationEngine engine;
2014-07-14 10:55:56 +04:00
SvImageProvider imageProvider;
2014-07-11 20:35:48 +04:00
2014-07-14 18:05:08 +04:00
QImage imgLeft("../ComputerVision/img/left4_.png");
QImage imgRight("../ComputerVision/img/right4_.png");
2014-07-11 20:35:48 +04:00
QImage imgStereo(imgLeft.width(), imgRight.height(), QImage::Format_RGB32);
SvImage left(imgLeft);
SvImage right(imgRight);
SvImage stereo(imgStereo);
2014-07-14 18:05:08 +04:00
SvProcessor proc(&left, &right, &stereo, 4);
2014-07-11 20:35:48 +04:00
2014-07-14 10:55:56 +04:00
imageProvider.addImage("left", &left);
imageProvider.addImage("right", &right);
imageProvider.addImage("result", &stereo);
2014-07-11 20:35:48 +04:00
2014-07-14 10:55:56 +04:00
engine.addImageProvider("images", &imageProvider);
2014-07-11 20:35:48 +04:00
engine.load(QUrl(QStringLiteral("qrc:///Main.qml")));
2014-07-14 18:05:08 +04:00
engine.rootContext()->setContextProperty("processor", &proc);
2014-07-11 20:35:48 +04:00
2014-07-14 10:55:56 +04:00
proc.start();
2014-07-11 20:35:48 +04:00
return a.exec();
}