Skip to content
Snippets Groups Projects
Commit 31973d83 authored by d.kilic's avatar d.kilic
Browse files

Change command line help string generation

- Also add -autoIntrinsic documentation
parent f9ecfaa6
No related branches found
No related tags found
1 merge request!252Change command line help string generation
...@@ -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)
{ {
......
...@@ -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>" {
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>[-sequence imageSequenceOrVideo]</code><br>" const std::vector<std::pair<QString, QString>> options{
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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"},
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>[-autoTrack|-autotrack trackerFile]</code><br>" {"-autoSave|-autosave imgFldOrVideo|proj.pet|trackerFile",
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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 "
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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> "
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>[-autoPlay|-autoplay trackerFile]</code><br>" "ends after finishing the work"},
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>" {
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>-autoTrack trackerFile -autoSave " petrackCall +=
"project.pet</code></p>"); QString{"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>"
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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
......
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