PARP Research Group | Universidad de Murcia |
Command line parametersThe QVApplication object can detect the dynamic properties contained in processing blocks or camera objects created in a QVision application. It also parses the input console command line used to launch the application. So the user of the application can set the starting values of dynamic properties of certain types from the command line. Dynamic properties initializable from the command line are input properties of type integer (int), double (double), boolean (bool), or character strings (QString). Using the --help command line parameter, every QVision application displays an usage reference text, listing for each block created by the application, the dynamic properties assignable through the command line. Extra information is listed, such as their valid value range, their default value, and a short description for them. For example, a QVision application named test could be executed with the following command line: ./test --help It will display the following message: Usage: ./test [OPTIONS] QVision application which... (some sort description here, as given to the QVApplication constructor by the programmer). Input parameters for Video: --max block iterations=[int] (def. -1) ............Maximal number of iterations to execute block. --stats enabled=[true,false] (def. true) ....................Block CPU stats are enabled/disabled. --stats printing frequency=[int] (def. 0) .......Frequency to print CPU statistics (in iterations). --NoLoop=[true,false](def. false) ..................If the camera should be opened in no loop mode. --URL=[text] (def. '') ............................................URL of the video source to read. --Cols=[int] (def. 0) ....................................Suggested number of columns of the video. --Rows=[int] (def. 0) .......................................Suggested number of rows of the video. --RealTime=[true,false](def. false) ..............If the camera should be opened in real time mode. --Deinterlaced=[true,false](def. false) .......If the camera should be opened in deinterlaced mode. Input parameters for Canny Operator Block: --max block iterations=[int] (def. -1) ............Maximal number of iterations to execute block. --stats enabled=[true,false] (def. true) ....................Block CPU stats are enabled/disabled. --stats printing frequency=[int] (def. 0) .......Frequency to print CPU statistics (in iterations). --cannyHigh=[50...1000] (def. 150) ..............................High threshold for Canny operator. --cannyLow=[10...500] (def. 50) ..................................Low threshold for Canny operator. --applyIPE=[true,false](def. false) .........................If we want to apply the IPE algorithm. --paramIPE=[1...25] (def. 5) ........................IPE parameter (max. allowed distance to line). --intersectLines=[true,false] (def. true) If we want IPE to postprocess polyline (intersecting lines). --minLengthContour=[1...150] (def. 25) ...............Minimal length of a contour to be considered. [...] [...Some other input parameters corresponding to other processing blocks...] We can see, for example, that the Canny Operator Block includes an input property named cannyHigh, of double type. This property has a valid range of values between 50 and 1000, and its default value is 150. Along with a short text definition for the property (High threshold for Canny operator), all these characteristics are specified in the call to the method QVPropertyContainer::addProperty which adds the property in the constructor of the processing block object: class QVCannyEdgeDetector: public QVProcessingBlock { public: QVCannyEdgeDetector(QString name): QVProcessingBlock(name) { addProperty<double>("cannyHigh", inputFlag, 150, "High threshold for Canny operator", 50, 1000); [...] } [...] } The following command line starts the application, specifying some initial values for the property URL in the camera object (with a given video source URL, see section QVMPlayerURLFormat for details), and the property cannyHigh in the Canny Operator Block object: ./test --URL=http://perception.inf.um.es/videos/misc/penguin.dv --cannyHigh=300
The command line parameters specifying values for the processing block properties must be separated by spaces in the command line. They must start with a double dash, followed by the name of the property (which must itself be quoted if it contains spaces; for example, --"some property"=1000). Next must follow an = (equal sign), and the value we want to initially store in the property. Optionally, the name of the processing block can be specified in the parameter, between the double dash and the property name, to resolve name conflicts, when two processing blocks have a property referenced with the same name. For example, the previous command would be equivalent to the following: ./qvapplication --Video:URL=http://perception.inf.um.es/public_data/videos/misc/penguin.dv --"Canny Operator Block":"cannyHigh"=100
In case of unresolved name conflict, every property with the given name of every processing block in the application will be initialized with the given value. |