Commit 59d0f42d authored by Thiago C. Santini's avatar Thiago C. Santini

Small clean up

parent 6a4b6aac
...@@ -26,7 +26,7 @@ SOURCES += \ ...@@ -26,7 +26,7 @@ SOURCES += \
$${TOP}/src/GlobalTimer.cpp \ $${TOP}/src/GlobalTimer.cpp \
$${TOP}/src/PolyFit.cpp \ $${TOP}/src/PolyFit.cpp \
$${TOP}/src/CalibrationMethod.cpp \ $${TOP}/src/CalibrationMethod.cpp \
src/Homography.cpp $${TOP}/src/Homography.cpp
HEADERS += \ HEADERS += \
$${TOP}/src/ImageProcessing.h \ $${TOP}/src/ImageProcessing.h \
...@@ -64,7 +64,7 @@ HEADERS += \ ...@@ -64,7 +64,7 @@ HEADERS += \
$${TOP}/else/find_best_edge.h \ $${TOP}/else/find_best_edge.h \
$${TOP}/src/PolyFit.h \ $${TOP}/src/PolyFit.h \
$${TOP}/src/CalibrationMethod.h \ $${TOP}/src/CalibrationMethod.h \
src/Homography.h $${TOP}/src/Homography.h
FORMS += \ FORMS += \
$${TOP}/src/Gui.ui $${TOP}/src/Gui.ui
......
...@@ -34,14 +34,14 @@ static void updateSlave(ImageAcquisition *imageAcquisition) ...@@ -34,14 +34,14 @@ static void updateSlave(ImageAcquisition *imageAcquisition)
if (imageAcquisition->slave->buffer.imageData != NULL) { if (imageAcquisition->slave->buffer.imageData != NULL) {
tmp = cvarrToMat(&imageAcquisition->slave->buffer, true); tmp = cvarrToMat(&imageAcquisition->slave->buffer, true);
flip(tmp, tmp, settings.value("fieldCam/flip").toInt()); // flip before undistorting flip(tmp, tmp, settings.value("fieldCam/flip").toInt()); // flip before undistorting
remap(tmp, tmp, imageAcquisition->map1, imageAcquisition->map2, cv::INTER_CUBIC); remap(tmp, tmp, imageAcquisition->map1, imageAcquisition->map2, cv::INTER_AREA);
if ( settings.value("fieldCam/outResX").toInt() != tmp.cols || if ( settings.value("fieldCam/outResX").toInt() != tmp.cols ||
settings.value("fieldCam/outResY").toInt() != tmp.rows ) { settings.value("fieldCam/outResY").toInt() != tmp.rows ) {
resize( resize(
tmp, tmp,
tmp, tmp,
Size(settings.value("fieldCam/outResX").toInt(), settings.value("fieldCam/outResY").toInt()), Size(settings.value("fieldCam/outResX").toInt(), settings.value("fieldCam/outResY").toInt()),
INTER_CUBIC INTER_AREA
); );
} }
} }
......
...@@ -22,15 +22,15 @@ QString getNamePrefix() ...@@ -22,15 +22,15 @@ QString getNamePrefix()
void logMessages(QtMsgType type, const QMessageLogContext &context, const QString &msg) void logMessages(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{ {
static QMutex logMutex; static QMutex logMutex;
static std::ofstream log; static ofstream log;
QMutexLocker lock(&logMutex); QMutexLocker lock(&logMutex);
if (!log.is_open()) if (!log.is_open())
log.open("EyeRec.log", std::ofstream::app); log.open("EyeRec.log", ofstream::app);
else else
log << qFormatLogMessage(type, context, msg).toStdString() << std::endl; log << qFormatLogMessage(type, context, msg).toStdString() << endl;
std::cout << qFormatLogMessage(type, context, msg).toStdString() << std::endl; cout << qFormatLogMessage(type, context, msg).toStdString() << endl;
} }
void initBanner() void initBanner()
...@@ -50,5 +50,3 @@ GlobalTimer gTimer; ...@@ -50,5 +50,3 @@ GlobalTimer gTimer;
QString gBinaryPath = ""; QString gBinaryPath = "";
QString gCurrentSubjectName = ""; QString gCurrentSubjectName = "";
QString gFileIndexStr = "0000"; QString gFileIndexStr = "0000";
PolyFit *polyFit;
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <vector>
#include <QApplication> #include <QApplication>
#include <QString> #include <QString>
...@@ -12,24 +13,25 @@ ...@@ -12,24 +13,25 @@
#include <QProcess> #include <QProcess>
#include <QDebug> #include <QDebug>
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "settings.h" #include "settings.h"
#include "GlobalTimer.h" #include "GlobalTimer.h"
#include "PolyFit.h" using namespace std;
using namespace cv;
QString getTimestampStr(); QString getTimestampStr();
QString getNamePrefix(); QString getNamePrefix();
void initBanner(); void initBanner();
void exitBanner(); void exitBanner();
void logMessages(QtMsgType type, const QMessageLogContext &context, const QString &msg);
extern QString gBinaryPath; extern QString gBinaryPath;
extern QString gCurrentSubjectName; extern QString gCurrentSubjectName;
extern QString gFileIndexStr; extern QString gFileIndexStr;
extern GlobalTimer gTimer; // Only valid after first frame has been received! extern GlobalTimer gTimer; // Only valid after first frame has been received!
extern PolyFit *polyFit;
void logMessages(QtMsgType type, const QMessageLogContext &context, const QString &msg);
#endif // UTILS_H #endif // UTILS_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment