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
ae2e2860
Commit
ae2e2860
authored
2 years ago
by
d.kilic
Browse files
Options
Downloads
Plain Diff
Merge branch '363-cli-option-autointrinsic-not-documented' into 'master'
Change command line help string generation Closes
#363
See merge request
!252
parents
f9ecfaa6
31973d83
No related branches found
No related tags found
1 merge request
!252
Change command line help string generation
Pipeline
#89466
passed
2 years ago
Stage: build_environment
Stage: pre-build-checks
Stage: build
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/helper.h
+2
-2
2 additions, 2 deletions
include/helper.h
src/helper.cpp
+57
-41
57 additions, 41 deletions
src/helper.cpp
with
59 additions
and
43 deletions
include/helper.h
+
2
−
2
View file @
ae2e2860
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
#include
<QString>
#include
<QString>
#include
<opencv2/opencv.hpp>
#include
<opencv2/opencv.hpp>
extern
QString
commandLineOptionsString
;
extern
const
QString
commandLineOptionsString
;
extern
QString
proFileName
;
///< Path to the project (.pet) file; defined in helper.cpp
extern
QString
proFileName
;
///< Path to the project (.pet) file; defined in helper.cpp
constexpr
const
char
*
file_name
(
const
char
*
path
)
constexpr
const
char
*
file_name
(
const
char
*
path
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/helper.cpp
+
57
−
41
View file @
ae2e2860
...
@@ -23,47 +23,63 @@
...
@@ -23,47 +23,63 @@
#include
<opencv2/opencv.hpp>
#include
<opencv2/opencv.hpp>
QString
proFileName
;
///< Path to the project (.pet) file; used for saving relative paths via getFileList and
QString
proFileName
;
///< Path to the project (.pet) file; used for saving relative paths via getFileList and
///< getExistingFile
///< getExistingFile
QString
commandLineOptionsString
=
QObject
::
tr
(
const
QString
commandLineOptionsString
=
[]()
->
QString
"<p><code>petrack [-help|-?] [[-project] project.pet] </code><br>"
{
" <code>[-sequence imageSequenceOrVideo]</code><br>"
const
std
::
vector
<
std
::
pair
<
QString
,
QString
>>
options
{
" <code>[-autoSave|-autosave "
{
"-sequence imageSequenceOrVideo"
,
"imgFldOrVideo|proj.pet|trackerFile]</code></code><br>"
"loads image sequence or video; option overwrites <kbd>SRC</kbd> attribute in project file"
},
" <code>[-autoTrack|-autotrack trackerFile]</code><br>"
{
"-autoSave|-autosave imgFldOrVideo|proj.pet|trackerFile"
,
" <code>[-autoReadMarkerID|-autoreadmarkerid "
"if the argument ends with <kbd>pet</kbd>, a project file will be written to <kbd>proj.pet</kbd> at the end; "
"markerIdFile]</code><br>"
"if the argument ends with <kbd>txt,dat </kbd>or<kbd> trav</kbd>, the trajectories will be written in a "
" <code>[-autoReadHeight|-autoreadheight "
"format according to the suffix of <kbd>trackerFile</kbd>; otherwise <kbd>imgFldOrVideo</kbd> is the folder "
"heightFile]</code><br>"
"to store the image sequence or a name of a video file for the direct export; in all cases <kbd>PeTrack</kbd> "
" <code>[-autoPlay|-autoplay trackerFile]</code><br>"
"ends after finishing the work"
},
" <code>[-autoExportView|-autoexportview "
{
"-autoTrack|-autotrack trackerFile"
,
"outputFile]</code></p>"
"calculates automatically the trajectories of marked pedestrians and stores the result to "
"<dl><dt><kbd>-help|-?</kbd></dt><dd>shows help information for command line options</dd>"
"<kbd>trackerFile</kbd>"
},
"<dt><kbd>-project</kbd></dt><dd>optional option to set project file; otherwise the argument without option flag "
{
"-autoReadMarkerID|-autoreadmarkerid markerIdFile"
,
"is used as project file</dd>"
"automatically reads the <kbd>txt-file</kbd> including personID and markerID and applies the markerIDs to the "
"<dt><kbd>-sequence imageSequenceOrVideo</kbd></dt><dd>loads image sequence or video; option overwrites "
"corresponding person. If -autoTrack is not used, saving trackerFiles using -autoSaveTracker is recommended."
},
"<kbd>SRC</kbd> attribute in project file</dd>"
{
"-autoReadHeight|-autoreadheight heightFile"
,
"<dt><kbd>-autoSave|-autosave imgFldOrVideo|proj.pet|trackerFile</kbd></dt><dd>if the argument ends with "
"automatically reads the <kbd>trackerFile</kbd> "
"<kbd>pet</kbd>, a project file will be written to <kbd>proj.pet</kbd> at the end; if the argument ends with "
"including markerID and individual height and applies the heights to the corresponding person"
},
"<kbd>txt,dat </kbd>or<kbd> trav</kbd>, the trajectories will be written in a format according to the suffix of "
{
"-autoPlay|-autoplay trackerFile"
,
"<kbd>trackerFile</kbd>; otherwise <kbd>imgFldOrVideo</kbd> is the folder to store the image sequence or a name of "
"plays the video or image sequence and stores the "
"a video file for the direct export; in all cases <kbd>PeTrack</kbd> ends after finishing the work</dd>"
"trajectories to <kbd>trackerFile</kbd>"
},
"<dt><kbd>-autoTrack|-autotrack trackerFile</kbd></dt><dd>calculates automatically the trajectories of marked "
{
"-autoExportView|-autoexportview outputFile"
,
"pedestrians and stores the result to <kbd>trackerFile</kbd></dd>"
"exports the view, e.g., the undistorted video "
"<dt><kbd>-autoReadMarkerID|-autoreadmarkerid markerFile</kbd></dt><dd> automatically reads the "
"or the video with trajectories, to <kbd>outputFile</kbd>"
},
"<kbd>txt-file</kbd> including personID and markerID and applies the markerIDs to the corresponding person. If "
{
"-autoIntrinsic | -autointrinsic calibDir"
,
"-autoTrack is not used, saving trackerFiles using -autoSaveTracker is recommended.</dd>"
"performs intrinsic calibration with the files in <kbd>calibDir</kbd>. Saving the pet-file with "
"<dt><kbd>-autoReadHeight|-autoreadheight heightFile</kbd></dt><dd> automatically reads the <kbd>trackerFile</kbd> "
"<kbd>-autoSave</kbd> is recommended, since else the calculated parameters will be lost."
}};
"including markerID and individual height and applies the heights to the corresponding person</dd>"
"<dt><kbd>-autoPlay|-autoplay trackerFile</kbd></dt><dd>plays the video or image sequence and stores the "
// help and project are supposed to be on the same line as petrack
"trajectories to <kbd>trackerFile</kbd></dd>"
// therefore they are handled separately
"<dt><kbd>-autoExportView|-autoexportview outputFile</kbd></dt><dd>exports the view, e.g., the undistorted video "
QString
petrackCall
{
"<p><code>petrack [-help|-?] [[-project] project.pet]</code><br>"
};
"or the video with trajectories, to <kbd>outputFile</kbd></dd></dl>"
QString
allExplanations
{
"<dl><dt><kbd>-help|-?</kbd></dt><dd>shows help information for command line "
"<p>Example:<br>To generate trajectories from a single image sequence starting with <kbd>frame000.jpg</kbd>"
"options</dd><dt><kbd>-project</kbd></dt><dd>optional option to set project file; "
"with settings stored in the project file <kbd>project.pet</kbd>, export tracker file <kbd>trackerFile</kbd>"
"otherwise the argument without option flag is used as project file</dd>"
};
"and exit with saving the project to <kbd>project.pet</kbd> again:</p>"
for
(
const
auto
&
[
command
,
explanation
]
:
options
)
"<p><code>petrack.exe -project project.pet -sequence frame000.jpg</code><br>"
{
" <code>-autoTrack trackerFile -autoSave "
petrackCall
+=
"project.pet</code></p>"
);
QString
{
" <code>[%1]</code><br>"
}.
arg
(
command
);
allExplanations
+=
QString
{
"<dt><kbd>%1</kbd></dt><dd>%2</dd>"
}.
arg
(
command
,
explanation
);
}
petrackCall
+=
QString
{
"</p>"
};
allExplanations
+=
QString
{
"</dl>"
};
const
QString
example
{
"<p>Example:<br>To generate trajectories from a single image sequence starting with <kbd>frame000.jpg</kbd>"
"with settings stored in the project file <kbd>project.pet</kbd>, export tracker file <kbd>trackerFile</kbd>"
"and exit with saving the project to <kbd>project.pet</kbd> again:</p>"
"<p><code>petrack.exe -project project.pet -sequence frame000.jpg</code><br>"
" <code>-autoTrack trackerFile -autoSave "
"project.pet</code></p>"
};
return
petrackCall
+
allExplanations
+
example
;
}();
void
copyToQImage
(
QImage
&
qImg
,
cv
::
Mat
&
img
)
// war static functin in animatioln class
void
copyToQImage
(
QImage
&
qImg
,
cv
::
Mat
&
img
)
// war static functin in animatioln class
...
...
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