Commit 78ce33c9 authored by kueblert's avatar kueblert

Initial clone of ScanpathViewer.

parents
/ClusterDllTest.opensdf
/ClusterDllTest.sdf
/ClusterDllTest.suo
/Infer.Compiler.dll
/Infer.Runtime.dll
/ScanpathViewer.exe
/ScanpathViewer.exp
/ScanpathViewer.lib
/clustering.dll
/clustering.pdb
/clusteringWrapper.dll
/clusteringWrapper.pdb
/ffprobe.exe
/heatmap_export.txt
/hm2.png
/hm2.txt
/scanpath_export.txt
/tbb_debug.dll
/training.txt

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "clusteringLibrary", "clusteringDll\clusteringLibrary.csproj", "{785565C3-849F-401E-A0DE-6152DBF7B6F4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clusteringWrapper", "clusteringWrapper\clusteringWrapper.vcxproj", "{C4221239-2C00-47E7-B5FC-01A95E9C46D0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScanpathViewer", "ScanpathViewer\ScanpathViewer.vcxproj", "{AE22D601-69D6-49E9-BB03-428D47BCB140}"
ProjectSection(ProjectDependencies) = postProject
{C4221239-2C00-47E7-B5FC-01A95E9C46D0} = {C4221239-2C00-47E7-B5FC-01A95E9C46D0}
{785565C3-849F-401E-A0DE-6152DBF7B6F4} = {785565C3-849F-401E-A0DE-6152DBF7B6F4}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Debug|Any CPU.ActiveCfg = Debug|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Debug|Mixed Platforms.Build.0 = Debug|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Debug|Win32.ActiveCfg = Debug|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Debug|x86.ActiveCfg = Debug|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Debug|x86.Build.0 = Debug|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Release|Any CPU.ActiveCfg = Release|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Release|Mixed Platforms.ActiveCfg = Release|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Release|Mixed Platforms.Build.0 = Release|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Release|Win32.ActiveCfg = Release|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Release|x86.ActiveCfg = Release|x86
{785565C3-849F-401E-A0DE-6152DBF7B6F4}.Release|x86.Build.0 = Release|x86
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Debug|Win32.ActiveCfg = Debug|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Debug|Win32.Build.0 = Debug|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Debug|x86.ActiveCfg = Debug|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Release|Any CPU.ActiveCfg = Release|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Release|Mixed Platforms.Build.0 = Release|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Release|Win32.ActiveCfg = Release|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Release|Win32.Build.0 = Release|Win32
{C4221239-2C00-47E7-B5FC-01A95E9C46D0}.Release|x86.ActiveCfg = Release|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Debug|Any CPU.ActiveCfg = Debug|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Debug|Win32.ActiveCfg = Debug|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Debug|Win32.Build.0 = Debug|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Debug|x86.ActiveCfg = Debug|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Release|Any CPU.ActiveCfg = Release|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Release|Mixed Platforms.Build.0 = Release|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Release|Win32.ActiveCfg = Release|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Release|Win32.Build.0 = Release|Win32
{AE22D601-69D6-49E9-BB03-428D47BCB140}.Release|x86.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
1. Abhängigkeiten downloaden
Externe Abhängigkeiten herunterladen und installieren:
(Vor allem die Debug-dlls sind zu groß, um sinnvoll im Repository eingecheckt zu werden)
Wichtig ist alle Abhängigkeiten in der 32 Bit Variante zu nutzen.
Microsoft Visual Studio 2010 MSDNAA
OpenCV http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/OpenCV-2.3.1-win-superpack.exe/download
Nokia Qt http://qt.nokia.com/downloads/sdk-windows-cpp
Qt Visual Studio Add-in http://qt.nokia.com/downloads/visual-studio-add-in
2. Variablen definieren
Das Projekt erwartet folgende Umgebungsvariablen, die nach der Installation (unter Umständen) von Hand gesetzt werden müssen, etwa mit "setx VARIABLE WERT" in der Konsole:
(Visual Studio benötigt einen Neustart, um die neu gesetzten Umgebungsvariablen zu erkennen)
QTDIR (z.B. E:\QtSDK\Desktop\Qt\4.8.0\msvc2010) Wichtig ist hier die msvc, nicht die mingw Version zu verwenden.
OPENCVDIR Zu einem Ordner, der direkt folgende Unterordner aus dem Superpack enthält (in erster Ebene!): bin, include, lib, staticlib.
Diese können aus dem Unterordner vc10_x86 des Superpacks (z.B. D:\opencv\build\x86\vc10) kopiert werden.
In Visual Studio erzeugt das Qt Add-in einen Menüpunkt QT. Hier muss eine Qt Konfiguration erzeugt und dem Projekt zugewiesen werden.
Außerdem muss die PATH Variable um die Einträge zu den entsprechenden bin-Verzeichnissen für OpenCV und Qt ergänzt werden.
Alternativ können alle enthaltenen DLLs ins Verzeichnis der ausführbaren Projekt-Datei kopiert werden.
z.B. PATH += E:\QtSDK\Desktop\Qt\4.8.0\msvc2010\bin; D:\opencv\build\x86\vc10\bin;
[Die Matlab, Laserbird und Qwt externals sind bereits im Repository eingecheckt und laufen ohne Installation oder Konfiguration.]
3. Kompillieren
Kompillieren mit Visual Studio 2010 und Ausführen.
4. Benutzung
Im zweiten Karteireiter Daten laden, danach im ersten Karteireiter Auswertung anschauen.
Unbedingt notwendig ist immer eine Video Datei.
Optional sind Eyetracking, Simulatordaten und Bounding-Boxes, sowie Augenvideo.
#pragma once
#include "stdafx.h"
#include <qdatastream.h>
#include <qmetatype.h>
#include <qstring.h>
#include <qdebug.h>
enum EyeTracker{
DIKABLIS, GENERIC
};
struct EyeTrackerConfig{
EyeTracker type;
int timecolumn;
int xcolumn;
int ycolumn;
int validcolumn;
int header;
QString sep;
EyeTrackerConfig(EyeTracker t, int time, int x, int y, int valid, int h, QString s){
type=t; timecolumn=time; xcolumn=x; ycolumn=y; validcolumn=valid; header = h; sep=s;
}
EyeTrackerConfig(EyeTracker t){
type=t;
if(t!=DIKABLIS) qWarning() << "Eye-Tracker with unknown columns!";
}
};
\ No newline at end of file
#include "StdAfx.h"
#include "EyetrackerImporter.h"
#include "DikablisConstants.h"
#include "Constants.h"
#include <qsize.h>
#include <algorithm>
#include <qdatetime.h>
#include <qdebug.h>
#include <iostream>
#include <fstream>
using namespace std;
EyetrackerImporter::EyetrackerImporter(QString filename, int timecolumn, int xcolumn, int ycolumn, int validcolumn, int header, QString sep)
:mFileName(filename), mTime(timecolumn-1), mX(xcolumn-1), mY(ycolumn-1), mValid(validcolumn-1), mHeaderSize(header), mSeparator(sep)
{
//qDebug () << filename << mTime << mX << mY << mValid << mHeaderSize << mSeparator;
}
EyetrackerImporter::EyetrackerImporter(QString filename, EyeTrackerConfig config)
:mFileName(filename)
{
mTime=config.timecolumn-1;
mX=config.xcolumn-1;
mY=config.ycolumn-1;
mValid=config.validcolumn-1;
mHeaderSize=config.header;
mSeparator=config.sep;
//qDebug () << filename << mTime << mX << mY << mValid << mHeaderSize << mSeparator;
}
EyetrackerImporter::~EyetrackerImporter(void)
{
}
void EyetrackerImporter::import(){
bool syncSet = false;
int length;
char * buffer;
ifstream is;
is.open (mFileName.toStdString().c_str(), ios::binary );
if(is.is_open()){
// get length of file:
is.seekg (0, ios::end);
length = is.tellg();
is.seekg (0, ios::beg);
// allocate memory:
buffer = new char [length];
// read data as a block:
is.read (buffer,length);
is.close();
//if(file.open(QIODevice::ReadOnly | QIODevice::Text)){
QTextStream in(buffer);
int lineNo=0;
while(!in.atEnd()){
QString line = in.readLine();
lineNo++;
if(lineNo<=mHeaderSize){
}
else{
// data
QStringList parts = line.split(mSeparator);
if(parts.size()<max(mTime, max(mX, max(mY, mValid)))){
qWarning() << "WARNING: EyeImporter: File entry has invalid length: \n"<< line;
}
else{
int timestamp = parts[mTime].toInt();
bool eye_valid = parts[mValid].toInt()==1;
int field_x = parts[mX].toInt();
int field_y = parts[mY].toInt();
GazePoint gazePoint(timestamp, field_x, field_y, eye_valid);
//qDebug() << timestamp << field_x << field_y << eye_valid;
this->notify(gazePoint);
}
}
}
delete[] buffer;
}
else{
qWarning() << "WARNING: Eyetracking file can not be opened or does not exist.";
}
}
\ No newline at end of file
/**
* Parse an arbitrary column-based eye-tracking format
**/
#pragma once
#include "stdafx.h"
#include <qstring.h>
#include <qstringlist.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qdebug.h>
#include <qdatetime.h>
#include "GazePoint.h"
#include "ObjectSource.h"
#include "EyeTracker.h"
class EyetrackerImporter : public ObjectSource<GazePoint>
{
public:
EyetrackerImporter(QString filename, int timecolumn, int xcolumn, int ycolumn, int validcolumn, int header, QString sep);
EyetrackerImporter(QString filename, EyeTrackerConfig config);
~EyetrackerImporter(void);
void import();
private:
QString mFileName;
int mTime;
int mX;
int mY;
int mValid;
int mHeaderSize;
QString mSeparator;
};
#pragma once
#include "stdafx.h"
enum HeatmapColormap{
// Red + Green is the standard way, but bad for colorblind people
// Blue has several nuances of blue and is better for colorblind
// Focalpoint only reveals the area around the current fixation target and blacks out everything else
RED_GREEN_MAP, BLUE_MAP, FOCAL_POINT
};
\ No newline at end of file
#include "StdAfx.h"
#include "LayerObject.h"
#include "ObjectManagement.h"
LayerObject::LayerObject(LayerObject * parent, LayerObjectType type, QString id)
: QTreeWidgetItem(parent, QTreeWidgetItem::UserType)
{
mType=type;
mId=id;
mVisible=true;
}
LayerObject::~LayerObject(void)
{
notifyListenersOfTermination();
}
void LayerObject::registerListener(ObjectManagement* manager){
mListeners.push_back(manager);
}
void LayerObject::removeListener(ObjectManagement* manager){
if(!mListeners.removeOne(manager))
qWarning() << "Listening Object Manager could not be deleted!";
}
void LayerObject::notifyListenersOfTermination(){
for(int i=0; i<mListeners.size(); i++){
mListeners[i]->layerWillTerminate(this);
}
}
/*
* This will be one layer in the layer view and therefore one item of data in the model.
* Still under development.
*/
#pragma once
#include "stdafx.h"
#include <qtreewidget.h>
class ObjectManagement;
enum LayerObjectType{
NONE, EYE_TRACKING, SCANPATH, VIDEO, IMAGE
};
class LayerObject : public QTreeWidgetItem
{
public:
LayerObject(LayerObject * parent, LayerObjectType type, QString id);
~LayerObject(void);
LayerObjectType getType(){
return mType;
}
QString getId(){
return mId;
}
void setVisible(bool visibility){
mVisible=visibility;
}
bool isVisible(){
return mVisible;
}
void registerListener(ObjectManagement* manager);
void removeListener(ObjectManagement* manager);
void notifyListenersOfTermination();
private:
QString mId;
LayerObjectType mType;
bool mVisible;
QList<ObjectManagement*> mListeners;
};
#include "StdAfx.h"
#include "LayerTreeItem.h"
LayerTreeItem::LayerTreeItem(QTreeWidget * parent, const QStringList & strings, LayerObject* object)
: QTreeWidgetItem(parent, strings, QTreeWidgetItem::UserType), mObject(object)
{
}
LayerTreeItem::~LayerTreeItem(void)
{
}
#pragma once
#include <qtreewidget.h>
#include "LayerObject.h"
class LayerTreeItem : public QTreeWidgetItem
{
public:
LayerTreeItem(QTreeWidget * parent, const QStringList & strings, LayerObject* object);
~LayerTreeItem(void);
LayerObject* getObject(){ return mObject; }
private:
LayerObject* mObject;
};
#include "StdAfx.h"
#include "ObjectManagement.h"
ObjectManagement::ObjectManagement(void)
{