dispmap/main.cpp

45 lines
1.1 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"
2014-07-25 11:32:00 +04:00
#include "svpointcloudviewer.h"
2014-07-11 20:35:48 +04:00
int main(int argc, char *argv[])
{
QGuiApplication a(argc, argv);
2014-07-14 18:05:08 +04:00
2014-07-25 11:32:00 +04:00
qmlRegisterType<SvPointCloudViewer>("SvPCV", 1, 0, "SvPointCloudViewer");
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-28 00:04:18 +04:00
QImage imgLeft("../ComputerVision/img/left9.png");
2014-07-23 15:44:35 +04:00
QImage imgRight("../CSV/img/right1.png");
2014-07-11 20:35:48 +04:00
SvImage left(imgLeft);
SvImage right(imgRight);
2014-07-18 20:48:42 +04:00
2014-07-25 11:32:00 +04:00
SvPointCloud pointCloud(imgLeft.width(), imgLeft.height());
SvProcessor proc(4);
proc.enqueueImage(&pointCloud, &left);
2014-07-11 20:35:48 +04:00
2014-07-14 10:55:56 +04:00
imageProvider.addImage("left", &left);
imageProvider.addImage("right", &right);
2014-07-11 20:35:48 +04:00
2014-07-14 10:55:56 +04:00
engine.addImageProvider("images", &imageProvider);
2014-07-14 18:05:08 +04:00
engine.rootContext()->setContextProperty("processor", &proc);
2014-07-28 00:04:18 +04:00
engine.rootContext()->setContextProperty("pointCloud", &pointCloud);
2014-07-25 11:32:00 +04:00
engine.load(QUrl(QStringLiteral("qrc:///Main.qml")));
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();
}