Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PeTrack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pedestrian Dynamics Empiricism
PeTrack
Commits
dd294b60
Commit
dd294b60
authored
4 years ago
by
Ann Katrin
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/trackerReal.h
+10
-1
10 additions, 1 deletion
include/trackerReal.h
src/trackerReal.cpp
+8
-3
8 additions, 3 deletions
src/trackerReal.cpp
with
18 additions
and
4 deletions
include/trackerReal.h
+
10
−
1
View file @
dd294b60
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
src/trackerReal.cpp
+
8
−
3
View file @
dd294b60
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment