Skip to content
Snippets Groups Projects
Commit dd294b60 authored by Ann Katrin's avatar Ann Katrin
Browse files

introduce TrackPersonReal.markerID and getter/setter functions + changed

txt output to TrackPersonReal instead of TrackPointReal
parent a063c66e
No related branches found
No related tags found
No related merge requests found
......@@ -101,6 +101,7 @@ private:
double mHeight; // height of the person
int mFirstFrame; // 0.. frame where the person was tracked the first time
int mLastFrame; // 0..
int mMarkerID = -1; //set to -1 as -1 does not naturally occur as a ArucoMarkerNumber-value
public:
TrackPersonReal();
......@@ -131,6 +132,14 @@ public:
{
mLastFrame = f;
}
inline int getMarkerID() const
{
return mMarkerID;
}
inline void setMarkerID(int markerID)
{
mMarkerID = markerID;
}
bool trackPointExist(int frame) const;
const TrackPointReal& trackPointAt(int frame) const; // & macht bei else probleme, sonst mit [] zugreifbar
// gibt -1 zurueck, wenn frame oder naechster frame nicht existiert
......@@ -140,7 +149,7 @@ public:
// double distanceXBetweenFrames(int fromFrame, int toFrame) const;
// double distanceYBetweenFrames(int fromFrame, int toFrame) const;
// double velocityToNextFrame(int frame) const;
void init(int firstFrame, double height);
void init(int firstFrame, double height, int markerID);
void addEnd(const QPointF& pos, int frame);
void addEnd(const Vec3F& pos, int frame);
void addEnd(const QPointF& pos, int frame, const QPointF &dir);
......
......@@ -78,12 +78,13 @@ double TrackPersonReal::distanceToNextFrame(int frame) const
else
return -1;
}
void TrackPersonReal::init(int firstFrame, double height)
void TrackPersonReal::init(int firstFrame, double height, int markerID)
{
clear();
mFirstFrame = firstFrame;
mLastFrame = firstFrame-1;
mHeight = height;
setMarkerID(markerID);
}
void TrackPersonReal::addEnd(const QPointF& pos, int frame)
......@@ -209,6 +210,7 @@ int TrackerReal::calculate(Tracker *tracker, ImageItem *imageItem, ColorPlot *co
int extrapolated;
QPointF colPos;
float angle;
int markerID;
for (i = 0; i < tracker->size(); ++i) // ueber trajektorien
{
......@@ -232,7 +234,10 @@ int TrackerReal::calculate(Tracker *tracker, ImageItem *imageItem, ColorPlot *co
//tmpMissingListAnz.removeFirst(); // anzahl
}
}
trackPersonReal.init(firstFrame+addFrames, height);
markerID = (*tracker)[i].getMarkerID(); // set markerID to TrackPerson.markerID
trackPersonReal.init(firstFrame+addFrames, height, markerID);
tsize = tracker->at(i).size();
for (j = 0; (j < tsize); ++j) // ueber trackpoints
{
......@@ -609,7 +614,7 @@ void TrackerReal::exportTxt(QTextStream &out, bool alternateHeight, bool useTrac
out << " " << at(i).at(j).angleOfView() << endl;
if (exportMarkerID)
out << " " << at(i).at(j).getMarkerID() << endl;
out << " " << at(i).getMarkerID() << endl;
else
out << endl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment