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

Small clean up

parent 6a4b6aac
......@@ -26,7 +26,7 @@ SOURCES += \
$${TOP}/src/GlobalTimer.cpp \
$${TOP}/src/PolyFit.cpp \
$${TOP}/src/CalibrationMethod.cpp \
src/Homography.cpp
$${TOP}/src/Homography.cpp
HEADERS += \
$${TOP}/src/ImageProcessing.h \
......@@ -64,7 +64,7 @@ HEADERS += \
$${TOP}/else/find_best_edge.h \
$${TOP}/src/PolyFit.h \
$${TOP}/src/CalibrationMethod.h \
src/Homography.h
$${TOP}/src/Homography.h
FORMS += \
$${TOP}/src/Gui.ui
......
......@@ -34,14 +34,14 @@ static void updateSlave(ImageAcquisition *imageAcquisition)
if (imageAcquisition->slave->buffer.imageData != NULL) {
tmp = cvarrToMat(&imageAcquisition->slave->buffer, true);
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 ||
settings.value("fieldCam/outResY").toInt() != tmp.rows ) {
resize(
tmp,
tmp,
Size(settings.value("fieldCam/outResX").toInt(), settings.value("fieldCam/outResY").toInt()),
INTER_CUBIC
INTER_AREA
);
}
}
......
......@@ -22,15 +22,15 @@ QString getNamePrefix()
void logMessages(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
static QMutex logMutex;
static std::ofstream log;
static ofstream log;
QMutexLocker lock(&logMutex);
if (!log.is_open())
log.open("EyeRec.log", std::ofstream::app);
log.open("EyeRec.log", ofstream::app);
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()
......@@ -50,5 +50,3 @@ GlobalTimer gTimer;
QString gBinaryPath = "";
QString gCurrentSubjectName = "";
QString gFileIndexStr = "0000";
PolyFit *polyFit;
......@@ -3,6 +3,7 @@
#include <iostream>
#include <fstream>
#include <vector>
#include <QApplication>
#include <QString>
......@@ -12,24 +13,25 @@
#include <QProcess>
#include <QDebug>
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "settings.h"
#include "GlobalTimer.h"
#include "PolyFit.h"
using namespace std;
using namespace cv;
QString getTimestampStr();
QString getNamePrefix();
void initBanner();
void exitBanner();
void logMessages(QtMsgType type, const QMessageLogContext &context, const QString &msg);
extern QString gBinaryPath;
extern QString gCurrentSubjectName;
extern QString gFileIndexStr;
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
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