Commit 91974b4c9fbb5f3a85e31e5bc9342a8b626df468

Authored by Jordan Cheney
1 parent efe86ab6

Updates to UI and more documentation

docs/docs/docs/c_api.md
  1 +The C API is a high-level API for running algorithms and evaluating results.
  2 +
  3 +In order to provide a high-level interface that is usable from the command line and callable from other programming languages, the API is designed to operate at the "file system" level.
  4 +In other words, arguments to many functions are file paths that specify either a source of input or a desired output.
  5 +File extensions are relied upon to determine *how* files should be interpreted in the context of the function being called.
  6 +The [C++ Plugin API](cpp_api.md) should be used if more fine-grained control is required.
  7 +
  8 +Import API considerations include-
  9 +
  10 +* Memory for <tt>const char*</tt> return values is managed internally and guaranteed until the next call to the function
  11 +* Users should input a char * buffer and the size of that buffer. String data will be copied into the buffer, if the buffer is too small, only part of the string will be copied. Returns the buffer size required to contain the complete string.
  12 +
  13 +To use the API in your project use-
  14 +
  15 + #include <openbr/openbr.h>
  16 +
  17 +[CMake](http://www.cmake.org/) developers may wish to the cmake configuration file found at
  18 +
  19 + share/openbr/cmake/OpenBRConfig.cmake
  20 +
  21 +Please see the [tutorials](../tutorials.md) section for examples.
  22 +
  23 +---
  24 +
  25 +# Typedefs
  26 +
  27 +## void *br_template
  28 +
  29 +## void *br_template_list
  30 +
  31 +## void *br_gallery
  32 +
  33 +## void *br_matrix_output
  34 +
  35 +---
  36 +
  37 +# Functions
  38 +
  39 +## br_about
  40 +
  41 +Wraps [Context](cpp_api.md#context)
  42 +
  43 +* **return type:** const char *
  44 +* **parameters:** None
  45 +* **example call:** ```const char *br_about()```
  46 +* **see:** [br_version](#br_version)
  47 +
  48 +---
  49 +
  50 +## br_cat
  51 +
  52 +Concatenates a list of galleries into 1 gallery.
  53 +
  54 +* **return type:** void
  55 +* **parameters:**
  56 +
  57 +Parameter | Type | Description
  58 +--- | --- | ---
  59 + num_input_galleries | int | Parameter description
  60 +input_galleries[] | const char * | Parameter description
  61 +output_gallery | const char * | Parameter description
  62 +
  63 +* **example call:** ```void br_cat(int num_input_galleries, const char *input_galleries[], const char *output_gallery)```
  64 +
  65 +---
  66 +
  67 +## br_deduplicate
  68 +
  69 +Removes duplicate [templates](cpp_api.md#template) in a [gallery](cpp_api.md#gallery). If a galley contains n duplicates, the first n-1 duplicates in the gallery will be removed and the nth will be kept. Users are encouraged to use binary gallery formats as the entire gallery is read into memory in one call to [Gallery](cpp_api.md#gallery)::read.
  70 +
  71 +* **return type:** void
  72 +* **parameters:**
  73 +
  74 +Parameter | Type | Description
  75 +--- | --- | ---
  76 +input_gallery | const char * | Gallery to be deduplicated
  77 +output_gallery | const char * | Deduplicated gallery
  78 +threshold | const char * | Comparisons with a match score >= this value are designated to be duplicates.
  79 +
  80 +* **example call:** ```void br_deduplicate(const char *input_gallery, const char *output_gallery, const char *threshold)```
  81 +
  82 +---
  83 +
  84 +## br_cluster
  85 +
  86 +\brief Clusters one or more similarity matrices into a list of subjects. A [similarity matrix](../technical.md#the-evaluation-harness) is a type of [Output](cpp_api.md#output). The current clustering algorithm is a simplified implementation of \cite zhu11.
  87 +
  88 +* **return type:** void
  89 +* **parameters:**
  90 +
  91 +Parameter | Type | Description
  92 +--- | --- | ---
  93 +num_simmats | int | Size of **simmats**
  94 +simmats[] | const char * | Array of [simmat](../technical.md#the-evaluation-harness) composing one large self-similarity matrix arranged in row major order.
  95 +aggressiveness | float | The higher the aggressiveness the larger the clusters. Suggested range is [0,10]
  96 +csv | const char * | The cluster results file to generate. Results are stored one row per cluster and use gallery indices.
  97 +
  98 +* **example call:** ```void br_cluster(int num_simmats, const char *simmats[], float aggressiveness, const char *csv)```
  99 +
  100 +---
  101 +
  102 +## br_combine_masks
  103 +
  104 +Combines several equal-sized mask matrices. A comparison may not be simultaneously indentified as both a genuine and an imposter by different input masks.
  105 +
  106 +* **return type:** void
  107 +* **parameters:**
  108 +
  109 +Parameter | Type | Description
  110 +--- | --- | ---
  111 +num_input_masks | int | Size of **input_masks**
  112 +input_masks[] | const char * | Array of [mask matrices](../technical.md#the-evaluation-harness) to combine. All matrices must have the same dimensions.
  113 +output_mask | const char * | The file to contain the resulting [mask matrix](../technical.md#the-evaluation-harness)
  114 +method | const char * | Possible values are: <ul><li>And - Ignore comparison if *any* input masks ignore.</li> <li>Or - Ignore comparison if *all* input masks ignore.</li></ul>
  115 +
  116 +* **example call:** ```void br_combine_masks(int num_input_masks, const char *input_masks[], const char *output_mask, const char *method)```
  117 +* **see:** [br_make_mask](#br_make_mask)
  118 +
  119 +---
  120 +
  121 +## br_compare
  122 +
  123 +Compares each template in the query gallery to each template in the target gallery.
  124 +
  125 +* **return type:** void
  126 +* **parameters:**
  127 +
  128 +Parameter | Type | Description
  129 +--- | --- | ---
  130 +target_gallery | const char * | target_gallery The br::Gallery file whose templates make up the columns of the output.
  131 +query_gallery | const char * | The br::Gallery file whose templates make up the rows of the output. A value of '.' reuses the target gallery as the query gallery.
  132 +output | const char * | (Optional) [Output](cpp_api.md#output) file to contain the results of comparing the templates. The default behavior is to print scores to the terminal.
  133 +
  134 +* **example call:** ```void br_compare(const char *target_gallery, const char *query_gallery, const char *output = "")```
  135 +* **see:** br_enroll
  136 +
  137 +---
  138 +
  139 +## br_compare_n
  140 +
  141 +Convenience function for comparing to multiple targets.
  142 +
  143 +* **return type:** void
  144 +* **parameters:**
  145 +
  146 +Parameter | Type | Description
  147 +--- | --- | ---
  148 +num_targets | int | Size of **target_galleries**
  149 +target_galleries[] | const char * | Target galleries to compare against
  150 +query_gallery | const char * | query gallery for comparison.
  151 +output | const char * | (Optional) [Output](cpp_api.md#output) file to contain the results of comparing the templates. The default behavior is to print scores to the terminal.
  152 +
  153 +* **example call:** ```void br_compare_n(int num_targets, const char *target_galleries[], const char *query_gallery, const char *output)```
  154 +* **see:** br_compare
  155 +
  156 +---
  157 +
  158 +## br_pairwise_compare
  159 +
  160 +DOCUMENT ME!
  161 +
  162 +* **return type:** void
  163 +* **parameters:**
  164 +
  165 +Parameter | Type | Description
  166 +--- | --- | ---
  167 +target_gallery | const char * | DOCUMENT ME
  168 +query_gallery | const char * | DOCUMENT ME
  169 +output | const char * | DOCUMENT ME
  170 +
  171 +* **example call:** ```void br_pairwise_compare(const char *target_gallery, const char *query_gallery, const char *output = "")```
  172 +
  173 +---
  174 +
  175 +## br_convert
  176 +
  177 +Convert a file to a different type. Files can only be converted to types within the same group. For example [formats](cpp_api.md#format) can only be converted to other [formats](cpp_api.md#format).
  178 +
  179 +* **return type:** void
  180 +* **parameters:**
  181 +
  182 +Parameter | Type | Description
  183 +--- | --- | ---
  184 +file_type | const char * | Type of file to convert. Options are Format, Gallery or Output.
  185 +input_file | const char * | File to convert.
  186 +output_file | const char * | Output file. Type is determined by the file extension.
  187 +
  188 +* **example call:** ```void br_convert(const char *file_type, const char *input_file, const char *output_file)```
  189 +
  190 +---
  191 +
  192 +## br_enroll
  193 +
  194 +Constructs template(s) from an input.
  195 +
  196 +* **return type:** void
  197 +* **parameters:**
  198 +
  199 +Parameter | Type | Description
  200 +--- | --- | ---
  201 +input | const char * | The [format](cpp_api.md#format) or [gallery](cpp_api.md#gallery) to enroll.
  202 +gallery | const char * | (Optional) The [Gallery](cpp_api.md#gallery) file to contain the enrolled templates. By default the gallery will be held in memory and *input* can used as a gallery in [br_compare](#br_compare)
  203 +
  204 +* **example call:** ```void br_enroll(const char *input, const char *gallery = "")```
  205 +* **see:** [br_enroll_n](#br_enroll_n)
  206 +
  207 +---
  208 +
  209 +## br_enroll_n
  210 +
  211 +Convenience function for enrolling multiple inputs.
  212 +
  213 +* **return type:** void
  214 +* **parameters:**
  215 +
  216 +Parameter | Type | Description
  217 +--- | --- | ---
  218 +num_inputs | int | Size of **inputs**.
  219 +inputs[] | const char * | Array of inputs to enroll.
  220 +gallery | const char * | (Optional) The [Gallery](cpp_api.md#gallery) file to contain the enroll templates.
  221 +
  222 +* **example call:** ```void br_enroll_n(int num_inputs, const char *inputs[], const char *gallery = "")```
  223 +* **see:** [br_enroll](#br_enroll)
  224 +
  225 +---
  226 +
  227 +## br_project
  228 +
  229 +A naive alternative to [br_enroll](#br_enroll).
  230 +
  231 +* **return type:** void
  232 +* **parameters:**
  233 +
  234 +Parameter | Type | Description
  235 +--- | --- | ---
  236 +input | const char * | DOCUMENT ME!
  237 +output | const char * | DOCUMENT ME!
  238 +
  239 +* **example call:** ```void br_project(const char *input, const char *output)```
  240 +* **see:** [br_enroll](#br_enroll)
  241 +
  242 +---
  243 +
  244 +## br_eval
  245 +
  246 +Creates a **.csv** file containing performance metrics from evaluating the similarity matrix using the mask matrix. The return value is the true accept rate at a false accept rate of one in one thousand.
  247 +
  248 +* **return type:** float
  249 +* **parameters:**
  250 +
  251 +Parameter | Type | Description
  252 +--- | --- | ---
  253 +simmat | const char * | The [simmat](../technical.md#the-evaluation-harness) to use
  254 +mask | const char * | The [mask](../technical.md#the-evaluation-harness) to use.
  255 +csv | const char * | (Optional) The **.csv** file to contain performance metrics.
  256 +matches | int | (Optional) An integer number of matches to output around the EER. Default is 0.
  257 +
  258 +* **example call:** ```float br_eval(const char *simmat, const char *mask, const char *csv = "", int matches = 0)```
  259 +* **see:** [br_plot](#br_plot)
  260 +
  261 +---
  262 +
  263 +## br_assert_eval
  264 +
  265 +Evaluates the similarity matrix using the mask matrix. Function aborts ff TAR @ FAR = 0.001 does not meet an expected performance value.
  266 +
  267 +* **return type:** void
  268 +* **parameters:**
  269 +
  270 +Parameter | Type | Description
  271 +--- | --- | ---
  272 +simmat | const char * | The [simmat](../technical.md#the-evaluation-harness) to use
  273 +mask | const char * | The [mask](../technical.md#the-evaluation-harness)
  274 +accuracy | const float | Desired true accept rate at false accept rate of one in one thousand.
  275 +
  276 +* **example call:** ```void br_assert_eval(const char *simmat, const char *mask, const float accuracy)```
  277 +
  278 +---
  279 +
  280 +## br_inplace_eval
  281 +
  282 +Creates a **.csv** file containing performance metrics from evaluating the similarity matrix using galleries containing ground truth labels.
  283 +
  284 +* **return type:** float
  285 +* **parameters:**
  286 +
  287 +Parameter | Type | Description
  288 +--- | --- | ---
  289 +simmat | const char * | The [simmat](../technical.md#the-evaluation-harness)
  290 +target | const char * | The name of a gallery containing metadata for the target set.
  291 +query | const char * | The name of a gallery containing metadata for the query set.
  292 +csv | const char * | (Optional) The **.csv** file to contain performance metrics.
  293 +
  294 +* **example call:** ```float br_inplace_eval(const char * simmat, const char *target, const char *query, const char *csv = "")```
  295 +* **see:** [br_plot](#br_plot)
  296 +
  297 +---
  298 +
  299 +## br_eval_classification
  300 +
  301 +Evaluates and prints classification accuracy to terminal.
  302 +
  303 +* **return type:** void
  304 +* **parameters:**
  305 +
  306 +Parameter | Type | Description
  307 +--- | --- | ---
  308 +predicted_gallery | const char * | The predicted [Gallery](cpp_api.md#gallery).
  309 +truth_gallery | const char * | The ground truth [Gallery](cpp_api.md#gallery).
  310 +predicted_property | const char * | (Optional) Which metadata key to use from the **predicted_gallery**.
  311 +truth_property | const char * | (Optional) Which metadata key to use from the **truth_gallery**.
  312 +
  313 +* **example call:** ```void br_eval_classification(const char *predicted_gallery, const char *truth_gallery, const char *predicted_property = "", const char *truth_property = "")```
  314 +
  315 +---
  316 +
  317 +## br_eval_clustering
  318 +
  319 +Evaluates and prints clustering accuracy to the terminal.
  320 +
  321 +* **return type:** void
  322 +* **parameters:**
  323 +
  324 +Parameter | Type | Description
  325 +--- | --- | ---
  326 +csv | const char * | The cluster results file.
  327 +gallery | const char * | The [Gallery](cpp_api.md#gallery) used to generate the [simmat](../technical.md#the-evaluation-harness) that was clustered.
  328 +truth_property | const char * | (Optional) which metadata key to use from **gallery**, defaults to Label
  329 +
  330 +* **example call:** ```void br_eval_clustering(const char *csv, const char *gallery, const char * truth_property)```
  331 +
  332 +---
  333 +
  334 +## br_eval_detection
  335 +
  336 +Evaluates and prints detection accuracy to terminal.
  337 +
  338 +* **return type:** float
  339 +* **parameters:**
  340 +
  341 +Parameter | Type | Description
  342 +--- | --- | ---
  343 +predicted_gallery | const char * | The predicted [Gallery](cpp_api.md#gallery).
  344 +truth_gallery | const char * | The ground truth [Gallery](cpp_api.md#gallery).
  345 +csv | const char * | (Optional) The **.csv** file to contain performance metrics.
  346 +normalize | bool | (Optional) Flag to normalize predicted bounding boxes for improved detection. Defaults to false.
  347 +minSize | int | (Optional) Minimum size of faces to be considered in the evaluation. Size is applied to predicted and ground truth galleries. Defaults to -1 (no minimum size).
  348 +maxSize | int | (Optional) Maximum size if faces to be considered in the evaluation. Size is applied to predicted and ground truth galleries. Defaults to -1 (no maximum size).
  349 +
  350 +* **example call:** ```float br_eval_detection(const char *predicted_gallery, const char *truth_gallery, const char *csv = "", bool normalize = false, int minSize = 0, int maxSize = 0)```
  351 +
  352 +---
  353 +
  354 +## br_eval_landmarking
  355 +
  356 +Evaluates and prints landmarking accuracy to terminal.
  357 +
  358 +* **return type:** float
  359 +* **parameters:**
  360 +
  361 +Parameter | Type | Description
  362 +--- | --- | ---
  363 +predicted_gallery | const char * | The predicted [Gallery](cpp_api.md#gallery).
  364 +truth_gallery | const char * | The ground truth [Gallery](cpp_api.md#gallery).
  365 +csv | const char * | (Optional) The **.csv** file to contain performance metrics.
  366 +normalization_index_a | int | (Optional) The first index in the list of points to use for normalization. Default is 0.
  367 +normalization_index_b | int | (Optional) The second index in the list of points to use for normalization. Default is 1.
  368 +sample_index | int | (Optional) The index for sample landmark image in ground truth gallery. Default = 0.
  369 +total_examples | int | (Optional) The number of accurate and inaccurate examples to display. Default is 5.
  370 +
  371 +* **example call:** ```float br_eval_landmarking(const char *predicted_gallery, const char *truth_gallery, const char *csv = "", int normalization_index_a = 0, int normalization_index_b = 1, int sample_index = 0, int total_examples = 5)```
  372 +
  373 +---
  374 +
  375 +## br_eval_regression
  376 +
  377 +Evaluates regression accuracy to disk.
  378 +
  379 +* **return type:** void
  380 +* **parameters:**
  381 +
  382 +Parameter | Type | Description
  383 +--- | --- | ---
  384 +predicted_gallery | const char * | The predicted [Gallery](cpp_api.md#gallery)
  385 +truth_gallery | const char * | The ground truth [Gallery](cpp_api.md#gallery)
  386 +predicted_property | const char * | (Optional) Which metadata key to use from **predicted_gallery**.
  387 +truth_property | const char * | (Optional) Which metadata key to use from **truth_gallery**.
  388 +
  389 +* **example call:** ```void br_eval_regression(const char *predicted_gallery, const char *truth_gallery, const char *predicted_property = "", const char *truth_property = "")```
  390 +
  391 +---
  392 +
  393 +## br_fuse
  394 +
  395 +Perform score level fusion on similarity matrices.
  396 +
  397 +* **return type:** void
  398 +* **parameters:**
  399 +
  400 +Parameter | Type | Description
  401 +--- | --- | ---
  402 +num_input_simmats | int | Size of **input_simmats**.
  403 +input_simmats[] | const char * | Array of [simmats](../technical.md#the-evaluation-harness). All simmats must have the same dimensions.
  404 +normalization | const char * | Valid options are: <ul> <li>None - No score normalization.</li> <li>MinMax - Scores normalized to [0,1].</li> <li>ZScore - Scores normalized to a standard normal curve.</li> </ul>
  405 +fusion | const char * | Valid options are: <ul> <li>Min - Uses the minimum score.</li> <li>Max - Uses the maximum score.</li> <li>Sum - Sums the scores. Sums can also be weighted: <tt>SumW1:W2:...:Wn</tt>.</li> <li>Replace - Replaces scores in the first matrix with scores in the second matrix when the mask is set.</li> </ul>
  406 +output_simmat | const char * | [Simmat](../technical.md#the-evaluation-harness) to contain the fused scores.
  407 +
  408 +* **example call:** ```void br_fuse(int num_input_simmats, const char *input_simmats[],
  409 + const char *normalization, const char *fusion, const char *output_simmat)```
  410 +
  411 +---
  412 +
  413 +## br_initialize
  414 +
  415 +Initializes the [Context](cpp_api.md#context). Required at the beginning of any OpenBR program.
  416 +
  417 +* **return type:** void
  418 +* **parameters:**
  419 +
  420 +Parameter | Type | Description
  421 +--- | --- | ---
  422 +argc | int | Number of command line arguments.
  423 +argv[] | char * | Array of command line arguments.
  424 +sdk_path | const char * | (Optional) Path to the OpenBR sdk. If no path is provided OpenBR will try and find the sdk automatically.
  425 +use_gui | bool | Enable OpenBR to use make GUI windows. Default is false.
  426 +
  427 +* **example call:** ```void br_initialize(int &argc, char *argv[], const char *sdk_path = "", bool use_gui = false)```
  428 +* **see:** [br_finalize](#br_finalize)
  429 +
  430 +---
  431 +
  432 +## br_initialize_default
  433 +
  434 +Initializes the [Context](cpp_api.md#context) with default arguments.
  435 +
  436 +* **return type:** void
  437 +* **parameters:** None
  438 +* **example call:** ```void br_initialize_default()```
  439 +* **see:** [br_finalize](#br_finalize)
  440 +
  441 +---
  442 +
  443 +## br_finalize
  444 +
  445 +Finalizes the context. Required at the end of any OpenBR program.
  446 +
  447 +* **return type:** void
  448 +* **parameters:** None
  449 +* **example call:** ```void br_finalize()```
  450 +* **see:** [br_initialize](#br_initialize)
  451 +
  452 +---
  453 +
  454 +## br_is_classifier
  455 +
  456 +Checks if the provided algorithm is a classifier. Wrapper of [cpp_api.md#bool-isclassifierconst-qstring-algorithm].
  457 +
  458 +* **return type:** bool
  459 +* **parameters:**
  460 +
  461 +Parameter | Type | Description
  462 +--- | --- | ---
  463 +algorithm | const char * | Algorithm to check.
  464 +
  465 +* **example call:** ```bool br_is_classifier(const char *algorithm)```
  466 +
  467 +---
  468 +
  469 +## br_make_mask
  470 +
  471 +Constructs a [mask](../technical.md#the-evaluation-harness) from target and query inputs.
  472 +
  473 +* **return type:** void
  474 +* **parameters:**
  475 +
  476 +Parameter | Type | Description
  477 +--- | --- | ---
  478 +target_input | const char * | The target [Gallery](cpp_api.md#gallery)
  479 +query_input | const char * | The query [Gallery](cpp_api.md#gallery)
  480 +mask | const char * | The file to contain the resulting [mask](../technical.md#the-evaluation-harness).
  481 +
  482 +* **example call:** ```void br_make_mask(const char *target_input, const char *query_input, const char *mask)```
  483 +* **see:** [br_combine_masks](#br_combine_masks)
  484 +
  485 +---
  486 +
  487 +## br_make_pairwise_mask
  488 +
  489 +Constructs a [mask](../technical.md#the-evaluation-harness) from target and query inputs considering the target and input sets to be definite pairwise comparisons.
  490 +
  491 +* **return type:** void
  492 +* **parameters:**
  493 +
  494 +Parameter | Type | Description
  495 +--- | --- | ---
  496 +target_input | const char * | The target [Gallery](cpp_api.md#gallery)
  497 +query_input | const char * | The query [Gallery](cpp_api.md#gallery)
  498 +mask | const char * | The file to contain the resulting [mask](../technical.md#the-evaluation-harness).
  499 +
  500 +* **example call:** ```void br_make_pairwise_mask(const char *target_input, const char *query_input, const char *mask)```
  501 +* **see:** [br_combine_masks](#br_combine_masks)
  502 +
  503 +---
  504 +
  505 +## br_most_recent_message
  506 +
  507 +Returns the most recent line sent to stderr. Please see the bullet about input string buffers at the top of this page.
  508 +
  509 +* **return type:** int
  510 +* **parameters:**
  511 +
  512 +Parameter | Type | Description
  513 +--- | --- | ---
  514 +buffer | char * | Buffer to store the last line in.
  515 +buffer_length | int | Length of the buffer.
  516 +
  517 +* **example call:** ```int br_most_recent_message(char * buffer, int buffer_length)```
  518 +* **see:** [br_progress](#br_progress), [br_time_remaining](#br_time_remaining)
  519 +
  520 +---
  521 +
  522 +## br_objects
  523 +
  524 +Returns names and parameters for the requested objects. Each object is newline seperated. Arguments are seperated from the object name with a tab. This function uses [QRegExp](http://doc.qt.io/qt-5/QRegExp.html) syntax.
  525 +
  526 +* **return type:** int
  527 +* **parameters:**
  528 +
  529 +Parameter | Type | Description
  530 +--- | --- | ---
  531 + buffer | char * | Output buffer for results.
  532 + buffer_length | int | Length of output buffer.
  533 + abstractions | const char * | (Optional) Regular expression of the abstractions to search. Default is ".*".
  534 + implementations | const char * | (Optional) Regular expression of the implementations to search. Default is ".*".
  535 + parameters | bool | (Optional) Include parameters after object name. Default is true.
  536 +
  537 +* **example call:** ```int br_objects(char * buffer, int buffer_length, const char *abstractions = ".*", const char *implementations = ".*", bool parameters = true)```
  538 +
  539 +---
  540 +
  541 +## br_plot
  542 +
  543 +Renders recognition performance figures for a set of **.csv** files created by [br_eval](#br_eval).
  544 +
  545 +In order of their output, the figures are:
  546 +1. Metadata table
  547 +2. Receiver Operating Characteristic (ROC)
  548 +3. Detection Error Tradeoff (DET)
  549 +4. Score Distribution (SD) histogram
  550 +5. True Accept Rate Bar Chart (BC)
  551 +6. Cumulative Match Characteristic (CMC)
  552 +7. Error Rate (ERR) curve
  553 +
  554 +Two files will be created:
  555 + * **destination.R** which is the auto-generated R script used to render the figures.
  556 + * **destination.pdf** which has all of the figures in one file multi-page file.
  557 +
  558 +OpenBR uses file and folder names to automatically determine the plot legend.
  559 +For example, let's consider the case where three algorithms (<tt>A</tt>, <tt>B</tt>, & <tt>C</tt>) were each evaluated on two datasets (<tt>Y</tt> & <tt>Z</tt>).
  560 +The suggested way to plot these experiments on the same graph is to create a folder named <tt>Algorithm_Dataset</tt> that contains the six <tt>.csv</tt> files produced by br_eval <tt>A_Y.csv</tt>, <tt>A_Z.csv</tt>, <tt>B_Y.csv</tt>, <tt>B_Z.csv</tt>, <tt>C_Y.csv</tt>, & <tt>C_Z.csv</tt>.
  561 +The '<tt>_</tt>' character plays a special role in determining the legend title(s) and value(s).
  562 +In this case, <tt>A</tt>, <tt>B</tt>, & <tt>C</tt> will be identified as different values of type <tt>Algorithm</tt>, and each will be assigned its own color; <tt>Y</tt> & <tt>Z</tt> will be identified as different values of type Dataset, and each will be assigned its own line style.
  563 +Matches around the EER will be displayed if the matches parameter is set in [br_eval](#br_eval).
  564 +
  565 +Returns **true** on success. Returns **false** on a failure to compile the figures due to a missing, out of date, or incomplete <tt>R</tt> installation.
  566 +
  567 +This function requires a current [R](http://www.r-project.org/) installation with the following packages:
  568 +
  569 + install.packages(c("ggplot2", "gplots", "reshape", "scales", "jpg", "png"))
  570 +
  571 +* **return type:** bool
  572 +* **parameters:**
  573 +
  574 +Parameter | Type | Description
  575 +--- | --- | ---
  576 +num_files | int | Number of **.csv** files.
  577 +files[] | const char * | **.csv** files created using [br_eval](#br_eval).
  578 +destination | const char * | Basename for the resulting figures.
  579 +show | bool | Open **destination.pdf** using the system's default PDF viewer. Default is false.
  580 +
  581 +* **example call:** ```bool br_plot(int num_files, const char *files[], const char *destination, bool show = false)```
  582 +* **see:** [br_eval](#br_eval)
  583 +
  584 +---
  585 +
  586 +## br_plot_detection
  587 +
  588 +Renders detection performance figures for a set of **.csv** files created by [br_eval_detection](#br_eval_detection).
  589 +
  590 +In order of their output, the figures are:
  591 +1. Discrete Receiver Operating Characteristic (DiscreteROC)
  592 +2. Continuous Receiver Operating Characteristic (ContinuousROC)
  593 +3. Discrete Precision Recall (DiscretePR)
  594 +4. Continuous Precision Recall (ContinuousPR)
  595 +5. Bounding Box Overlap Histogram (Overlap)
  596 +6. Average Overlap Table (AverageOverlap)
  597 +7. Average Overlap Heatmap (AverageOverlap)
  598 +
  599 +Detection accuracy is measured with *overlap fraction = bounding box intersection / union*.
  600 +When computing *discrete* curves, an overlap >= 0.5 is considered a true positive, otherwise it is considered a false negative.
  601 +When computing *continuous* curves, true positives and false negatives are measured fractionally as *overlap* and *1-overlap* respectively.
  602 +
  603 +Returns **true** on success. Returns **false** on a failure to compile the figures due to a missing, out of date, or incomplete <tt>R</tt> installation.
  604 +
  605 +This function requires a current [R](http://www.r-project.org/) installation with the following packages:
  606 +
  607 + install.packages(c("ggplot2", "gplots", "reshape", "scales", "jpg", "png"))
  608 +
  609 +* **return type:** bool
  610 +* **parameters:**
  611 +
  612 +Parameter | Type | Description
  613 +--- | --- | ---
  614 +num_files | int | Number of **.csv** files.
  615 +files[] | const char * | **.csv** files created using [br_eval_detection](#br_eval_detection).
  616 +destination | const char * | Basename for the resulting figures.
  617 +show | bool | Open **destination.pdf** using the system's default PDF viewer. Default is false.
  618 +
  619 +* **example call:** ```bool br_plot_detection(int num_files, const char *files[], const char *destination, bool show = false)```
  620 +* **see:** [br_eval_detection](#br_eval_detection), [br_plot](#br_plot)
  621 +
  622 +---
  623 +
  624 +## br_plot_landmarking
  625 +
  626 +Renders landmarking performance figures for a set of **.csv** files created by [br_eval_landmarking](#br_eval_landmarking).
  627 +
  628 +In order of their output, the figures are:
  629 +1. Cumulative landmarks less than normalized error (CD)
  630 +2. Normalized error box and whisker plots (Box)
  631 +3. Normalized error violin plots (Violin)
  632 +
  633 +Landmarking error is normalized against the distance between two predifined points, usually inter-ocular distance (IOD).
  634 +
  635 +* **return type:** bool
  636 +* **parameters:**
  637 +
  638 +Parameter | Type | Description
  639 +--- | --- | ---
  640 +num_files | int | Number of **.csv** files.
  641 +files[] | const char * | **.csv** files created using [br_eval_landmarking](#br_eval_landmarking).
  642 +destination | const char * | Basename for the resulting figures.
  643 +show | bool | Open **destination.pdf** using the system's default PDF viewer. Default is false.
  644 +
  645 +* **example call:** ```bool br_plot_landmarking(int num_files, const char *files[], const char *destination, bool show = false)```
  646 +* **see:** [br_eval_landmarking](#br_eval_landmarking), [br_plot](#br_plot)
  647 +
  648 +---
  649 +
  650 +## br_plot_metadata
  651 +
  652 +Renders metadata figures for a set of **.csv** files with specified columns.
  653 +
  654 +* **return type:** bool
  655 +* **parameters:**
  656 +
  657 +Parameter | Type | Description
  658 +--- | --- | ---
  659 +num_files | int | Number of **.csv** files.
  660 +files[] | const char * | **.csv** files created by enrolling templates to **.csv** metadata files.
  661 +columns | const char * | ';' seperated list of columns to plot.
  662 +show | bool | Open **PlotMetadata.pdf** using the system's default PDF viewer.
  663 +
  664 +* **example call:** ```bool br_plot_metadata(int num_files, const char *files[], const char *columns, bool show = false)```
  665 +* **see:** [br_plot](#br_plot)
  666 +
  667 +---
  668 +
  669 +## br_progress
  670 +
  671 +Returns current progress from [Context](cpp_api.md#context)::progress().
  672 +
  673 +* **return type:** float
  674 +* **parameters:** None
  675 +* **example call:** ```float br_progress()```
  676 +* **see:** [br_most_recent_message](#br_most_recent_message), [br_time_remaining](#br_time_remaining)
  677 +
  678 +---
  679 +
  680 +## br_read_pipe
  681 +
  682 +Read and parse arguments from a named pipe. Used by the [command line api](cl_api.md) to implement **-daemon**, generally not useful otherwise. Guaranteed to return at least one argument. See the bullets at the top of this page on managed return values.
  683 +
  684 +* **return type:** void
  685 +* **parameters:**
  686 +
  687 +Parameter | Type | Description
  688 +--- | --- | ---
  689 +pipe | const char * | Pipe name
  690 +argc | int * | Argument count
  691 +argv | char *** | Argument list
  692 +
  693 +* **example call:** ```void br_read_pipe(const char *pipe, int *argc, char ***argv)```
  694 +
  695 +---
  696 +
  697 +## br_scratch_path
  698 +
  699 +Fills the buffer with the value of [Context](cpp_api.md#context)::scratchPath(). See the bullets at the top of this page on input string buffers.
  700 +
  701 +* **return type:** int
  702 +* **parameters:**
  703 +
  704 +Parameter | Type | Description
  705 +--- | --- | ---
  706 +buffer | char * | Buffer for scratch path
  707 +buffer_length | int | Length of buffer.
  708 +
  709 +* **example call:** ```int br_scratch_path(char * buffer, int buffer_length)```
  710 +* **see:** [br_version](#br_version)
  711 +
  712 +---
  713 +
  714 +## br_sdk_path
  715 +
  716 +Returns the full path to the root of the SDK.
  717 +
  718 +* **return type:** const char *
  719 +* **parameters:** None
  720 +* **example call:** ```const char *br_sdk_path()```
  721 +* **see:** [br_initialize](#br_initialize)
  722 +
  723 +---
  724 +
  725 +## br_get_header
  726 +
  727 +Retrieve the target and query inputs in the [BEE matrix](../technical.md#the-evaluation-harness) header. See the bullets at the top of this page on managed return values.
  728 +
  729 +* **return type:** void
  730 +* **parameters:**
  731 +
  732 +Parameter | Type | Description
  733 +--- | --- | ---
  734 +matrix | const char * | The [BEE matrix](../technical.md#the-evaluation-harness) file to modify
  735 +target_gallery | const char ** | The matrix target
  736 +query_gallery | const char ** | The matrix query
  737 +
  738 +* **example call:** ```void br_get_header(const char *matrix, const char **target_gallery, const char **query_gallery)```
  739 +* **set:** [br_set_header](#br_set_header)
  740 +
  741 +---
  742 +
  743 +## br_set_header
  744 +
  745 +Update the target and query inputs in the [BEE matrix](../technical.md#the-evaluation-harness) header.
  746 +
  747 +* **return type:** void
  748 +* **parameters:**
  749 +
  750 +Parameter | Type | Description
  751 +--- | --- | ---
  752 +matrix | const char * | The [BEE matrix](../technical.md#the-evaluation-harness) file to modify
  753 +target_gallery | const char ** | The matrix target
  754 +query_gallery | const char ** | The matrix query
  755 +
  756 +* **example call:** ```void br_set_header(const char *matrix, const char *target_gallery, const char *query_gallery)```
  757 +* **see:** [br_get_header](#br_get_header)
  758 +
  759 +---
  760 +
  761 +## br_set_property
  762 +
  763 +Appends the given value to the global [metadata](cpp_api.md#context) using the given key.
  764 +
  765 +* **return type:** void
  766 +* **parameters:**
  767 +
  768 +Parameter | Type | Description
  769 +--- | --- | ---
  770 +key | const char * | Key to append
  771 +value | const char * | Value to append
  772 +
  773 +* **example call:** ```void br_set_property(const char *key, const char *value)```
  774 +
  775 +---
  776 +
  777 +## br_time_remaining
  778 +
  779 +Returns estimate of time remaining in the current process.
  780 +
  781 +* **return type:** int
  782 +* **parameters:** None
  783 +* **example call:** ```int br_time_remaining()```
  784 +* **see:** [br_most_recent_message](#br_most_recent_message), [br_progress](#br_progress)
  785 +
  786 +---
  787 +
  788 +## br_train
  789 +
  790 +Trains the [Transform](cpp_api.md#transform) and [Distance](cpp_api.md#distance) on the input.
  791 +
  792 +* **return type:** void
  793 +* **parameters:**
  794 +
  795 +Parameter | Type | Description
  796 +--- | --- | ---
  797 +input | const char * | The [Gallery](cpp_api.md#gallery) to train on.
  798 +model | const char * | (Optional) String specifying the binary file to serialize training results to. The trained algorithm can be recovered by using this file as the algorithm. By default the trained algorithm will not be serialized to disk.
  799 +
  800 +* **example call:** ```void br_train(const char *input, const char *model = "")```
  801 +* **see:** [br_train_n](#br_train_n)
  802 +
  803 +---
  804 +
  805 +## br_train_n
  806 +
  807 +Convenience function for training on multiple inputs
  808 +
  809 +* **return type:** void
  810 +* **parameters:**
  811 +
  812 +Parameter | Type | Description
  813 +--- | --- | ---
  814 +num_inputs | int | Size of **inputs**
  815 +inputs[] | const char * | An array of [galleries](cpp_api.md#gallery) to train on.
  816 +modell | const char *model = | (Optional) String specifying the binary file to serialize training results to. The trained algorithm can be recovered by using this file as the algorithm. By default the trained algorithm will not be serialized to disk.
  817 +
  818 +* **example call:** ```void br_train_n(int num_inputs, const char *inputs[], const char *model = "")```
  819 +* **see:** [br_train](#br_train)
  820 +
  821 +---
  822 +
  823 +## br_version
  824 +
  825 +Returns the current OpenBR version.
  826 +
  827 +* **return type:** const char *
  828 +* **parameters:** None
  829 +* **example call:** ```const char *br_version()```
  830 +* **see:** [br_about](#br_about), [br_scratch_path](#br_scratch_path)
  831 +
  832 +---
  833 +
  834 +## br_load_img
  835 +
  836 +Load an image from a string buffer. This is an easy way to pass an image in memory from another programming language to openbr.
  837 +
  838 +* **return type:** br_template
  839 +* **parameters:**
  840 +
  841 +Parameter | Type | Description
  842 +--- | --- | ---
  843 +data | const char * | The image buffer.
  844 +len | int | The length of the buffer.
  845 +
  846 +* **example call:** ```br_template br_load_img(const char *data, int len)```
  847 +* **see:** [br_unload_img](#br_unload_img)
  848 +
  849 +---
  850 +
  851 +## br_unload_img
  852 +
  853 +Unload an image to a string buffer. This is an easy way to pass an image from openbr to another programming language.
  854 +
  855 +* **return type:** unsigned char*
  856 +* **parameters:**
  857 +
  858 +Parameter | Type | Description
  859 +--- | --- | ---
  860 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template)
  861 +
  862 +* **example call:** ```unsigned char* br_unload_img(br_template tmpl)```
  863 +* **see:** [br_load_img](#br_load_img)
  864 +
  865 +---
  866 +
  867 +## br_template_list_from_buffer
  868 +
  869 +Deserialize a br::TemplateList from a buffer. Can be the buffer for a .gal file, since they are just a TemplateList serialized to disk.
  870 +
  871 +* **return type:** br_template_list
  872 +* **parameters:**
  873 +
  874 +Parameter | Type | Description
  875 +--- | --- | ---
  876 +buf | const char * | The buffer.
  877 +len | int | The length of the buffer.
  878 +
  879 +* **example call:** ```br_template_list br_template_list_from_buffer(const char *buf, int len)```
  880 +
  881 +---
  882 +
  883 +## br_free_template
  884 +
  885 +Free a [Template's](cpp_api.md#template) memory.
  886 +
  887 +* **return type:** void
  888 +* **parameters:**
  889 +
  890 +Parameter | Type | Description
  891 +--- | --- | ---
  892 +tmpl | br_template | Pointer to the [Template](cpp_api.md#template) to free.
  893 +
  894 +* **example call:** ```void br_free_template(br_template tmpl)```
  895 +
  896 +---
  897 +
  898 +## br_free_template_list
  899 +
  900 +Free a [TemplateList's](cpp_api.md#templatelist) memory.
  901 +
  902 +* **return type:** void
  903 +* **parameters:**
  904 +
  905 +Parameter | Type | Description
  906 +--- | --- | ---
  907 +tl | br_template_list | Pointer to the [TemplateList](cpp_api.md#templatelist) to free.
  908 +
  909 +* **example call:** ```void br_free_template_list(br_template_list tl)```
  910 +
  911 +---
  912 +
  913 +## br_free_output
  914 +
  915 +Free a [Output's](cpp_api.md#output) memory.
  916 +
  917 +* **return type:** void
  918 +* **parameters:**
  919 +
  920 +Parameter | Type | Description
  921 +--- | --- | ---
  922 +output | br_matrix_output | Pointer to the[Output](cpp_api.md#output) to free.
  923 +
  924 +* **example call:** ```void br_free_output(br_matrix_output output)```
  925 +
  926 +---
  927 +
  928 +## br_img_rows
  929 +
  930 +Returns the number of rows in an image.
  931 +
  932 +* **return type:** int
  933 +* **parameters:**
  934 +
  935 +Parameter | Type | Description
  936 +--- | --- | ---
  937 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template).
  938 +
  939 +* **example call:** ```int br_img_rows(br_template tmpl)```
  940 +
  941 +---
  942 +
  943 +## br_img_cols
  944 +
  945 +Returns the number of cols in an image.
  946 +
  947 +* **return type:** int
  948 +* **parameters:**
  949 +
  950 +Parameter | Type | Description
  951 +--- | --- | ---
  952 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template).
  953 +
  954 +* **example call:** ```int br_img_cols(br_template tmpl)```
  955 +
  956 +---
  957 +
  958 +## br_img_channels
  959 +
  960 +Returns the number of channels in an image.
  961 +
  962 +* **return type:** int
  963 +* **parameters:**
  964 +
  965 +Parameter | Type | Description
  966 +--- | --- | ---
  967 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template).
  968 +
  969 +* **example call:** ```int br_img_channels(br_template tmpl)```
  970 +
  971 +---
  972 +
  973 +## br_img_is_empty
  974 +
  975 +Checks if the image is empty.
  976 +
  977 +* **return type:** bool
  978 +* **parameters:**
  979 +
  980 +Parameter | Type | Description
  981 +--- | --- | ---
  982 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template).
  983 +
  984 +* **example call:** ```bool br_img_is_empty(br_template tmpl)```
  985 +
  986 +---
  987 +
  988 +## br_get_filename
  989 +
  990 +Get the filename for a [Template](cpp_api.md#template). Please see the bullets at the top of the page on input string buffers.
  991 +
  992 +* **return type:** int
  993 +* **parameters:**
  994 +
  995 +Parameter | Type | Description
  996 +--- | --- | ---
  997 +buffer | char * | Buffer to hold the filename
  998 +buffer_length | int | Length of the buffer
  999 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template).
  1000 +
  1001 +* **example call:** ```int br_get_filename(char * buffer, int buffer_length, br_template tmpl)```
  1002 +
  1003 +---
  1004 +
  1005 +## br_set_filename
  1006 +
  1007 +Set the filename for a [Template](cpp_api.md#template).
  1008 +
  1009 +* **return type:** void
  1010 +* **parameters:**
  1011 +
  1012 +Parameter | Type | Description
  1013 +--- | --- | ---
  1014 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template).
  1015 +filename | const char * | New filename for the template.
  1016 +
  1017 +* **example call:** ```void br_set_filename(br_template tmpl, const char *filename)```
  1018 +
  1019 +---
  1020 +
  1021 +## br_get_metadata_string
  1022 +
  1023 +Get metadata as a string for the given key in the given [Template](cpp_api.md#template).
  1024 +
  1025 +* **return type:** int
  1026 +* **parameters:**
  1027 +
  1028 +Parameter | Type | Description
  1029 +--- | --- | ---
  1030 +buffer | char * | Buffer to hold the metadata string.
  1031 +buffer_length | int | length of the buffer.
  1032 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template).
  1033 +key | const char * | Key for the metadata lookup
  1034 +
  1035 +* **example call:** ```int br_get_metadata_string(char * buffer, int buffer_length, br_template tmpl, const char *key)```
  1036 +
  1037 +---
  1038 +
  1039 +## br_enroll_template
  1040 +
  1041 +Enroll a [Template](cpp_api.md#template) from the C API! Returns a pointer to a [TemplateList](cpp_api.md#templatelist)
  1042 +
  1043 +* **return type:** br_template_list
  1044 +* **parameters:**
  1045 +
  1046 +Parameter | Type | Description
  1047 +--- | --- | ---
  1048 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template).
  1049 +
  1050 +* **example call:** ```br_template_list br_enroll_template(br_template tmpl)```
  1051 +
  1052 +---
  1053 +
  1054 +## br_enroll_template_list
  1055 +
  1056 +Enroll a [TemplateList](cpp_api.md#templatelist) from the C API!
  1057 +
  1058 +* **return type:** void
  1059 +* **parameters:**
  1060 +
  1061 +Parameter | Type | Description
  1062 +--- | --- | ---
  1063 +tl | br_template_list | Pointer to a [TemplateList](cpp_api.md#templatelist)
  1064 +
  1065 +* **example call:** ```void br_enroll_template_list(br_template_list tl)```
  1066 +
  1067 +---
  1068 +
  1069 +## br_compare_template_lists
  1070 +
  1071 +Compare [TemplateLists](cpp_api.md#templatelist) from the C API!
  1072 +
  1073 +* **return type:** br_matrix_output
  1074 +* **parameters:**
  1075 +
  1076 +Parameter | Type | Description
  1077 +--- | --- | ---
  1078 +target | br_template_list | Pointer to a [TemplateList](cpp_api.md#templatelist)
  1079 +query | br_template_list | Pointer to a [TemplateList](cpp_api.md#templatelist)
  1080 +
  1081 +* **example call:** ```br_matrix_output br_compare_template_lists(br_template_list target, br_template_list query)```
  1082 +
  1083 +---
  1084 +
  1085 +## br_get_matrix_output_at
  1086 +
  1087 +Get a value in the [MatrixOutput](cpp_api.md#matrixoutput).
  1088 +
  1089 +* **return type:** float
  1090 +* **parameters:**
  1091 +
  1092 +Parameter | Type | Description
  1093 +--- | --- | ---
  1094 +output | br_matrix_output | Pointer to [MatrixOutput](cpp_api.md#matrixoutput)
  1095 +row | int | Row for lookup
  1096 +col | int | Col for lookup
  1097 +
  1098 +* **example call:** ```float br_get_matrix_output_at(br_matrix_output output, int row, int col)```
  1099 +
  1100 +---
  1101 +
  1102 +## br_get_template
  1103 +
  1104 +Get a pointer to a [Template](cpp_api.md#template) at a specified index.
  1105 +
  1106 +* **return type:** br_template
  1107 +* **parameters:**
  1108 +
  1109 +Parameter | Type | Description
  1110 +--- | --- | ---
  1111 +tl | br_template_list | Pointer to a [TemplateList](cpp_api.md#templatelist)
  1112 +index | int | Index into the template list. Should be in the range [0,len(tl) - 1].
  1113 +
  1114 +* **example call:** ```br_template br_get_template(br_template_list tl, int index)```
  1115 +
  1116 +---
  1117 +
  1118 +## br_num_templates
  1119 +
  1120 +Get the number of [Templates](cpp_api.md#template) in a [TemplateList](cpp_api.md#templatelist).
  1121 +
  1122 +* **return type:** int
  1123 +* **parameters:**
  1124 +
  1125 +Parameter | Type | Description
  1126 +--- | --- | ---
  1127 +tl | br_template_list | Pointer to a [TemplateList](cpp_api.md#templatelist)
  1128 +
  1129 +* **example call:** ```int br_num_templates(br_template_list tl)```
  1130 +
  1131 +---
  1132 +
  1133 +## br_make_gallery
  1134 +
  1135 +Initialize a [Gallery](cpp_api.md#gallery).
  1136 +
  1137 +* **return type:** br_gallery
  1138 +* **parameters:**
  1139 +
  1140 +Parameter | Type | Description
  1141 +--- | --- | ---
  1142 +gallery | const char * | String location of gallery on disk.
  1143 +
  1144 +* **example call:** ```br_gallery br_make_gallery(const char *gallery)```
  1145 +
  1146 +---
  1147 +
  1148 +## br_load_from_gallery
  1149 +
  1150 +Read [TemplateList](cpp_api.md#templatelist) from [Gallery](cpp_api.md#gallery).
  1151 +
  1152 +* **return type:** br_template_list
  1153 +* **parameters:**
  1154 +
  1155 +Parameter | Type | Description
  1156 +--- | --- | ---
  1157 +gallery | br_gallery | Pointer to a [Gallery](cpp_api.md#gallery)
  1158 +
  1159 +* **example call:** ```br_template_list br_load_from_gallery(br_gallery gallery)```
  1160 +
  1161 +---
  1162 +
  1163 +## br_add_template_to_gallery
  1164 +
  1165 +Write a [Template](cpp_api.md#template) to the [Gallery](cpp_api.md#gallery) on disk
  1166 +
  1167 +* **return type:** void
  1168 +* **parameters:**
  1169 +
  1170 +Parameter | Type | Description
  1171 +--- | --- | ---
  1172 +gallery | br_gallery | Pointer to a [Gallery](cpp_api.md#gallery)
  1173 +tmpl | br_template | Pointer to a [Template](cpp_api.md#template)
  1174 +
  1175 +* **example call:** ```void br_add_template_to_gallery(br_gallery gallery, br_template tmpl)```
  1176 +
  1177 +---
  1178 +
  1179 +## br_add_template_list_to_gallery
  1180 +
  1181 +Write a [TemplateList](cpp_api.md#templatelist) to the [Gallery](cpp_api.md#gallery) on disk.
  1182 +
  1183 +* **return type:** void
  1184 +* **parameters:**
  1185 +
  1186 +Parameter | Type | Description
  1187 +--- | --- | ---
  1188 +gallery | br_gallery | Pointer to a [Gallery](cpp_api.md#gallery)
  1189 +tl | br_template_list | Pointer to a [TemplateList](cpp_api.md#templatelist)
  1190 +
  1191 +* **example call:** ```void br_add_template_list_to_gallery(br_gallery gallery, br_template_list tl)```
  1192 +
  1193 +---
  1194 +
  1195 +## br_close_gallery
  1196 +
  1197 +Close the [Gallery](cpp_api.md#gallery).
  1198 +
  1199 +* **return type:** void
  1200 +* **parameters:**
  1201 +
  1202 +Parameter | Type | Description
  1203 +--- | --- | ---
  1204 +gallery | br_gallery | Pointer to a [Gallery](cpp_api.md#gallery)
  1205 +
  1206 +* **example call:** ```void br_close_gallery(br_gallery gallery)```
  1207 +
  1208 +---
... ...
docs/docs/docs/cpp_api.md
  1 +# API Functions
  2 +
  3 +## IsClassifier {: #function-isclassiifer }
  4 +
  5 +Determines if the given algorithm is a classifier. A classifier is defined as a [Transform](#transform) with no associated [Distance](#distance). Instead metadata fields with the predicted output classes are populated in [Template](#template) [files](#template-members-file).
  6 +
  7 +* **function definition:**
  8 +
  9 + bool IsClassifier(const QString &algorithm)
  10 +
  11 +* **parameters:**
  12 +
  13 + Parameter | Type | Description
  14 + --- | --- | ---
  15 + algorithm | const [QString][QString] & | Algorithm to evaluate
  16 +
  17 +* **output:** (bool) True if the algorithm is a classifier and false otherwise
  18 +* **see:** [br_is_classifier](c_api.md#br_is_classifier)
  19 +* **example:**
  20 +
  21 + IsClassifier("Identity"); // returns true
  22 + IsClassifier("Identity:Dist"); // returns false
  23 +
  24 +## Train {: #function-train }
  25 +
  26 +High level function for creating models.
  27 +
  28 +* **function definition:**
  29 +
  30 + void Train(const File &input, const File &model)
  31 +
  32 +* **parameters:**
  33 +
  34 + Parameter | Type | Description
  35 + --- | --- | ---
  36 + input | const [File](#file) & | Training data
  37 + model | const [File](#file) & | Model file
  38 +
  39 +* **output:** (void)
  40 +* **see:** The [training tutorial](../tutorials.md#training-algorithms) for an example of training.
  41 +* **example:**
  42 +
  43 + File file("/path/to/images/or/gallery.gal");
  44 + File model("/path/to/model/file");
  45 + Train(file, model);
  46 +
  47 +## Enroll {: #function-enroll }
  48 +
  49 +High level function for creating [galleries](#gallery).
  50 +
  51 +* **function definition:**
  52 +
  53 + void Enroll(const File &input, const File &gallery = File())
  54 +
  55 +* **parameters:**
  56 +
  57 + Parameter | Type | Description
  58 + --- | --- | ---
  59 + input | const [File](#file) & | Path to enrollment file
  60 + gallery | const [File](#file) & | (Optional) Path to gallery file.
  61 +
  62 +* **output:** (void)
  63 +* **see:** [br_enroll](c_api.md#br_enroll)
  64 +* **example:**
  65 +
  66 + File file("/path/to/images/or/gallery.gal");
  67 + Enroll(file); // Don't need to specify a gallery file
  68 + File gallery("/path/to/gallery/file");
  69 + Enroll(file, gallery); // Will write to the specified gallery file
  70 +
  71 +## Enroll {: #function-enroll }
  72 +
  73 +High level function for enrolling templates. Templates are modified in place as they are projected through the algorithm.
  74 +
  75 +* **function definition:**
  76 +
  77 + void Enroll(TemplateList &tmpl)
  78 +
  79 +* **parameters:**
  80 +
  81 + Parameter | Type | Description
  82 + --- | --- | ---
  83 + tmpl | [TemplateList](#templatelist) & | Data to enroll
  84 +
  85 +* **output:** (void)
  86 +* **example:**
  87 +
  88 + TemplateList tList = TemplateList() << Template("picture1.jpg")
  89 + << Template("picture2.jpg")
  90 + << Template("picture3.jpg");
  91 + Enroll(tList);
  92 +
  93 +## Project {: #function-project}
  94 +
  95 +A naive alternative to [Enroll](#function-enroll-1).
  96 +
  97 +* **function definition:**
  98 +
  99 + void Project(const File &input, const File &output)
  100 +
  101 +* **parameters:**
  102 +
  103 + Parameter | Type | Description
  104 + --- | --- | ---
  105 + input | const [File](#file) & | Path to enrollment file
  106 + gallery | const [File](#file) & | Path to gallery file.
  107 +
  108 +* **output:** (void)
  109 +* **see:** [Enroll](#function-enroll-1)
  110 +* **example:**
  111 +
  112 + File file("/path/to/images/or/gallery.gal");
  113 + File output("/path/to/gallery/file");
  114 + Project(file, gallery); // Will write to the specified gallery file
  115 +
  116 +## Compare {: #function-compare }
  117 +
  118 +High level function for comparing galleries. Each template in the **queryGallery** is compared against every template in the **targetGallery**.
  119 +
  120 +* **function definition:**
  121 +
  122 + void Compare(const File &targetGallery, const File &queryGallery, const File &output)
  123 +
  124 +* **parameters:**
  125 +
  126 + Parameter | Type | Description
  127 + --- | --- | ---
  128 + targetGallery | const [File](#file) & | Gallery of target templates
  129 + queryGallery | const [File](#file) & | Gallery of query templates
  130 + output | const [File](#file) & | Output file for results
  131 +
  132 +* **returns:** (output)
  133 +* **see:** [br_compare](c_api.md#br_compare)
  134 +* **example:**
  135 +
  136 + File target("/path/to/target/images/");
  137 + File query("/path/to/query/images/");
  138 + File output("/path/to/output/file");
  139 + Compare(target, query, output);
  140 +
  141 +## CompareTemplateList {: #function-comparetemplatelists}
  142 +
  143 +High level function for comparing templates.
  144 +
  145 +* **function definition:**
  146 +
  147 + void CompareTemplateLists(const TemplateList &target, const TemplateList &query, Output *output);
  148 +
  149 +* **parameters:**
  150 +
  151 + Parameter | Type | Description
  152 + --- | --- | ---
  153 + target | const [TemplateList](#templatelist) & | Target templates
  154 + query | const [TemplateList](#templatelist) & | Query templates
  155 + output | [Output](#output) \* | Output file for results
  156 +
  157 +* **output:** (void)
  158 +* **example:**
  159 +
  160 + TemplateList targets = TemplateList() << Template("target_img1.jpg")
  161 + << Template("target_img2.jpg")
  162 + << Template("target_img3.jpg");
  163 +
  164 + TemplateList query = TemplateList() << Template("query_img.jpg");
  165 + Output *output = Factory::make<Output>("/path/to/output/file");
  166 +
  167 + CompareTemplateLists(targets, query, output);
  168 +
  169 +
  170 +## PairwiseCompare {: #function-pairwisecompare }
  171 +
  172 +High level function for doing a series of pairwise comparisons.
  173 +
  174 +* **function definition:**
  175 +
  176 + void PairwiseCompare(const File &targetGallery, const File &queryGallery, const File &output)
  177 +
  178 +* **parameters:**
  179 +
  180 + Parameter | Type | Description
  181 + --- | --- | ---
  182 + targetGallery | const [File](#file) & | Gallery of target templates
  183 + queryGallery | const [File](#file) & | Gallery of query templates
  184 + output | const [File](#file) & | Output file for results
  185 +
  186 +* **output:** (void)
  187 +* **see:** [br_pairwise_comparison](c_api.md#br_pairwise_compare)
  188 +* **example:**
  189 +
  190 + File target("/path/to/target/images/");
  191 + File query("/path/to/query/images/");
  192 + File output("/path/to/output/file");
  193 + PairwiseCompare(target, query, output);
  194 +
  195 +## Convert {: #function-convert }
  196 +
  197 +Change the format of the **inputFile** to the format of the **outputFile**. Both the **inputFile** format and the **outputFile** format must be of the same format group, which is specified by the **fileType**.
  198 +
  199 +* **function definition:**
  200 +
  201 + void Convert(const File &fileType, const File &inputFile, const File &outputFile)
  202 +
  203 +* **parameters:**
  204 +
  205 + Parameter | Type | Description
  206 + --- | --- | ---
  207 + fileType | const [File](#file) & | Can be either: <ul> <li>[Format](#format)</li> <li>[Gallery](#gallery)</li> <li>[Output](#output)</li> </ul>
  208 + inputFile | const [File](#file) & | File to be converted. Format is inferred from the extension.
  209 + outputFile | const [File](#file) & | File to store converted input. Format is inferred from the extension.
  210 +
  211 +* **output:** (void)
  212 +* **example:**
  213 +
  214 + File input("input.csv");
  215 + File output("output.xml");
  216 + Convert("Format", input, output);
  217 +
  218 +## Cat {: #function-cat }
  219 +
  220 +Concatenate several galleries into one.
  221 +
  222 +* **function definition:**
  223 +
  224 + void Cat(const QStringList &inputGalleries, const QString &outputGallery)
  225 +
  226 +* **parameters:**
  227 +
  228 + Parameter | Type | Description
  229 + --- | --- | ---
  230 + inputGalleries | const [QStringList][QStringList] & | List of galleries to concatenate
  231 + outputGallery | const [QString][QString] & | Gallery to store the concatenated result. This gallery cannot be in the inputGalleries
  232 +
  233 +* **output:** (void)
  234 +* **see:** [br_cat](c_api.md#br_cat)
  235 +* **example:**
  236 +
  237 + QStringList inputGalleries = QStringList() << "/path/to/gallery1"
  238 + << "/path/to/gallery2"
  239 + << "/path/to/gallery3";
  240 +
  241 + QString outputGallery = "/path/to/outputGallery";
  242 + Cat(inputGalleries, outputGallery);
  243 +
  244 +## Deduplicate {: #function-deduplicate }
  245 +
  246 +Deduplicate a gallery. A duplicate is defined as an image with a match score above a given threshold to another image in the gallery.
  247 +
  248 +* **function definition:**
  249 +
  250 + void Deduplicate(const File &inputGallery, const File &outputGallery, const QString &threshold)
  251 +
  252 +* **parameters:**
  253 +
  254 + Parameter | Type | Description
  255 + --- | --- | ---
  256 + inputGallery | const [File](#file) & | Gallery to deduplicate
  257 + outputGallery | const [File](#file) & | Gallery to store the deduplicated result
  258 + threshold | const [QString][QString] & | Match score threshold to determine duplicates
  259 +
  260 +* **output:** (void)
  261 +* **see:** [br_deduplicate](c_api.md#br_deduplicate)
  262 +* **example:**
  263 +
  264 + File input("/path/to/input/galley/with/dups");
  265 + File output("/path/to/output/gallery");
  266 + Deduplicate(input, output, "0.7"); // Remove duplicates with match scores above 0.7
  267 +
  268 +---
  269 +
1 270 # File
2 271  
3 272 A file path with associated metadata.
... ... @@ -14,7 +283,7 @@ Files have a simple grammar that allow them to be converted to and from strings.
14 283 If a string ends with a **]** or **)** then the text within the final **[]** or **()** are parsed as comma separated metadata fields.
15 284 By convention, fields within **[]** are expected to have the format <tt>[key1=value1, key2=value2, ..., keyN=valueN]</tt> where order is irrelevant.
16 285 Fields within **()** are expected to have the format <tt>(value1, value2, ..., valueN)</tt> where order matters and the key context dependent.
17   -The left hand side of the string not parsed in a manner described above is assigned to [name](#qstring-name).
  286 +The left hand side of the string not parsed in a manner described above is assigned to [name](#file-members-name).
18 287  
19 288 Values are not necessarily stored as strings in the metadata table.
20 289 The system will attempt to infer and convert them to their "native" type.
... ... @@ -34,8 +303,8 @@ Below are some of the most commonly occurring standardized keys:
34 303  
35 304 Key | Value | Description
36 305 --- | ---- | -----------
37   -name | QString | Contents of [name](#name)
38   -separator | QString | Separate [name](#name) into multiple files
  306 +name | QString | Contents of [name](#file-members-name)
  307 +separator | QString | Separate [name](#file-members-name) into multiple files
39 308 Index | int | Index of a template in a template list
40 309 Confidence | float | Classification/Regression quality
41 310 FTE | bool | Failure to enroll
... ... @@ -59,93 +328,134 @@ _* | * | Reserved for internal use
59 328  
60 329 ---
61 330  
62   -## Members
  331 +## Members {: #file-members }
  332 +
  333 +Member | Type | Description
  334 +--- | --- | ---
  335 +<a class="table-anchor" id="file-members-name"></a>name | [QString][QString] | Path to a file on disk
  336 +<a class="table-anchor" id=file-members-fte></a>fte | bool | Failed to enroll. If true this file failed to be processed somewhere in the template enrollment algorithm
  337 +<a class="table-anchor" id=file-members-m_metadata></a>m_metadata | [QVariantMap][QVariantMap] | Map for storing metadata. It is a [QString][QString], [QVariant][QVariant] key value pairing.
  338 +
  339 +---
  340 +
  341 +## Constructors {: #file-constructors }
63 342  
64   -### [QString][QString] name
  343 +Constructor | Description
  344 +--- | ---
  345 +File() | Default constructor. Sets [name](#file-members-fte) to false.
  346 +File(const [QString][QString] &file) | Initializes the file by calling the private function init.
  347 +File(const [QString][QString] &file, const [QVariant][QVariant] &label) | Initializes the file by calling the private function init. Append label to the [metadata](#file-members-m_metadata) using the key "Label".
  348 +File(const char \*file) | Initializes the file with a c-style string.
  349 +File(const [QVariantMap][QVariantMap] &metadata) | Sets [name](#file-members-fte) to false and sets the [file metadata](#file-members) to metadata.
65 350  
66   -Path to a file on disk
  351 +---
67 352  
68   -### bool fte
  353 +## Static Functions {: #file-static-functions }
69 354  
70   -Failed to enroll. If true this file failed to be processed somewhere in the template enrollment algorithm
71 355  
72   -### [QVariantMap][QVariantMap] m_metadata
  356 +### [QVariant][QVariant] parse(const [QString][QString] &value) {: #function-static-parse }
73 357  
74   -Map for storing metadata. It is a [QString][QString], [QVariant][QVariant] key value pairing.
  358 +Try to convert a given value to a [QPointF][QPointF], [QRectF][QRectF], int or float.
75 359  
76   ----
  360 +* **function definition:**
77 361  
78   -## Constructors
  362 + static QVariant parse(const QString &value);
79 363  
80   -### File()
  364 +* **parameters:**
81 365  
82   -Default constructor. Sets [FTE](#bool-fte) to false.
  366 + Parameter | Type | Description
  367 + --- | --- | ---
  368 + value | const [QString][QString] & | String value to be converted.
83 369  
84   -### File(const [QString][QString] &file)
  370 +* **output:** ([QVariant][QVariant]) The converted file if a conversion was possible. Otherwise the unconverted string is returned.
  371 +* **example:**
85 372  
86   -Initializes the file by calling the private function init.
  373 + QString point = "(1, 1)";
  374 + QString rect = "(1, 1, 5, 5)";
  375 + QString integer = "1";
  376 + QString fp = "1.0";
  377 + QString string = "Hello World";
87 378  
88   -### File(const [QString][QString] &file, const [QVariant][QVariant] &label)
  379 + File::parse(point); // returns QVariant(QPointF, QPointF(1, 1))
  380 + File::parse(rect); // returns QVariant(QRectF, QRectF(1, 1, 5x5))
  381 + File::parse(integer); // returns QVariant(int, 1)
  382 + File::parse(fp); // returns QVariant(float, 1.0f)
  383 + File::parse(string); // returns QVariant(QString, "Hello World")
89 384  
90   -Initializes the file by calling the private function init. Append label to the [metadata](#qvariantmap-m_metadata) using the key "Label".
91 385  
92   -### File(const char \*file)
  386 +### [QList][QList]&lt;[QVariant][QVariant]&gt; values(const [QList][QList]&lt;U&gt; &fileList, const [QString][QString] &key) {: #file-static-values }
93 387  
94   -Initializes the file with a c-style string.
  388 +Gather a list of [QVariant][QVariant] values associated with a metadata key from a provided list of files.
95 389  
96   -### File(const [QVariantMap][QVariantMap] &metadata)
  390 +* **function definition:**
97 391  
98   -Sets [FTE](#bool-fte) to false and sets the [file metadata](#qvariantmap-m_metadata) to metadata.
  392 + template<class U> static [QList<QVariant> values(const QList<U> &fileList, const QString &key)
99 393  
100   ----
  394 +* **parameters:**
101 395  
102   -## Static Functions
  396 + Parameter | Type | Description
  397 + --- | --- | ---
  398 + fileList | const [QList][QList]&lt;U&gt; & | A list of files to parse for values. A type is required for <tt>U</tt>. Valid options are: <ul> <li>[File](#file)</li> <li>[QString][QString]</li> </ul>
  399 + key | const [QString][QString] & | A metadata key used to lookup the values.
103 400  
  401 +* **output:** ([QList][QList]&lt;[QVariant][QVariant]&gt;) A list of [QVariant][QVariant] values associated with the given key in each of the provided files.
  402 +* **example:**
104 403  
105   -### static [QVariant][QVariant] parse([QString][QString] &value) const
  404 + File f1, f2;
  405 + f1.set("Key1", QVariant::fromValue<float>(1));
  406 + f1.set("Key2", QVariant::fromValue<float>(2));
  407 + f2.set("Key1", QVariant::fromValue<float>(3));
106 408  
107   -Try to convert value to a [QPointF][QPointF], [QRectF][QRectF], int or float. If a conversion is possible it returns the converted value, otherwise it returns the unconverted string.
  409 + File::values<File>(QList<File>() << f1 << f2, "Key1"); // returns [QVariant(float, 1),
  410 + // QVariant(float, 3)]
108 411  
109   - QString point = "(1, 1)";
110   - QString rect = "(1, 1, 5, 5)";
111   - QString integer = "1";
112   - QString fp = "1.0";
113   - QString string = "Hello World";
114 412  
115   - File::parse(point); // returns QVariant(QPointF, QPointF(1, 1))
116   - File::parse(rect); // returns QVariant(QRectF, QRectF(1, 1, 5x5))
117   - File::parse(integer); // returns QVariant(int, 1)
118   - File::parse(fp); // returns QVariant(float, 1.0f)
119   - File::parse(string); // returns QVariant(QString, "Hello World")
  413 +### [QList][QList]&lt;T&gt; get(const [QList][QList]&lt;U&gt; &fileList, const [QString][QString] &key) {: #file-static-get-1 }
120 414  
121   -### static [QList][QList]&lt;[QVariant][QVariant]&gt; values(const [QList][QList]&lt;U&gt; &fileList, const [QString][QString] &key)
  415 +Gather a list of <tt>T</tt> values associated with a metadata key from a provided list of files. <tt>T</tt> is a user provided type. If the key does not exist in the metadata of *any* file an error is thrown.
122 416  
123   -This function requires a type specification in place of U. Valid types are [File](#file) and [QString][QString]. Returns a list of the values of the key in each of the given files.
  417 +* **function definition:**
124 418  
125   - File f1, f2;
126   - f1.set("Key1", QVariant::fromValue<float>(1));
127   - f1.set("Key2", QVariant::fromValue<float>(2));
128   - f2.set("Key1", QVariant::fromValue<float>(3));
  419 + template<class T, class U> static QList<T> get(const QList<U> &fileList, const QString &key)
129 420  
130   - File::values<File>(QList<File>() << f1 << f2, "Key1"); // returns [QVariant(float, 1),
131   - // QVariant(float, 3)]
  421 +* **parameters:**
132 422  
133   -### static [QList][QList]&lt;T&gt; get(const [QList][QList]&lt;U&gt; &fileList, const [QString][QString] &key)
  423 + Parameter | Type | Description
  424 + --- | --- | ---
  425 + fileList | const [QList][QList]&lt;U&gt; & | A list of files to parse for values. A type is required for U. Valid options are: <ul> <li>[File](#file)</li> <li>[QString][QString]</li> </ul>
  426 + key | const [QString][QString] & | A metadata key used to lookup the values.
134 427  
135   -This function requires a type specification in place of T and U. Valid types for U are [File](#file) and [QString][QString]. T can be any type. Returns a list of the values of the key in each of the given files. If the key doesn't exist in any of the files or the value cannot be converted to type T an error is thrown.
  428 +* **output:** ([QList][QList]&lt;T&gt;) A list of the values of type <tt>T</tt> associated with the given key. A type is required for <tt>T</tt>.
  429 +* **example:**
  430 +
  431 + File f1, f2;
  432 + f1.set("Key1", QVariant::fromValue<float>(1));
  433 + f1.set("Key2", QVariant::fromValue<float>(2));
  434 + f2.set("Key1", QVariant::fromValue<float>(3));
  435 +
  436 + File::get<float, File>(QList<File>() << f1 << f2, "Key1"); // returns [1., 3.]
  437 + File::get<float, File>(QList<File>() << f1 << f2, "Key2"); // Error: Key doesn't exist in f2
  438 + File::get<QRectF, File>(QList<File>() << f1 << f2, "Key1"); // Error: float is not convertable to QRectF
136 439  
137   - File f1, f2;
138   - f1.set("Key1", QVariant::fromValue<float>(1));
139   - f1.set("Key2", QVariant::fromValue<float>(2));
140   - f2.set("Key1", QVariant::fromValue<float>(3));
141 440  
142   - File::get<float, File>(QList<File>() << f1 << f2, "Key1"); // returns [1., 3.]
143   - File::get<float, File>(QList<File>() << f1 << f2, "Key2"); // Error: Key doesn't exist in f2
144   - File::get<QRectF, File>(QList<File>() << f1 << f2, "Key1"); // Error: float is not convertable to QRectF
  441 +### [QList][QList]&lt;T&gt; get(const [QList][QList]&lt;U&gt; &fileList, const [QString][QString] &key, const T &defaultValue) {: #file-static-get-2 }
145 442  
146   -### static [QList][QList]&lt;T&gt; get(const [QList][QList]&lt;U&gt; &fileList, const [QString][QString] &key, const T &defaultValue)
  443 +Gather a list of <tt>T</tt> values associated with a metadata key from a provided list of files. <tt>T</tt> is a user provided type. If the key does not exist in the metadata of *any* file the provided **defaultValue** is used.
147 444  
148   -This function requires a type specification in place of T and U. Valid types for U are [File](#file) and [QString][QString]. T can be any type. Returns a list of the values of the key in each of the given files. If the key doesn't exist in any of the files or the value cannot be converted to type T the given defaultValue is returned.
  445 +* **function definition:**
  446 +
  447 + template<class T, class U> static QList<T> get(const QList<U> &fileList, const QString &key, const T &defaultValue)
  448 +
  449 +* **parameters:**
  450 +
  451 + Parameter | Type | Description
  452 + --- | --- | ---
  453 + fileList | const [QList][QList]&lt;U&gt; & | A list of files to parse for values. A type is required for U. Valid options are: <ul> <li>[File](#file)</li> <li>[QString][QString]</li> </ul>
  454 + key | const [QString][QString] & | A metadata key used to lookup the values.
  455 + defaultValue | const T & | The default value if the key is not in a file's metadata. A type is required for T. All types are valid.
  456 +
  457 +* **output:** ([QList][QList]&lt;T&gt;) A list of the values of type <tt>T</tt> associated with the given key. A type is required for <tt>T</tt>.
  458 +* **example:**
149 459  
150 460 File f1, f2;
151 461 f1.set("Key1", QVariant::fromValue<float>(1));
... ... @@ -156,76 +466,155 @@ This function requires a type specification in place of T and U. Valid types for
156 466 File::get<float, File>(QList<File>() << f1 << f2, "Key2", QList<float>() << 1); // returns [1.]
157 467 File::get<QRectF, File>(QList<File>() << f1 << f2, "Key1, QList<QRectF>()"); // returns []
158 468  
159   -### [QDebug][QDebug] operator <<([QDebug][QDebug] dbg, const [File](#file) &file)
160 469  
161   -Calls [flat](#qstring-flat-const) on the given file and that streams that file to stderr.
  470 +### [QDebug][QDebug] operator <<([QDebug][QDebug] dbg, const [File](#file) &file) {: #file-static-dbg-operator-ltlt }
162 471  
163   - File file("../path/to/pictures/picture.jpg");
164   - file.set("Key", QString("Value"));
  472 +Calls [flat](#file-function-flat) on the given file and then streams that file to stderr.
165 473  
166   - qDebug() << file; // "../path/to/pictures/picture.jpg[Key=Value]" streams to stderr
  474 +* **function definition:**
167 475  
168   -### [QDataStream][QDataStream] &operator <<([QDataStream][QDataStream] &stream, const [File](#file) &file)
  476 + QDebug operator <<(QDebug dbg, const File &file)
169 477  
170   -Serialize a file to a data stream.
  478 +* **parameter:**
  479 +
  480 + Parameter | Type | Description
  481 + --- | --- | ---
  482 + dbg | [QDebug][QDebug] | The debug stream
  483 + file | const [File](#file) & | File to stream
  484 +
  485 +* **output:** ([QDebug][QDebug] &) returns a reference to the updated debug stream
  486 +* **example:**
171 487  
172   - void store(QDataStream &stream)
173   - {
174 488 File file("../path/to/pictures/picture.jpg");
175 489 file.set("Key", QString("Value"));
176 490  
177   - stream << file; // "../path/to/pictures/picture.jpg[Key=Value]" serialized to the stream
178   - }
  491 + qDebug() << file; // "../path/to/pictures/picture.jpg[Key=Value]" streams to stderr
  492 +
  493 +
  494 +### [QDataStream][QDataStream] &operator <<([QDataStream][QDatastream] &stream, const [File](#file) &file) {: #file-static-stream-operator-ltlt }
  495 +
  496 +Serialize a file to a data stream.
  497 +
  498 +* **function definition:**
  499 +
  500 + QDataStream &operator <<(QDataStream &stream, const File &file)
  501 +
  502 +* **parameters:**
  503 +
  504 + Parameter | Type | Description
  505 + --- | --- | ---
  506 + stream | [QDataStream][QDataStream] | The data stream
  507 + file | const [File](#file) & | File to stream
179 508  
180   -### [QDataStream][QDataStream] &operator >>([QDataStream][QDataStream] &stream, [File](#file) &file)
  509 +* **output:** ([QDataStream][QDataStream] &) returns a reference to the updated data stream
  510 +* **example:**
  511 +
  512 + void store(QDataStream &stream)
  513 + {
  514 + File file("../path/to/pictures/picture.jpg");
  515 + file.set("Key", QString("Value"));
  516 +
  517 + stream << file; // "../path/to/pictures/picture.jpg[Key=Value]" serialized to the stream
  518 + }
  519 +
  520 +
  521 +### [QDataStream][QDataStream] &operator >>([QDataStream][QDataStream] &stream, const [File](#file) &file) {: #file-static-stream-operator-gtgt }
181 522  
182 523 Deserialize a file from a data stream.
183 524  
184   - void load(QDataStream &stream)
185   - {
186   - File in("../path/to/pictures/picture.jpg");
187   - in.set("Key", QString("Value"));
  525 +* **function definition:**
  526 +
  527 + QDataStream &operator >>(QDataStream &stream, const File &file)
  528 +
  529 +* **parameters:**
  530 +
  531 + Parameter | Type | Description
  532 + --- | --- | ---
  533 + stream | [QDataStream][QDataStream] | The data stream
  534 + file | const [File](#file) & | File to stream
  535 +
  536 +* **output:** ([QDataStream][QDataStream] &) returns a reference to the updated data stream
  537 +* **example:**
188 538  
189   - stream << in; // "../path/to/pictures/picture.jpg[Key=Value]" serialized to the stream
  539 + void load(QDataStream &stream)
  540 + {
  541 + File in("../path/to/pictures/picture.jpg");
  542 + in.set("Key", QString("Value"));
190 543  
191   - File out;
192   - stream >> out;
  544 + stream << in; // "../path/to/pictures/picture.jpg[Key=Value]" serialized to the stream
193 545  
194   - out.name; // returns "../path/to/pictures/picture.jpg"
195   - out.flat(); // returns "../path/to/pictures/picture.jpg[Key=Value]"
196   - }
  546 + File out;
  547 + stream >> out;
  548 +
  549 + out.name; // returns "../path/to/pictures/picture.jpg"
  550 + out.flat(); // returns "../path/to/pictures/picture.jpg[Key=Value]"
  551 + }
197 552  
198 553 ---
199 554  
200   -## Functions
  555 +## Functions {: #file-functions }
201 556  
202   -### Operator [QString][QString]() const
203 557  
204   -returns [name](#qstring-name). Allows Files to be used as [QString][QString].
  558 +### operator [QString][QString]() const {: #file-function-operator-qstring }
205 559  
206   -### [QString][QString] flat() const
  560 +Convenience function that allows [Files](#file) to be used as [QStrings][QString]
207 561  
208   -Returns the [name](#qstring-name) and [metadata](#qvariantmap-m_metadata) as string.
  562 +* **function definition:**
209 563  
210   - File file("../path/to/pictures/picture.jpg");
211   - file.set("Key1", QVariant::fromValue<float>(1));
212   - file.set("Key2", QVariant::fromValue<float>(2));
  564 + inline operator QString() const
213 565  
214   - file.flat(); // returns "../path/to/pictures/picture.jpg[Key1=1,Key2=2]"
  566 +* **parameters:** NONE
  567 +* **output:** ([QString][QString]) returns [name](#file-members-name).
215 568  
216   -### [QString][QString] hash() const
  569 +### [QString][QString] flat() const {: #file-function-flat }
217 570  
218   -Returns a hash of the file.
  571 +Function to output files in string formats.
219 572  
220   - File file("../path/to/pictures/picture.jpg");
221   - file.set("Key1", QVariant::fromValue<float>(1));
222   - file.set("Key2", QVariant::fromValue<float>(2));
  573 +* **function definition:**
  574 +
  575 + QString flat() const
223 576  
224   - file.hash(); // returns "kElVwY"
  577 +* **parameters:** NONE
  578 +* **output:** ([QString][QString]) returns the [file name](#file-members) and [metadata](#file-members-m_metadata) as a formated string. The format is *filename*[*key1=value1,key2=value2,...keyN=valueN*].
  579 +* **example:**
225 580  
226   -### [QStringList][QStringList] localKeys() const
  581 + File file("picture.jpg");
  582 + file.set("Key1", QVariant::fromValue<float>(1));
  583 + file.set("Key2", QVariant::fromValue<float>(2));
227 584  
228   -Returns an immutable version of the local metadata keys gotten by calling [metadata](#metadata).keys().
  585 + file.flat(); // returns "picture.jpg[Key1=1,Key2=2]"
  586 +
  587 +
  588 +### [QString][QString] hash() const {: #file-function-hash }
  589 +
  590 +Function to output a hash of the file.
  591 +
  592 +* **function definition:**
  593 +
  594 + QString hash() const
  595 +
  596 +* **parameters:** NONE
  597 +* **output:** ([QString][QString]) Returns a hash of the file.
  598 +* **example:**
  599 +
  600 + File file("../path/to/pictures/picture.jpg");
  601 + file.set("Key1", QVariant::fromValue<float>(1));
  602 + file.set("Key2", QVariant::fromValue<float>(2));
  603 +
  604 + file.hash(); // returns "kElVwY"
  605 +
  606 +
  607 +### [QStringList][QStringList] localKeys() const {: #file-function-localkeys }
  608 +
  609 +Function to get the private [metadata](#file-members-m_metadata) keys.
  610 +
  611 +* **function definition:**
  612 +
  613 + inline QStringList localKeys() const
  614 +
  615 +* **parameters:** NONE
  616 +* **output:** ([QStringList][QStringList]) Returns a list of the local [metadata](#file-members-m_metadata) keys. They are called local because they do not include the keys in the [global metadata](#context).
  617 +* **example:**
229 618  
230 619 File file("../path/to/pictures/picture.jpg");
231 620 file.set("Key1", QVariant::fromValue<float>(1));
... ... @@ -233,1099 +622,2674 @@ Returns an immutable version of the local metadata keys gotten by calling [metad
233 622  
234 623 file.localKeys(); // returns [Key1, Key2]
235 624  
236   -### [QVariantMap][QVariantMap] localMetadata() const
237 625  
238   -returns an immutable version of the local [metadata](#qvariantmap-m_metadata).
  626 +### [QVariantMap][QVariantMap] localMetadata() const {: #file-function-localmetadata }
239 627  
240   - File file("../path/to/pictures/picture.jpg");
241   - file.set("Key1", QVariant::fromValue<float>(1));
242   - file.set("Key2", QVariant::fromValue<float>(2));
  628 +Function to get the private [metadata](#file-members-m_metadata).
243 629  
244   - file.localMetadata(); // return QMap(("Key1", QVariant(float, 1)) ("Key2", QVariant(float, 2)))
  630 +* **function definition:**
245 631  
246   -### void append([QVariantMap][QVariantMap] &localMetadata)
  632 + inline QVariantMap localMetadata() const
247 633  
248   -Add new metadata fields to [metadata](#qvariantmap-m_metadata).
  634 +* **parameters:** NONE
  635 +* **output:** ([QVariantMap][QVariantMap]) Returns the local [metadata](#file-members-m_metadata).
  636 +* **example:**
249 637  
250   - File f();
251   - f.set("Key1", QVariant::fromValue<float>(1));
  638 + File file("../path/to/pictures/picture.jpg");
  639 + file.set("Key1", QVariant::fromValue<float>(1));
  640 + file.set("Key2", QVariant::fromValue<float>(2));
252 641  
253   - QVariantMap map;
254   - map.insert("Key2", QVariant::fromValue<float>(2));
255   - map.insert("Key3", QVariant::fromValue<float>(3));
  642 + file.localMetadata(); // return QMap(("Key1", QVariant(float, 1)) ("Key2", QVariant(float, 2)))
256 643  
257   - f.append(map);
258   - f.flat(); // returns "[Key1=1, Key2=2, Key3=3]"
259 644  
260   -### void append(const [File](#file) &other)
  645 +### void append(const [QVariantMap][QVariantMap] &localMetadata) {: #file-function-append-1 }
261 646  
262   -Append another file using the **;** separator. The file names are combined with the separator in between them. The metadata fields are combined. An additional field describing the separator is appended to the metadata.
  647 +Add new metadata fields to [metadata](#file-members-m_metadata).
263 648  
264   - File f1("../path/to/pictures/picture1.jpg");
265   - f1.set("Key1", QVariant::fromValue<float>(1));
  649 +* **function definition:**
266 650  
267   - File f2("../path/to/pictures/picture2.jpg");
268   - f2.set("Key2", QVariant::fromValue<float>(2));
269   - f2.set("Key3", QVariant::fromValue<float>(3));
  651 + void append(const QVariantMap &localMetadata)
270 652  
271   - f1.append(f2);
272   - f1.name; // return "../path/to/pictures/picture1.jpg;../path/to/pictures/picture2.jpg"
273   - f1.localKeys(); // returns "[Key1, Key2, Key3, separator]"
  653 +* **parameters:**
274 654  
  655 + Parameter | Type | Description
  656 + --- | --- | ---
  657 + localMetadata | const [QVariantMap][QVariantMap] & | metadata to append to the local [metadata](#file-members-m_metadata)
275 658  
276   -### [File](#file) &operator +=(const [QMap][QMap]&lt;[QString][QString], [QVariant][QVariant]&gt; &other)
  659 +* **output:** (void)
  660 +* **example:**
277 661  
278   -Shortcut operator to call [append](#void-appendqvariantmap-localmetadata).
  662 + File f();
  663 + f.set("Key1", QVariant::fromValue<float>(1));
279 664  
280   -### [File](#file) &operator +=(const [File](#file) &other)
  665 + QVariantMap map;
  666 + map.insert("Key2", QVariant::fromValue<float>(2));
  667 + map.insert("Key3", QVariant::fromValue<float>(3));
281 668  
282   -Shortcut operator to call [append](#void-appendconst-file-other).
  669 + f.append(map);
  670 + f.flat(); // returns "[Key1=1, Key2=2, Key3=3]"
283 671  
284   -### [QList][QList]&lt;[File](#file)&gt; split() const
285 672  
286   -Parse [name](#qstring-name) and split on the **;** separator. Each split file has the same [metadata](#qvariantmap-m_metadata) as the joined file.
  673 +### void append(const [File](#file) &other) {: #file-function-append-2 }
287 674  
288   - File f1("../path/to/pictures/picture1.jpg");
289   - f1.set("Key1", QVariant::fromValue<float>(1));
  675 +Append another file using the **;** separator. The [File](#file) [names](#file-members-name) are combined with the separator in between them. The [metadata](#file-members-m_metadata) fields are combined. An additional field describing the separator is appended to the [metadata](#file-members-m_metadata).
290 676  
291   - f1.split(); // returns [../path/to/pictures/picture1.jpg[Key1=1]]
  677 +* **function definition:**
292 678  
293   - File f2("../path/to/pictures/picture2.jpg");
294   - f2.set("Key2", QVariant::fromValue<float>(2));
295   - f2.set("Key3", QVariant::fromValue<float>(3));
  679 + void append(const File &other)
296 680  
297   - f1.append(f2);
298   - f1.split(); // returns [../path/to/pictures/picture1.jpg[Key1=1, Key2=2, Key3=3, separator=;],
299   - // ../path/to/pictures/picture2.jpg[Key1=1, Key2=2, Key3=3, separator=;]]
  681 +* **parameters:**
300 682  
301   -### [QList][QList]&lt;[File](#file)&gt; split(const [QString][QString] &separator) const
  683 + Parameter | Type | Description
  684 + --- | --- | ---
  685 + other | const [File](#file) & | File to append
302 686  
303   -Split the file on the given separator. Each split file has the same [metadata](#qvariantmap-m_metadata) as the joined file.
  687 +* **output:** (void)
  688 +* **example:**
304 689  
305   - File f("../path/to/pictures/picture1.jpg,../path/to/pictures/picture2.jpg");
306   - f.set("Key1", QVariant::fromValue<float>(1));
307   - f.set("Key2", QVariant::fromValue<float>(2));
  690 + File f1("../path/to/pictures/picture1.jpg");
  691 + f1.set("Key1", QVariant::fromValue<float>(1));
308 692  
309   - f.split(","); // returns [../path/to/pictures/picture1.jpg[Key1=1, Key2=2],
310   - ../path/to/pictures/picture2.jpg[Key1=1, Key2=2]]
  693 + File f2("../path/to/pictures/picture2.jpg");
  694 + f2.set("Key2", QVariant::fromValue<float>(2));
  695 + f2.set("Key3", QVariant::fromValue<float>(3));
311 696  
312   -### void setParameter(int index, const [QVariant][QVariant]&value)
  697 + f1.append(f2);
  698 + f1.name; // return "../path/to/pictures/picture1.jpg;../path/to/pictures/picture2.jpg"
  699 + f1.localKeys(); // returns "[Key1, Key2, Key3, separator]"
313 700  
314   -Insert a keyless value into the [metadata](#qvariantmap-m_metadata).
315 701  
316   - File f;
317   - f.set("Key1", QVariant::fromValue<float>(1));
318   - f.set("Key2", QVariant::fromValue<float>(2));
  702 +### [File](#file) &operator+=(const [QMap][QMap]&lt;[QString][QString], [QVariant][QVariant]&gt; &other) {: #file-function-operator-pe-1 }
319 703  
320   - f.setParameter(1, QVariant::fromValue<float>(3));
321   - f.setParameter(5, QVariant::fromValue<float>(4));
  704 +Shortcut operator to call [append](#file-function-append-1).
322 705  
323   - f.flat(); // returns "[Key1=1, Key2=2, Arg1=3, Arg5=4]"
  706 +* **function definition:**
324 707  
325   -### bool operator ==(const char \*other) const
  708 + inline File &operator+=(const QMap<QString, QVariant> &other)
326 709  
327   -Compare [name](#qstring-name) to c-style string other.
  710 +* **parameters:**
328 711  
329   - File f("picture.jpg");
  712 + Parameter | Type | Description
  713 + other | const [QMap][QMap]&lt;[QString][QString], [QVariant][QVariant]&gt; & | Metadata map to append to the local [metadata](#file-members-m_metadata)
330 714  
331   - f == "picture.jpg"; // returns true
332   - f == "other_picture.jpg"; // returns false
  715 +* **output:** ([File](#file) &) Returns a reference to this file after the append occurs.
  716 +* **example:**
333 717  
334   -### bool operator ==(const [File](#file) &other) const
  718 + File f();
  719 + f.set("Key1", QVariant::fromValue<float>(1));
335 720  
336   -Compare [name](#qstring-name) and [metadata](#qvariantmap-m_metadata) to another file name and metadata for equality.
  721 + QMap<QString, QVariant> map;
  722 + map.insert("Key2", QVariant::fromValue<float>(2));
  723 + map.insert("Key3", QVariant::fromValue<float>(3));
337 724  
338   - File f1("picture1.jpg");
339   - File f2("picture1.jpg");
  725 + f += map;
  726 + f.flat(); // returns "[Key1=1, Key2=2, Key3=3]"
340 727  
341   - f1 == f2; // returns true
342 728  
343   - f1.set("Key1", QVariant::fromValue<float>(1));
344   - f2.set("Key2", QVariant::fromValue<float>(2));
  729 +### [File](#file) &operator+=(const [File](#file) &other) {: #file-function-operator-pe-2 }
345 730  
346   - f1 == f2; // returns false (metadata doesn't match)
  731 +Shortcut operator to call [append](#file-function-append-2).
347 732  
348   -### bool operator !=(const [File](#file) &other) const
  733 +* **function definition:**
349 734  
350   -Compare [name](#qstring-name) and [metadata](#qvariantmap-m_metadata) to another file name and metadata for inequality.
  735 + inline File &operator+=(const File &other)
351 736  
352   - File f1("picture1.jpg");
353   - File f2("picture1.jpg");
  737 +* **parameters:**
354 738  
355   - f1 != f2; // returns false
  739 + Parameter | Type | Description
  740 + other | const [File](#file) & | File to append
356 741  
357   - f1.set("Key1", QVariant::fromValue<float>(1));
358   - f2.set("Key2", QVariant::fromValue<float>(2));
  742 +* **output:** ([File](#file) &) Returns a reference to this file after the append occurs.
  743 +* **example:**
359 744  
360   - f1 != f2; // returns true (metadata doesn't match)
  745 + File f1("../path/to/pictures/picture1.jpg");
  746 + f1.set("Key1", QVariant::fromValue<float>(1));
361 747  
362   -### bool operator <(const [File](#file) &other) const
  748 + File f2("../path/to/pictures/picture2.jpg");
  749 + f2.set("Key2", QVariant::fromValue<float>(2));
  750 + f2.set("Key3", QVariant::fromValue<float>(3));
363 751  
364   -Compare [name](#qstring-name) to a different file name.
  752 + f1 += f2;
  753 + f1.name; // return "../path/to/pictures/picture1.jpg;../path/to/pictures/picture2.jpg"
  754 + f1.localKeys(); // returns "[Key1, Key2, Key3, separator]"
365 755  
366   -### bool operator <=(const [File](#file) &other) const
367 756  
368   -Compare [name](#qstring-name) to a different file name.
  757 +### [QList][QList]&lt;[File](#file)&gt; split() const {: #file-function-split-1 }
369 758  
370   -### bool operator >(const [File](#file) &other) const
  759 +This function splits the [File](#file) into multiple files and returns them as a list. This is done by parsing the file [name](#file-members-name) and splitting on the separator located at [metadata](#file-members-m_metadata)["separator"]. If "separator" is not a [metadata](#file-members-m_metadata) key, the returned list has the original file as the only entry. Each new file has the same [metadata](#file-members-m_metadata) as the original, pre-split, file.
371 760  
372   -Compare [name](#qstring-name) to a different file name.
  761 +* **function definition:**
373 762  
374   -### bool operator >=(const [File](#file) &other) const
  763 + QList<File> split() const
375 764  
376   -Compare [name](#qstring-name) to a different file name.
  765 +* **parameters:** None
  766 +* **output:** ([QList][QList]&lt;[File](#file)&gt;) List of split files
  767 +* **example:**
377 768  
378   -### bool isNull() const
  769 + File f1("../path/to/pictures/picture1.jpg");
  770 + f1.set("Key1", QVariant::fromValue<float>(1));
379 771  
380   -Returns true if [name](#qstring-name) and [metadata](#qvariantmap-m_metadata) are empty and false otherwise.
  772 + f1.split(); // returns [../path/to/pictures/picture1.jpg[Key1=1]]
381 773  
382   - File f;
383   - f.isNull(); // returns true
  774 + File f2("../path/to/pictures/picture2.jpg");
  775 + f2.set("Key2", QVariant::fromValue<float>(2));
  776 + f2.set("Key3", QVariant::fromValue<float>(3));
384 777  
385   - f.set("Key1", QVariant::fromValue<float>(1));
386   - f.isNull(); // returns false
  778 + f1.append(f2);
  779 + f1.split(); // returns [../path/to/pictures/picture1.jpg[Key1=1, Key2=2, Key3=3, separator=;],
  780 + // ../path/to/pictures/picture2.jpg[Key1=1, Key2=2, Key3=3, separator=;]]
387 781  
388   -### bool isTerminal() const
389 782  
390   -Returns true if [name](#qstring-name) equals "Terminal".
  783 +### [QList][QList]&lt;[File](#file)&gt; split(const [QString][QString] &separator) const {: #file-function-split-2 }
391 784  
392   -### bool exists() const
  785 +This function splits the file into multiple files and returns them as a list. This is done by parsing the file [name](#file-members-name) and splitting on the given separator. Each new file has the same [metadata](#file-members-m_metadata) as the original, pre-split, file.
393 786  
394   -Returns true if the file at [name](#qstring-name) exists on disk.
  787 +* **function definition:**
395 788  
396   -### [QString][QString] fileName() const
  789 + QList<File> split(const QString &separator) const
397 790  
398   -Returns the file's base name and extension.
  791 +* **parameters:**
399 792  
400   - File file("../path/to/pictures/picture.jpg");
401   - file.fileName(); // returns "picture.jpg"
  793 + Parameter | Type | Description
  794 + --- | --- | ---
  795 + separator | const [QString][QString] & | Separator to split the file name on
402 796  
403   -### [QString][QString] baseName() const
  797 +* **output:** ([QList][QList]&lt;[File](#file)&gt;) List of split files
  798 +* **example:**
404 799  
405   -Returns the file's base name.
  800 + File f("../path/to/pictures/picture1.jpg,../path/to/pictures/picture2.jpg");
  801 + f.set("Key1", QVariant::fromValue<float>(1));
  802 + f.set("Key2", QVariant::fromValue<float>(2));
406 803  
407   - File file("../path/to/pictures/picture.jpg");
408   - file.baseName(); // returns "picture"
  804 + f.split(","); // returns [../path/to/pictures/picture1.jpg[Key1=1, Key2=2],
  805 + ../path/to/pictures/picture2.jpg[Key1=1, Key2=2]]
409 806  
410   -### [QString][QString] suffix() const
411 807  
412   -Returns the file's extension.
  808 +### void setParameter(int index, const [QVariant][QVariant] &value) {: #file-function-setparameter }
413 809  
414   - File file("../path/to/pictures/picture.jpg");
415   - file.suffix(); // returns "jpg"
  810 +Insert a keyless value into the [metadata](#file-members-m_metadata). Generic key of "ArgN" is used, where N is given as a parameter.
416 811  
417   -### [QString][QString] path() const
  812 +* **function definition:**
418 813  
419   -Return's the path of the file, excluding the name.
  814 + inline void setParameter(int index, const QVariant &value)
420 815  
421   - File file("../path/to/pictures/picture.jpg");
422   - file.suffix(); // returns "../path/to/pictures"
  816 +* **parameters:**
423 817  
424   -### [QString][QString] resolved() const
  818 + Parameter | Type | Description
  819 + --- | --- | ---
  820 + index | int | Number to append to generic key
  821 + value | const [QVariant][QVariant] & | Value to add to the metadata
425 822  
426   -Returns [name](#qstring-name). If name does not exist it prepends name with the path in Globals->path.
  823 +* **output:** (void)
  824 +* **see:** [containsParameter](#file-function-containsparameter), [getParameter](#file-function-getparameter)
  825 +* **example:**
427 826  
428   -### bool contains(const [QString][QString] &key) const
  827 + File f;
  828 + f.set("Key1", QVariant::fromValue<float>(1));
  829 + f.set("Key2", QVariant::fromValue<float>(2));
429 830  
430   -Returns True if the key is in the [metadata](#qvariantmap-m_metadata) and False otherwise.
  831 + f.setParameter(1, QVariant::fromValue<float>(3));
  832 + f.setParameter(5, QVariant::fromValue<float>(4));
431 833  
432   - File file;
433   - file.set("Key1", QVariant::fromValue<float>(1));
  834 + f.flat(); // returns "[Key1=1, Key2=2, Arg1=3, Arg5=4]"
434 835  
435   - file.contains("Key1"); // returns true
436   - file.contains("Key2"); // returns false
437 836  
438   -### bool contains(const [QStringList][QStringList] &keys) const
  837 +### bool containsParameter(int index) const {: #file-function-containsparameter }
439 838  
440   -Returns True if all of the keys are in the [metadata](#qvariantmap-m_metadata) and False otherwise.
  839 +Check if the local [metadata](#file-members-m_metadata) contains a keyless value.
441 840  
442   - File file;
443   - file.set("Key1", QVariant::fromValue<float>(1));
444   - file.set("Key2", QVariant::fromValue<float>(2));
  841 +* **function definition:**
445 842  
446   - file.contains(QStringList("Key1")); // returns true
447   - file.contains(QStringList() << "Key1" << "Key2") // returns true
448   - file.contains(QStringList() << "Key1" << "Key3"); // returns false
  843 + inline bool containsParameter(int index) const
449 844  
450   -### [QVariant][QVariant] value(const [QString][QString] &key) const
  845 +* **parameters:**
451 846  
452   -Returns the value associated with key in the [metadata](#qvariantmap-m_metadata).
  847 + Parameter | Type | Description
  848 + --- | --- | ---
  849 + index | int | Index of the keyless value to check for
453 850  
454   - File file;
455   - file.set("Key1", QVariant::fromValue<float>(1));
456   - file.value("Key1"); // returns QVariant(float, 1)
  851 +* **output:** (bool) Returns true if the local [metadata](#file-members-m_metadata) contains the keyless value, otherwise reutrns false.
  852 +* **see:** [setParameter](#file-function-setparameter), [getParameter](#file-function-getparameter)
  853 +* **example:**
457 854  
458   -### void set(const [QString][QString] &key, const [QVariant][QVariant] &value)
  855 + File f;
  856 + f.setParameter(1, QVariant::fromValue<float>(1));
  857 + f.setParameter(2, QVariant::fromValue<float>(2));
459 858  
460   -Insert or overwrite the [metadata](#qvariantmap-m_metadata) key with the given value.
  859 + f.containsParameter(1); // returns true
  860 + f.containsParameter(2); // returns true
  861 + f.containsParameter(3); // returns false
461 862  
462   - File f;
463   - f.flat(); // returns ""
464 863  
465   - f.set("Key1", QVariant::fromValue<float>(1));
466   - f.flat(); // returns "[Key1=1]"
  864 +### [QVariant][QVariant] getParameter(int index) const {: #file-function-getparameter }
467 865  
468   -### void set(const [QString][QString] &key, const [QString][QString] &value)
  866 +Get a keyless value from the local [metadata](#file-members-m_metadata). If the value does not exist an error is thrown.
469 867  
470   -Insert or overwrite the [metadata](#qvariantmap-m_metadata) key with the given value.
  868 +* **function definition:**
471 869  
472   - File f;
473   - f.flat(); // returns ""
  870 + inline QVariant getParameter(int index) const
474 871  
475   - f.set("Key1", QString("1"));
476   - f.flat(); // returns "[Key1=1]"
  872 +* **parameter:**
477 873  
478   -### void setList(const [QString][QString] &key, const [QList][QList]&lt;T&gt; &value)
  874 + Parameter | Type | Description
  875 + --- | --- | ---
  876 + index | int | Index of the keyless value to look up. If the index does not exist an error is thrown.
479 877  
480   -This function requires a type specification in place of T. Insert or overwrite the [metadata](#qvariantmap-m_metadata) key with the value. The value will remain a list and should be queried with the function [getList](#qlistt-getlistconst-qstring-key-const).
  878 +* **output:** ([QVariant][QVariant]) Returns the keyless value associated with the given index
  879 +* **see:** [setParameter](#file-function-setparameter), [containsParameter](#file-function-containsparameter)
  880 +* **example:**
481 881  
482   - File file;
  882 + File f;
  883 + f.setParameter(1, QVariant::fromValue<float>(1));
  884 + f.setParameter(2, QVariant::fromValue<float>(2));
483 885  
484   - QList<float> list = QList<float>() << 1 << 2 << 3;
485   - file.setList<float>("List", list);
486   - file.getList<float>("List"); // return [1., 2. 3.]
  886 + f.getParameter(1); // returns 1
  887 + f.getParameter(2); // returns 2
  888 + f.getParameter(3); // error: index does not exist
487 889  
488   -### void remove(const [QString][QString] &key)
489 890  
490   -Remove the key value pair associated with the given key from the [metadata](#metadata)
  891 +### bool operator==(const char \*other) const {: #file-function-operator-ee-1 }
491 892  
492   - File f;
493   - f.set("Key1", QVariant::fromValue<float>(1));
494   - f.set("Key2", QVariant::fromValue<float>(2));
  893 +Compare [name](#file-members-name) against a c-style string.
495 894  
496   - f.flat(); // returns "[Key1=1, Key2=2]"
  895 +* **function definition:**
497 896  
498   - f.remove("Key1");
499   - f.flat(); // returns "[Key2=2]"
  897 + inline bool operator==(const char *other) const
500 898  
501   -### T get(const [QString][QString] &key)
  899 +* **parameters:**
502 900  
503   -This function requires a type specification in place of T. Try and get the value associated with the given key in the [metadata](#qvariantmap-m_metadata). If the key does not exist or cannot be converted to the given type an error is thrown.
  901 + Parameter | Type | Description
  902 + --- | --- | ---
  903 + other | const char \* | C-style string to compare against
504 904  
505   - File f;
506   - f.set("Key1", QVariant::fromValue<float>(1));
  905 +* **output:** (bool) Returns true if the strings are equal, false otherwise.
  906 +* **example:**
507 907  
508   - f.get<float>("Key1"); // returns 1
509   - f.get<float>("Key2"); // Error: Key2 is not in the metadata
510   - f.get<QRectF>("Key1"); // Error: A float can't be converted to a QRectF
  908 + File f("picture.jpg");
511 909  
512   -### T get(const [QString][QString] &key, const T &defaultValue)
  910 + f == "picture.jpg"; // returns true
  911 + f == "other_picture.jpg"; // returns false
513 912  
514   -This function requires a type specification in place of T. Try and get the value associated with the given key in the [metadata](#qvariantmap-m_metadata). If the key does not exist or cannot be converted to the given type the defaultValue is returned.
515 913  
516   - File f;
517   - f.set("Key1", QVariant::fromValue<float>(1));
  914 +### bool operator==(const [File](#file) &other) const {: #file-function-operator-ee-2 }
518 915  
519   - f.get<float>("Key1", 5); // returns 1
520   - f.get<float>("Key2", 5); // returns 5
521   - f.get<QRectF>("Key1", QRectF(0, 0, 10, 10)); // returns QRectF(0, 0, 10x10)
  916 +Compare [name](#file-members-name) and [metadata](#file-members-m_metadata) against another file name and metadata.
522 917  
523   -### bool getBool(const [QString][QString] &key, bool defaultValue = false)
  918 +* **function definition:**
524 919  
525   -This is a specialization of [get](#t-getconst-qstring-key) for the boolean type. If the key is not in the [metadata](#qvariantmap-m_metadata) the defaultValue is returned. If the key is in the metadata but the value cannot be converted to a bool **true** is returned. If the key is found and the value can be converted to a bool the value is returned.
  920 + inline bool operator==(const File &other) const
526 921  
527   - File f;
528   - f.set("Key1", QVariant::fromValue<bool>(true));
529   - f.set("Key2", QVariant::fromValue<float>(10));
  922 +* **parameters:**
530 923  
531   - f.getBool("Key1"); // returns true
532   - f.getBool("Key2") // returns true (key found)
533   - f.getBool("Key3"); // returns false (default value)
534   - f.getBool("Key3", true); // returns true (default value)
  924 + Parameter | Type | Description
  925 + --- | --- | ---
  926 + other | const [File](#file) & | File to compare against
535 927  
536   -### [QList][QList]&lt;T&gt; getList(const [QString][QString] &key) const
  928 +* **output:** (bool) Returns true if the names and metadata are equal, false otherwise.
  929 +* **example:**
537 930  
538   -This function requires a type specification in place of T. Similar to [get](#t-getconst-qstring-key) only this returns a list. If the key is not found or the value cannot be converted into a [QList][QList]&lt;T&gt; an error is thrown.
  931 + File f1("picture1.jpg");
  932 + File f2("picture1.jpg");
539 933  
540   - File file;
  934 + f1 == f2; // returns true
541 935  
542   - QList<float> list = QList<float>() << 1 << 2 << 3;
543   - file.setList<float>("List", list);
  936 + f1.set("Key1", QVariant::fromValue<float>(1));
  937 + f2.set("Key2", QVariant::fromValue<float>(2));
544 938  
545   - file.getList<float>("List"); // return [1., 2. 3.]
546   - file.getList<QRectF>("List"); // Error: float cannot be converted to QRectF
547   - file.getList<float>("Key"); // Error: key doesn't exist
  939 + f1 == f2; // returns false (metadata doesn't match)
548 940  
549   -### [QList][QList]&lt;T&gt; getList(const [QString][QString] &key, const [QList][QList]&lt;T&gt; &defaultValue) const
550 941  
551   -This function requires a type specification in place of T. Similar to [get](#t-getconst-qstring-key-const-t-defaultvalue) only this returns a list. If the key is not found or the value cannot be converted into a [QList][QList]&lt;T&gt; the supplied defaultValue is returned.
  942 +### bool operator!=(const [File](#file) &other) const {: #file-function-operator-ne }
552 943  
553   - File file;
  944 +Compare [name](#file-members-name) and [metadata](#file-members-m_metadata) against another file name and metadata.
554 945  
555   - QList<float> list = QList<float>() << 1 << 2 << 3;
556   - file.setList<float>("List", list);
  946 +* **function definition:**
557 947  
558   - file.getList<float>("List", QList<float>()); // return [1., 2. 3.]
559   - file.getList<QRectF>("List", QList<QRectF>()); // return []
560   - file.getList<float>("Key", QList<float>() << 1 << 2 << 3); // return [1., 2., 3.]
  948 + inline bool operator!=(const File &other) const
561 949  
562   -### [QList][QList]&lt;[QPointF][QPointF]&gt; namedPoints() const
  950 +* **parameters:**
563 951  
564   -Find all of the points that can be parsed from [metadata](#qvariantmap-m_metadata) keys and return them. Only values that are convertable to [QPointF][QPointF] are found. Values that can be converted to [QList][QList]>&lt;[QPointF][QPointF]&gt; are not included.
  952 + Parameter | Type | Description
  953 + --- | --- | ---
  954 + other | const [File](#file) & | File to compare against
565 955  
566   - File file;
567   - file.set("Key1", QVariant::fromValue<QPointF>(QPointF(1, 1)));
568   - file.set("Key2", QVariant::fromValue<QPointF>(QPointF(2, 2)));
569   - file.set("Points", QVariant::fromValue<QPointF>(QPointF(3, 3)))
  956 +* **output:** (bool) Returns true if the names and metadata are not equal, false otherwise.
  957 +* **example:**
570 958  
571   - f.namedPoints(); // returns [QPointF(1, 1), QPointF(2, 2), QPointF(3, 3)]
  959 + File f1("picture1.jpg");
  960 + File f2("picture1.jpg");
572 961  
573   - file.setPoints(QList<QPointF>() << QPointF(3, 3)); // changes metadata["Points"] to QList<QPointF>
574   - f.namedPoints(); // returns [QPointF(1, 1), QPointF(2, 2)]
  962 + f1 != f2; // returns false
575 963  
576   -### [QList][QList]&lt;[QPointf][QPointF]>&gt; points() const
  964 + f1.set("Key1", QVariant::fromValue<float>(1));
  965 + f2.set("Key2", QVariant::fromValue<float>(2));
577 966  
578   -Returns the list of points stored in [metadata](#qvariantmap-m_metadata)["Points"]. A list is expected and a single point not in a list will not be returned. Convenience functions [appendPoint](#void-appendpointconst-qpointf-point), [appendPoints](#void-appendpointsconst-qlistqpointf-points), [clearPoints](#void-clearpoints) and [setPoints](#void-setpointsconst-qlistqpointf-points) have been provided to manipulate the internal points list.
  967 + f1 != f2; // returns true (metadata doesn't match)
579 968  
580   - File file;
581   - file.set("Points", QVariant::fromValue<QPointF>(QPointF(1, 1)));
582   - file.points(); // returns [] (point is not in a list)
583 969  
584   - file.setPoints(QList<QPointF>() << QPointF(2, 2));
585   - file.points(); // returns [QPointF(2, 2)]
  970 +### bool operator<(const [File](#file) &other) const {: #file-function-operator-lt }
586 971  
587   -### void appendPoint(const [QPointF][QPointF] &point)
  972 +Compare [name](#file-members-name) against another file name.
588 973  
589   -Add a point to the file's points list stored in [metadata](#qvariantmap-m_metadata)["Points"]
  974 +* **function definition:**
590 975  
591   - File file;
592   - file.points(); // returns []
  976 + inline bool operator<(const File &other) const
593 977  
594   - file.appendPoint(QPointF(1, 1));
595   - file.points(); // returns [QPointF(1, 1)]
  978 +* **parameters:**
596 979  
597   -### void appendPoints(const [QList][QList]&lt;[QPointF][QPointF]&gt; &points)
  980 + Parameter | Type | Description
  981 + --- | --- | ---
  982 + other | const [File](#file) & | File to compare against
598 983  
599   -Add a list of points to the file's points list stored in [metadata](#qvariantmap-m_metadata)["Points"]
  984 +* **output:** (bool) Returns true if [name](#file-members-name) < others.name
600 985  
601   - File file;
602   - file.points(); // returns []
603 986  
604   - file.appendPoints(QList<QPointF>() << QPointF(1, 1) << QPointF(2, 2));
605   - file.points(); // returns [QPointF(1, 1), QPointF(2, 2)]
  987 +### bool operator<=(const [File](#file) &other) const {: #file-function-operator-lte }
606 988  
607   -### void clearPoints()
  989 +Compare [name](#file-members-name) against another file name.
608 990  
609   -Clear the list of points stored in [metadata](#qvariantmap-m_metadata)["Points"].
  991 +* **function definition:**
610 992  
611   - File file;
612   - file.appendPoints(QList<QPointF>() << QPointF(1, 1) << QPointF(2, 2));
613   - file.points(); // returns [QPointF(1, 1), QPointF(2, 2)]
  993 + inline bool operator<=(const File &other) const
614 994  
615   - file.clearPoints();
616   - file.points(); // returns []
  995 +* **parameters:**
617 996  
618   -### void setPoints(const [QList][QList]&lt;[QPointF][QPointF]&gt; &points)
  997 + Parameter | Type | Description
  998 + --- | --- | ---
  999 + other | const [File](#file) & | File to compare against
619 1000  
620   -Clears the points stored in [metadata](#qvariantmap-m_metadata) and replaces them with points.
  1001 +* **output:** (bool) Returns true if [name](#file-members-name) <= others.name
621 1002  
622   - File file;
623   - file.appendPoints(QList<QPointF>() << QPointF(1, 1) << QPointF(2, 2));
624   - file.points(); // returns [QPointF(1, 1), QPointF(2, 2)]
625 1003  
626   - file.setPoints(QList<QPointF>() << QPointF(3, 3) << QPointF(4, 4));
627   - file.points(); // returns [QPointF(3, 3), QPointF(4, 4)]
  1004 +### bool operator>(const [File](#file) &other) const {: #file-function-operator-gt }
628 1005  
629   -### [QList][QList]&lt;[QRectF][QRectF]&gt; namedRects() const
  1006 +Compare [name](#file-members-name) against another file name.
630 1007  
631   -Find all of the rects that can be parsed from [metadata](#qvariantmap-m_metadata) keys and return them. Only values that are convertable to [QRectF][QRectF] are found. Values that can be converted to [QList][QList]&lt;[QRectF][QRectF]&gt; are not included.
  1008 +* **function definition:**
632 1009  
633   - File file;
634   - file.set("Key1", QVariant::fromValue<QRectF>(QRectF(1, 1, 5, 5)));
635   - file.set("Key2", QVariant::fromValue<QRectF>(QRectF(2, 2, 5, 5)));
636   - file.set("Rects", QVariant::fromValue<QRectF>(QRectF(3, 3, 5, 5)));
  1010 + inline bool operator>(const File &other) const
637 1011  
638   - f.namedRects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5), QRectF(3, 3, 5x5)]
  1012 +* **parameters:**
639 1013  
640   - file.setRects(QList<QRectF>() << QRectF(3, 3, 5x5)); // changes metadata["Rects"] to QList<QRectF>
641   - f.namedRects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1014 + Parameter | Type | Description
  1015 + --- | --- | ---
  1016 + other | const [File](#file) & | File to compare against
642 1017  
643   -### [QList][QList]&lt;[QRectF][QRectF]&gt; rects() const
  1018 +* **output:** (bool) Returns true if [name](#file-members-name) > others.name
644 1019  
645   -Returns the list of points stored in [metadata](#qvariantmap-m_metadata)["Rects"]. A list is expected and a single rect not in a list will not be returned. Convenience functions [appendRect](#void-appendrectconst-qrectf-rect), [appendRects](#void-appendrectsconst-qlistqrectf-rects), [clearRects](#void-clearrects) and [setRects](#void-setrectsconst-qlistqrectf-rects) have been provided to manipulate the internal points list.
646 1020  
647   - File file;
648   - file.set("Rects", QVariant::fromValue<QRectF>(QRectF(1, 1, 5, 5)));
649   - file.rects(); // returns [] (rect is not in a list)
  1021 +### bool operator>=(const [File](#file) &other) const {: #file-function-operator-gte }
650 1022  
651   - file.setRects(QList<QRectF>() << QRectF(2, 2, 5, 5));
652   - file.rects(); // returns [QRectF(2, 2, 5x5)]
  1023 +Compare [name](#file-members-name) against another file name.
653 1024  
654   -### void appendRect(const [QRectF][QRectF] &rect)
  1025 +* **function definition:**
655 1026  
656   -Add a rect to the file's rects list stored in [metadata](#qvariantmap-m_metadata)["Rects"].
  1027 + inline bool operator>=(const File &other) const
657 1028  
658   - File file;
659   - file.rects(); // returns []
  1029 +* **parameters:**
660 1030  
661   - file.appendRect(QRectF(1, 1, 5, 5));
662   - file.rects(); // returns [QRectF(1, 1, 5x5)]
  1031 + Parameter | Type | Description
  1032 + --- | --- | ---
  1033 + other | const [File](#file) & | File to compare against
663 1034  
664   -### void appendRect(const [Rect][Rect] &rect)
  1035 +* **output:** (bool) Returns true if [name](#file-members-name) >= others.name
665 1036  
666   -Add a OpenCV style rect to the file's rects list stored in [metadata](#qvariantmap-m_metadata)["Rects"]. The rect is automatically converted to a QRectF.
667 1037  
668   - File file;
669   - file.rects(); // returns []
  1038 +### bool isNull() const {: #file-function-isnull }
670 1039  
671   - file.appendRect(cv::Rect(1, 1, 5, 5)); // automatically converted to QRectF
672   - file.rects(); // returns [QRectF(1, 1, 5x5)]
  1040 +Check if the file is null.
673 1041  
674   -### void appendRects(const [QList][QList]&lt;[QRectF][QRectF]&gt; &rects)
  1042 +* **function definition:**
675 1043  
676   -Add a list of rects to the file's rects list stored in [metadata](#qvariantmap-m_metadata)["Rects"]
  1044 + inline bool isNull() const
677 1045  
678   - File file;
679   - file.rects(); // returns []
  1046 +* **parameters:** NONE
  1047 +* **output:** (bool) Returns true if [name](#file-members-name) and [metadata](#file-members-m_metadata) are empty, false otherwise.
  1048 +* **example:**
680 1049  
681   - file.appendRects(QList<QRectF>() << QRectF(1, 1, 5, 5) << QRectF(2, 2, 5, 5));
682   - file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1050 + File f;
  1051 + f.isNull(); // returns true
683 1052  
684   -### void appendRects(const [QList][QList]&lt;[Rect][Rect]&gt; &rects)
  1053 + f.set("Key1", QVariant::fromValue<float>(1));
  1054 + f.isNull(); // returns false
685 1055  
686   -Add a list of OpenCV style rects to the file's rects list stored in [metadata](#qvariantmap-m_metadata)["Rects"]. Each rect is automatically converted to a QRectF.
687 1056  
688   - File file;
689   - file.rects(); // returns []
  1057 +### bool isTerminal() const {: #file-function-isterminal }
690 1058  
691   - file.appendRects(QList<cv::Rect>() << cv::Rect(1, 1, 5, 5) << cv::Rect(2, 2, 5, 5));
692   - file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1059 +Checks if the value of [name](#file-members-name) == "terminal".
693 1060  
  1061 +* **function definition:**
694 1062  
695   -### void clearRects()
  1063 + inline bool isTerminal() const
696 1064  
697   -Clear the list of rects stored in [metadata](#qvariantmap-m_metadata)["Rects"].
  1065 +* **parameters:** NONE
  1066 +* **output:** (bool) Returns true if [name](#file-members-name) == "terminal", false otherwise.
  1067 +* **example:**
698 1068  
699   - File file;
700   - file.appendRects(QList<QRectF>() << QRectF(1, 1, 5, 5) << QRectF(2, 2, 5, 5));
701   - file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1069 + File f1("terminal"), f2("not_terminal");
702 1070  
703   - file.clearRects();
704   - file.rects(); // returns []
  1071 + f1.isTerminal(); // returns true
  1072 + f2.isTerminal(); // returns false
705 1073  
706   -### void setRects(const [QList][QList]&lt;[QRectF][QRectF]&gt; &rects)
707 1074  
708   -Clears the rects stored in [metadata](#qvariantmap-m_metadata)["Rects"] and replaces them with the given rects.
  1075 +### bool exists() const {: #file-function-exists }
709 1076  
710   - File file;
711   - file.appendRects(QList<QRectF>() << QRectF(1, 1, 5, 5) << QRectF(2, 2, 5, 5));
712   - file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1077 +Check if the file exists on disk.
713 1078  
714   - file.setRects(QList<QRectF>() << QRectF(3, 3, 5, 5) << QRectF(4, 4, 5, 5));
715   - file.rects(); // returns [QRectF(3, 3, 5x5), QRectF(4, 4, 5x5)]
  1079 +* **function definition:**
716 1080  
717   -### void setRects(const [QList][QList]&lt;[Rect][Rect]&gt; &rects)
  1081 + inline bool exists() const
718 1082  
719   -Clears the rects stored in [metadata](#qvariantmap-m_metadata)["Rects"] and replaces them with the given OpenCV style rects.
  1083 +* **parameters:** NONE
  1084 +* **output:** Returns true if [name](#file-members-name) exists on disk, false otherwise.
  1085 +* **example:**
720 1086  
721   - File file;
722   - file.appendRects(QList<cv::Rect>() << cv::Rect(1, 1, 5, 5) << cv::Rect(2, 2, 5, 5));
723   - file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1087 + File f1("/path/to/file/that/exists"), f2("/path/to/non/existant/file");
724 1088  
725   - file.setRects(QList<cv::Rect>() << cv::Rect(3, 3, 5, 5) << cv::Rect(4, 4, 5, 5));
726   - file.rects(); // returns [QRectF(3, 3, 5x5), QRectF(4, 4, 5x5)]
  1089 + f1.exists(); // returns true
  1090 + f2.exists(); // returns false
727 1091  
728   ----
729 1092  
730   -# FileList
  1093 +### [QString][QString] fileName() const {: #file-function-filename }
731 1094  
732   -Inherits [QList][QList]&lt;[File](#file)&gt;.
  1095 +Get the file's base name and extension.
733 1096  
734   -A convenience class for dealing with lists of files.
  1097 +* **function definition:**
735 1098  
736   -## Members
  1099 + inline QString fileName() const
737 1100  
738   ----
  1101 +* **parameters:** NONE
  1102 +* **output:** ([QString][QString]) Returns the base name + extension of [name](#file-members-name)
  1103 +* **example:**
739 1104  
740   -## Constructors
  1105 + File file("../path/to/pictures/picture.jpg");
  1106 + file.fileName(); // returns "picture.jpg"
741 1107  
742   -### FileList()
743 1108  
744   -Default constructor. Doesn't do anything
  1109 +### [QString][QString] baseName() const {: #file-function-basename }
745 1110  
746   -### FileList(int n)
  1111 +Get the file's base name.
747 1112  
748   -Initialize the [FileList](#filelist) with n empty files
  1113 +* **function definition:**
749 1114  
750   -### FileList(const [QStringList][QStringList] &files)
  1115 + inline QString baseName() const
751 1116  
752   -Initialize the [FileList](#filelist) from a list of strings. Each string should have the format "filename[key1=value1, key2=value2, ... keyN=valueN]"
  1117 +* **parameters:** NONE
  1118 +* **output:** ([QString][QString]) Returns the base name of [name](#file-members-name)
  1119 +* **example:**
753 1120  
754   -### FileList(const [QList][QList]&lt;[File](#file)&gt; &files)
  1121 + File file("../path/to/pictures/picture.jpg");
  1122 + file.baseName(); // returns "picture"
755 1123  
756   -Initialize the [FileList](#filelist) from a list of [files](#file).
757 1124  
758   ----
  1125 +### [QString][QString] suffix() const {: #file-function-suffix }
759 1126  
760   -## Static Functions
  1127 +Get the file's extension.
761 1128  
762   -### static FileList fromGallery(const [File](#file) &gallery, bool cache = false)
  1129 +* **function definition:**
763 1130  
764   -Creates a [FileList](#filelist) from a [Gallery](#gallery). Galleries store one or more [Templates](#template) on disk. Common formats include csv, xml, and gal, which is a unique OpenBR format. Read more about this in the [Gallery](#gallery) section. This function creates a [FileList](#filelist) by parsing the stored gallery based on its format. Cache determines whether the gallery should be stored for faster reading later.
  1131 + inline QString suffix() const
765 1132  
766   - File gallery("gallery.csv");
  1133 +* **parameters:** NONE
  1134 +* **output:** ([QString][QString]) Returns the extension of [name](#file-members-name)
  1135 +* **example:**
767 1136  
768   - FileList fList = FileList::fromGallery(gallery);
769   - fList.flat(); // returns all the files that have been loaded from disk. It could
770   - // be 1 or 100 depending on what was stored.
  1137 + File file("../path/to/pictures/picture.jpg");
  1138 + file.suffix(); // returns "jpg"
771 1139  
772   ----
773 1140  
774   -## Functions
  1141 +### [QString][QString] path() const {: #file-function-path }
775 1142  
776   -### [QStringList][QStringList] flat() const
  1143 +Get the path of the file without the name.
777 1144  
778   -Calls [flat](#qstring-flat-const) on every [File](#file) in the list and returns the resulting strings as a [QStringList][QStringList].
  1145 +* **function definition:**
779 1146  
780   - File f1("picture1.jpg"), f2("picture2.jpg");
781   - f1.set("Key", QString("Value"));
  1147 + inline QString path() const
782 1148  
783   - FileList fList(QList<File>() << f1 << f2);
784   - fList.flat(); // returns ["picture1.jpg[Key=Value]", "picture2.jpg"]
  1149 +* **parameters:** NONE
  1150 +* **output:** ([QString][QString]) Returns the path of [name](#file-members-name).
  1151 +* **example:**
785 1152  
786   -### [QStringList][QStringList] names() const
  1153 + File file("../path/to/pictures/picture.jpg");
  1154 + file.suffix(); // returns "../path/to/pictures"
787 1155  
788   -Stores the name of every [file](#file) in the list and returns the resulting strings as a [QStringList][QStringList].
789 1156  
790   - File f1("picture1.jpg"), f2("picture2.jpg");
791   - f1.set("Key", QString("Value"));
  1157 +### [QString][QString] resolved() const {: #file-function-resolved }
792 1158  
793   - FileList fList(QList<File>() << f1 << f2);
794   - fList.names(); // returns ["picture1.jpg", "picture2.jpg"]
  1159 +Get the full path for the file. This is done in three steps:
795 1160  
796   -### void sort(const [QString][QString] &key)
  1161 +1. If [name](#file-members-name) exists, return [name](#file-members-name).
  1162 +2. Prepend each path stored in [Globals->path](#context-members-path) to [name](#file-members-name). If the combined name exists then it is returned.
  1163 +3. Prepend each path stored in [Globals->path](#context-members-path) to [fileName](#file-function-filename). If the combined name exists then it is returned.
797 1164  
798   -Sorts the [FileList](#filelist) based on the value associated with the given key in each file.
  1165 +If none of the attempted names exist, [name](#file-members-name) is returned unmodified.
799 1166  
800   - File f1("1"), f2("2"), f3("3");
801   - f1.set("Key", QVariant::fromValue<float>(3));
802   - f2.set("Key", QVariant::fromValue<float>(1));
803   - f3.set("Key", QVariant::fromValue<float>(2));
  1167 +* **function definition:**
804 1168  
805   - FileList fList(QList<File>() << f1 << f2 << f3);
806   - fList.names(); // returns ["1", "2", "3"]
  1169 + QString resolved() const
807 1170  
808   - fList.sort("Key");
809   - fList.names(); // returns ["2", "3", "1"]
  1171 +* **parameters:** NONE
  1172 +* **output:** ([QString][QString]) Returns the resolved string if it can be created. Otherwise it returns [name](#file-members-name)
810 1173  
811   -### [QList][QList]&lt;int&gt; crossValidationPartitions() const
812 1174  
813   -Returns the cross-validation partition (default=0) for each file in the list. The partition is stored with the [metadata](#qvariantmap-m_metadata) key "Partition".
  1175 +### bool contains(const [QString][QString] &key) const {: #file-function-contains-1 }
814 1176  
815   - File f1, f2, f3;
816   - f1.set("Partition", QVariant::fromValue<int>(1));
817   - f3.set("Partition", QVariant::fromValue<int>(3));
  1177 +Check if a given key is in the local [metadata](#file-members-m_metadata).
818 1178  
819   - FileList fList(QList<File>() << f1 << f2 << f3);
820   - fList.crossValidationPartitions(); // returns [1, 0, 3]
  1179 +* **function definition:**
821 1180  
822   -### int failures() const
  1181 + bool contains(const QString &key) const
823 1182  
824   -Returns the number of files that have [FTE](#bool-fte) = **True**.
  1183 +* **parameters:**
825 1184  
826   - File f1, f2, f3;
827   - f1.fte = false;
828   - f2.fte = true;
829   - f3.fte = true;
  1185 + Parameter | Type | Description
  1186 + --- | --- | ---
  1187 + key | const [QString][QString] & | Key to check the [metadata](#file-members-m_metadata) for
830 1188  
831   - FileList fList(QList<File>() << f1 << f2 << f3);
832   - fList.failures(); // returns 2
  1189 +* **output:** (bool) Returns true if the given key is in the [metadata](#file-members-m_metadata), false otherwise.
  1190 +* **example:**
833 1191  
834   ----
  1192 + File file;
  1193 + file.set("Key1", QVariant::fromValue<float>(1));
835 1194  
836   -# Template
  1195 + file.contains("Key1"); // returns true
  1196 + file.contains("Key2"); // returns false
837 1197  
838   -Inherits [QList][QList]&lt;[Mat][Mat]&gt;.
839 1198  
840   -A list of matrices associated with a file.
  1199 +### bool contains(const [QStringList][QStringList] &keys) const {: #file-function-contains-2 }
841 1200  
842   -The Template is one of two important data structures in OpenBR (the [File](#file) is the other).
843   -A template represents a biometric at various stages of enrollment and can be modified by [Transforms](#transform) and compared to other [templates](#template) with [Distance](#distance).
  1201 +Check if a list of keys is in the local [metadata](#file-members-m_metadata).
844 1202  
845   -While there exist many cases (ex. video enrollment, multiple face detects, per-patch subspace learning, ...) where the template will contain more than one matrix,
846   -in most cases templates have exactly one matrix in their list representing a single image at various stages of enrollment.
847   -In the cases where exactly one image is expected, the template provides the function m() as an idiom for treating it as a single matrix.
848   -Casting operators are also provided to pass the template into image processing functions expecting matrices.
  1203 +* **function definition:**
849 1204  
850   -Metadata related to the template that is computed during enrollment (ex. bounding boxes, eye locations, quality metrics, ...) should be assigned to the template's [File](#file-file) member.
  1205 + bool contains(const QStringList &keys) const
851 1206  
852   -## Members
  1207 +* **parameters:**
853 1208  
854   -### File file
  1209 + Parameter | Type | Description
  1210 + --- | --- | ---
  1211 + keys | const [QStringList][QStringList] & | Keys to check the [metadata](#file-members-m_metadata) for
855 1212  
856   -The [File](#file) that constructs the [template](#template)
  1213 +* **output:** (bool) Returns true if *all* of the given keys are in the [metadata](#file-members-m_metadata), false otherwise.
  1214 +* **example:**
857 1215  
858   ----
  1216 + File file;
  1217 + file.set("Key1", QVariant::fromValue<float>(1));
  1218 + file.set("Key2", QVariant::fromValue<float>(2));
859 1219  
860   -## Constructors
  1220 + file.contains(QStringList("Key1")); // returns true
  1221 + file.contains(QStringList() << "Key1" << "Key2") // returns true
  1222 + file.contains(QStringList() << "Key1" << "Key3"); // returns false
861 1223  
862   -### Template()
863 1224  
864   -The default template constructor. It doesn't do anything.
  1225 +### [QVariant][QVariant] value(const [QString][QString] &key) const {: #file-function-value }
865 1226  
866   -### Template(const [File](#file) &file)
  1227 +Get the value associated with a given key from the [metadata](#file-members-m_metadata). If the key is not found in the [local metadata](#file-members-m_metadata), the [global metadata](#context) is searched. In a special case, the key can be "name". This returns the file's [name](#file-members-name).
867 1228  
868   -Sets [file](#file-file) to the given file.
  1229 +* **function description:**
869 1230  
870   -### Template(const [File](#file) &file, const [Mat][Mat] &mat)
  1231 + QVariant value(const QString &key) const
871 1232  
872   -Sets [file](#file-file) to the given file and appends the given mat to itself.
  1233 +* **parameters:**
873 1234  
874   -### Template(const [File](#file) &file, const [QList][QList]&lt;[Mat][Mat]&gt &mats)
  1235 + Parameter | Type | Description
  1236 + --- | --- | ---
  1237 + key | const [QString][QString] & | Key to look up the value in the [local metadata](#file-members-m_metadata) or [global metadata](#context). The key can also be "name".
875 1238  
876   -Sets [file](#file-file) to the given file and appends the given mats to itself.
  1239 +* **output:** ([QVariant][QVariant]) Returns the key associated with the value from either the [local](#file-members-m_metadata) or [global](#context) metadata. If the key is "name", [name](#file-members-name) is returned.
  1240 +* **example:**
877 1241  
878   -### Template(const [Mat][Mat] &mat)
  1242 + File file;
  1243 + file.set("Key1", QVariant::fromValue<float>(1));
  1244 + file.value("Key1"); // returns QVariant(float, 1)
879 1245  
880   -Appends the given mat to itself.
881 1246  
  1247 +### void set(const [QString][QString] &key, const [QVariant][QVariant] &value) {: #file-function-set-1 }
882 1248  
883   ----
  1249 +Insert a value into the [metadata](#file-members-m_metadata) using a provided key. If the key already exists the new value will override the old one.
884 1250  
885   -## Static Functions
  1251 +* **function description:**
886 1252  
887   -[QDataStream][QDataStream] &operator <<([QDataStream][QDataStream] &stream, const [Template](#template) &t)
  1253 + inline void set(const QString &key, const QVariant &value)
888 1254  
889   -Serialize a template.
  1255 +* **parameters:**
890 1256  
891   - void store(QDataStream &stream)
892   - {
893   - Template t("picture.jpg");
894   - t.append(Mat::ones(1, 1, CV_8U));
  1257 + Parameters | Type | Description
  1258 + --- | --- | ---
  1259 + key | const [QString][QString] & | Key to store the given value in the [metadata](#file-members-m_metadata)
  1260 + value | const [QVariant][QVariant] & | Value to be stored
895 1261  
896   - stream << t; // "["1"]picture.jpg" serialized to the stream
897   - }
  1262 +* **output:** (void)
  1263 +* **example:**
898 1264  
899   -[QDataStream][QDataStream] &operator >>([QDataStream][QDataStream] &stream, const [Template](#template) &t)
  1265 + File f;
  1266 + f.flat(); // returns ""
900 1267  
901   -Deserialize a template.
  1268 + f.set("Key1", QVariant::fromValue<float>(1));
  1269 + f.flat(); // returns "[Key1=1]"
902 1270  
903   - void load(QDataStream &stream)
904   - {
905   - Template in("picture.jpg");
906   - in.append(Mat::ones(1, 1, CV_8U));
907 1271  
908   - stream << in; // "["1"]picture.jpg" serialized to the stream
  1272 +### void set(const [QString][QString] &key, const [QString][QString] &value) {: #file-function-set-2 }
909 1273  
910   - Template out;
911   - stream >> out;
  1274 +Insert a value into the [metadata](#file-members-m_metadata) using a provided key. If the key already exists the new value will override the old one.
912 1275  
913   - out.file; // returns "picture.jpg"
914   - out; // returns ["1"]
915   - }
  1276 +* **function description:**
916 1277  
917   ----
  1278 + void set(const QString &key, const QString &value)
918 1279  
919   -## Functions
  1280 +* **parameters:**
920 1281  
921   -### operator const [File](#file) &()
  1282 + Parameters | Type | Description
  1283 + --- | --- | ---
  1284 + key | const [QString][QString] & | Key to store the given value in the [metadata](#file-members-m_metadata)
  1285 + value | const [QString][QString] & | Value to be stored
922 1286  
923   -Idiom to treat the template like a [File](#file). Returns [file](#file-file).
  1287 +* **output:** (void)
  1288 +* **example:**
924 1289  
925   -### const [Mat][Mat] &m()
  1290 + File f;
  1291 + f.flat(); // returns ""
926 1292  
927   -Idiom to treat the template like a [Mat][Mat]. If the template is empty then an empty [Mat][Mat] is returned. If the list has multiple [Mats][Mat] the last is returned.
  1293 + f.set("Key1", QString("1"));
  1294 + f.flat(); // returns "[Key1=1]"
928 1295  
929   - Template t;
930   - t.m(); // returns empty mat
931 1296  
932   - Mat m1;
933   - t.append(m1);
934   - t.m(); // returns m1;
  1297 +### void setList(const [QString][QString] &key, const [QList][QList]&lt;T&gt; &value) {: #file-function-setlist }
935 1298  
936   - Mat m2;
937   - t.append(m2);
938   - t.m(); // returns m2;
  1299 +Insert a list into the [metadata](#file-members-m_metadata) using a provided key. If the key already exists the new value will override the old one. The value should be queried with [getList](#file-function-getlist-1) instead of [get](#file-function-get-1).
939 1300  
940   -### [Mat][Mat] &m()
  1301 +* **function description:**
941 1302  
942   -Idiom to treat the template like a [Mat][Mat]. If the template is empty then an empty [Mat][Mat] is returned. If the list has multiple [Mats][Mat] the last is returned.
  1303 + template <typename T> void setList(const QString &key, const QList<T> &value)
943 1304  
944   - Template t;
945   - t.m(); // returns empty mat
  1305 +* **parameters:**
946 1306  
947   - Mat m1;
948   - t.append(m1);
949   - t.m(); // returns m1;
  1307 + Parameter | Type | Description
  1308 + --- | --- | ---
  1309 + key | const [QString][QString] & | Key to store the given value in the [metadata](#file-members-m_metadata)
  1310 + value | const [QList][QList]&lt;T&gt; | List to be stored
950 1311  
951   - Mat m2;
952   - t.append(m2);
953   - t.m(); // returns m2;
  1312 +* **output:** (void)
  1313 +* **see:** [getList](#file-function-getlist-1), [get](#file-function-get-1)
  1314 +* **example:**
954 1315  
955   -### operator const [Mat][Mat] &()
  1316 + File file;
956 1317  
957   -Idiom to treat the template like a [Mat][Mat]. Makes a call to [m()](#mat-m).
  1318 + QList<float> list = QList<float>() << 1 << 2 << 3;
  1319 + file.setList<float>("List", list);
  1320 + file.getList<float>("List"); // return [1., 2. 3.]
958 1321  
959   -### operator [Mat][Mat] &()
960 1322  
961   -Idiom to treat the template like a [Mat][Mat]. Makes a call to [m()](#mat-m).
  1323 +### void remove(const [QString][QString] &key) {: #file-function-remove }
962 1324  
963   -### operator [_InputArray][InputArray] &()
  1325 +Remove a key-value pair from the [metadata](#file-members-m_metadata)
964 1326  
965   -Idiom to treat the template like a [Mat][Mat]. Makes a call to [m()](#mat-m).
  1327 +* **function description:**
966 1328  
967   -### operator [_OutputArray][OutputArray] &()
  1329 + inline void remove(const QString &key)
968 1330  
969   -Idiom to treat the template like a [Mat][Mat]. Makes a call to [m()](#mat-m).
  1331 +* **parameters:**
970 1332  
971   -### [Mat][Mat] &operator =(const [Mat][Mat] &other)
  1333 + Parameter | Type | Description
  1334 + --- | --- | ---
  1335 + key | const [QString][QString] & | Key to be removed from [metadata](#file-members-m_metadata) along with its associated value.
972 1336  
973   -Idiom to treat the template like a [Mat][Mat]. Sets other equal to [m()](#mat-m).
  1337 +* **output:** (void)
  1338 +* **example:**
974 1339  
975   -### bool isNull() const
  1340 + File f;
  1341 + f.set("Key1", QVariant::fromValue<float>(1));
  1342 + f.set("Key2", QVariant::fromValue<float>(2));
976 1343  
977   -Returns true if the template is empty or if [m()](#mat-m) has no data.
  1344 + f.flat(); // returns "[Key1=1, Key2=2]"
978 1345  
979   - Template t;
980   - t.isNull(); // returns true
  1346 + f.remove("Key1");
  1347 + f.flat(); // returns "[Key2=2]"
981 1348  
982   - t.append(Mat());
983   - t.isNull(); // returns true
984 1349  
985   - t.append(Mat::ones(1, 1, CV_8U));
986   - t.isNull(); // returns false
  1350 +### T get(const [QString][QString] &key) const {: #file-function-get-1 }
987 1351  
988   -### void merge(const [Template](#template) &other)
  1352 +Get a value from the [metadata](#file-members-m_metadata) using a provided key. If the key does not exist or the value cannot be converted to a user specified type an error is thrown.
989 1353  
990   -Append the contents of another template. The [files](#file-file) are appended using [append()](#void-append-const-file-other).
  1354 +* **function definition:**
991 1355  
992   - Template t1("picture1.jpg"), t2("picture2.jpg");
993   - Mat m1, m2;
  1356 + template <typename T> T get(const QString &key) const
994 1357  
995   - t1.append(m1);
996   - t2.append(m2);
  1358 +* **parameters:**
997 1359  
998   - t1.merge(t2);
  1360 + Parameter | Type | Description
  1361 + --- | --- | ---
  1362 + key | const [QString][QString] & | Key to retrieve a value from [metadata](#file-members-m_metadata)
999 1363  
1000   - t1.file; // returns picture1.jpg;picture2.jpg[seperator=;]
1001   - t1; // returns [m1, m2]
  1364 +* **output:** (<tt>T</tt>) Returns a value of type <tt>T</tt>. <tt>T</tt> is a user specified type. The value associated with the given key must be convertable to <tt>T</tt>.
  1365 +* **see:** [get](#file-function-get-2), [getList](#file-function-getlist-1)
  1366 +* **example:**
1002 1367  
1003   -### size_t bytes() const
  1368 + File f;
  1369 + f.set("Key1", QVariant::fromValue<float>(1));
1004 1370  
1005   -Returns the total number of bytes in all of the matrices in the template.
  1371 + f.get<float>("Key1"); // returns 1
  1372 + f.get<float>("Key2"); // Error: Key2 is not in the metadata
  1373 + f.get<QRectF>("Key1"); // Error: A float can't be converted to a QRectF
1006 1374  
1007   - Template t;
  1375 +### T get(const [QString][QString] &key, const T &defaultValue) {: #file-function-get-2 }
1008 1376  
1009   - Mat m1 = Mat::ones(1, 1, CV_8U); // 1 byte
1010   - Mat m2 = Mat::ones(2, 2, CV_8U); // 4 bytes
1011   - Mat m3 = Mat::ones(3, 3, CV_8U); // 9 bytes
  1377 +Get a value from the [metadata](#file-members-m_metadata) using a provided key. If the key does not exist or the value cannot be converted to user specified type a provided default value is returned instead.
1012 1378  
1013   - t << m1 << m2 << m3;
  1379 +* **function definition:**
1014 1380  
1015   - t.bytes(); // returns 14
  1381 + template <typename T> T get(const QString &key, const T &defaultValue)
1016 1382  
1017   -### Template clone() const
  1383 +* **parameters:**
1018 1384  
1019   -Returns a new template with copies of the [file](#file-file) and all of the matrices that were in the original.
  1385 + Parameter | Type | Description
  1386 + --- | --- | ---
  1387 + key | const [QString][QString] & | Key to retrieve a value from the [metadata](#file-members-m_metadata)
  1388 + defaultValue | const T & | Default value to be returned if the key does not exist or found value cannot be converted to <tt>T</tt>. <tt>T</tt> is a user specified type.
1020 1389  
1021   - Template t1("picture.jpg");
1022   - t1.append(Mat::ones(1, 1, CV_8U));
  1390 +* **output:** (<tt>T</tt>) Returns a value of type <tt>T</tt>. <tt>T</tt> is a user specified type. If the value associated with the key is invalid, the provided default value is returned instead.
  1391 +* **see:** [get](#file-function-get-1), [getList](#file-function-getlist-1)
  1392 +* **example:**
1023 1393  
1024   - Template t2 = t1.clone();
  1394 + File f;
  1395 + f.set("Key1", QVariant::fromValue<float>(1));
1025 1396  
1026   - t2.file; // returns "picture.jpg"
1027   - t2; // returns ["1"]
  1397 + f.get<float>("Key1", 5); // returns 1
  1398 + f.get<float>("Key2", 5); // returns 5
  1399 + f.get<QRectF>("Key1", QRectF(0, 0, 10, 10)); // returns QRectF(0, 0, 10x10)
1028 1400  
1029   ----
1030 1401  
1031   -# TemplateList
  1402 +### bool getBool(const [QString][QString] &key, bool defaultValue = false) const {: #file-function-getbool }
1032 1403  
1033   -Inherits [QList][QList]&lt;[Template][#template]&gt;.
  1404 +Get a boolean value from the [metadata](#file-members-m_metadata) using a provided key. If the key is not in the [metadata](#file-members-m_metadata) a provided default value is returned. If the key is in the metadata but the value cannot be converted to a bool true is returned. If the key is found and the value can be converted to a bool the value is returned.
1034 1405  
1035   -Convenience class for working with a list of templates.
  1406 +* **function definition:**
1036 1407  
1037   -## Members
  1408 + bool getBool(const QString &key, bool defaultValue = false) const
1038 1409  
1039   ----
  1410 +* **parameters:**
1040 1411  
1041   -## Constructors
  1412 + Parameter | Type | Description
  1413 + --- | --- | ---
  1414 + key | const [QString][QString] & | Key to retrieve a value from the [metadata](#file-members-m_metadata)
  1415 + defaultValue | bool | (Optional) Default value to be returned if the key is not in the [metadata](#file-members-m_metadata).
1042 1416  
1043   -### TemplateList()
  1417 +* **output:** (bool) If the key *is not* in the [metadata](#file-members-m_metadata) the provided default value is returned. If the key *is* in the [metadata](#file-members-m_metadata) but the associated value *cannot* be converted to a bool true is returned. If the key *is* in the [metadata](#file-members-m_metadata) and the associated value *can* be converted to a bool, that value is returned.
  1418 +* **see:** [get](#file-function-get-2)
  1419 +* **example:**
1044 1420  
1045   -Default constructor.
  1421 + File f;
  1422 + f.set("Key1", QVariant::fromValue<bool>(true));
  1423 + f.set("Key2", QVariant::fromValue<float>(10));
1046 1424  
1047   -### TemplateList(const [QList][QList]&lt;[Template](#template)&gt; &templates)
  1425 + f.getBool("Key1"); // returns true
  1426 + f.getBool("Key2") // returns true (key found)
  1427 + f.getBool("Key3"); // returns false (default value)
  1428 + f.getBool("Key3", true); // returns true (default value)
1048 1429  
1049   -Initialize the [TemplateList](#templatelist) with a list of templates. The given list is appended.
1050 1430  
1051   -### TemplateList(const [QList][QList]&lt;[File](#file)&gt; &files)
  1431 +### [QList][QList]&lt;T&gt; getList(const [QString][QString] &key) const {: #file-function-getlist-1 }
1052 1432  
1053   -Initialize the [TemplateList](#templatelist) with a list of files. The files are each treated like a template and appended.
  1433 +Get a list from the [metadata](#file-members-m_metadata) using a provided key. If the key does not exist or the elements of the list cannot be converted to a user specified type an error is thrown.
1054 1434  
1055   ----
  1435 +* **function definition:**
1056 1436  
1057   -## Static Functions
  1437 + template <typename T> QList<T> getList(const QString &key) const
1058 1438  
1059   -### static [TemplateList](#templatelist) fromGallery(const [File](#file) &gallery)
  1439 +* **parameters:**
1060 1440  
1061   -Create a [TemplateList](#templatelist) from a [Gallery](#gallery).
  1441 + Parameter | Type | Description
  1442 + --- | --- | ---
  1443 + key | const [QString][QString] & | Key to retrieve a value from the [metadata](#file-members-m_metadata)
1062 1444  
1063   -### static [TemplateList](#templatelist) fromBuffer(const [QByteArray][QByteArray] &buffer)
  1445 +* **output:** ([QList][QList]&lt;<tt>T</tt>&gt;) Returns a list of values of a user specified type.
  1446 +* **see:** [setList](#file-function-setlist), [get](#file-function-get-1)
  1447 +* **example:**
1064 1448  
1065   -Create a template from a memory buffer of individual templates. This is compatible with **.gal** galleries.
  1449 + File file;
1066 1450  
1067   -### static [TemplateList](#templatelist) relabel(const [TemplateList](#templatelist) &tl, const [QString][QString] &propName, bool preserveIntegers)
  1451 + QList<float> list = QList<float>() << 1 << 2 << 3;
  1452 + file.setList<float>("List", list);
1068 1453  
1069   -Relabels the metadata value associated with propName in each [Template](#template) to be between [0, numClasses-1]. **numClasses** is equal to the maximum value of the given metadata if the value can be converted to an **int** and **preserveIntegers** is true, or the total number of unique values. The relabeled values are stored in the "Label" field of each template.
  1454 + file.getList<float>("List"); // return [1., 2. 3.]
  1455 + file.getList<QRectF>("List"); // Error: float cannot be converted to QRectF
  1456 + file.getList<float>("Key"); // Error: key doesn't exist
1070 1457  
1071   - Template t1, t2, t3;
1072 1458  
1073   - t1.file.set("Class", QString("1"));
1074   - t2.file.set("Class", QString("10"));
1075   - t3.file.set("Class", QString("100"));
1076   - TemplateList tList(QList<Template>() << t1 << t2 << t3);
  1459 +### [QList][QList]&lt;T&gt; getList(const [QString][QString] &key, const [QList][QList]&lt;T&gt; defaultValue) const {: #file-function-getlist-2 }
1077 1460  
1078   - TemplateList relabeled = TemplateList::relabel(tList, "Class", true);
1079   - relabeled.files(); // returns [[Class=1, Label=1], [Class=10, Label=10], [Class=100, Label=100]]
  1461 +Get a list from the [metadata](#file-members-m_metadata) using a provided key. If the key does not exist or the elements of the list cannot be converted to a user specified type a provided default value is returned.
1080 1462  
1081   - relabeled = TemplateList::relabel(tList, "Class", false);
1082   - relabeled.files(); // returns [[Class=1, Label=0], [Class=10, Label=1], [Class=100, Label=2]]
  1463 +* **function definition:**
1083 1464  
1084   ----
  1465 +template <typename T> QList<T> getList(const QString &key, const QList<T> defaultValue) const
1085 1466  
1086   -## Functions
  1467 +* **parameters:**
1087 1468  
1088   -### [QList][QList]&lt;int&gt; indexProperty(const [QString][QString] &propName, [QHash][QHash]&lt;[QString][QString], int&gt; &valueMap, [QHash][QHash]&lt;int, [QVariant][QVariant]&gt; &reverseLookup) const
  1469 + Parameter | Type | Description
  1470 + --- | --- | ---
  1471 + key | const [QString][QString] & | Key to retrieve a value from the [metadata](#file-members-m_metadata)
  1472 + defaultValue | [QList][QList]&lt;<tt>T</tt> | (Optional) Default value to be returned if the key is not in the [metadata](#file-members-m_metadata).
1089 1473  
1090   -Convert metadata values associated with **propName** to integers. Each unique value gets its own integer. Returns a list of the integer replacement for each template. This is useful in many classification problems where nominal data (e.g "Male", "Female") needs to represented with integers ("Male" = 0, "Female" = 1). **valueMap** and **reverseLookup** are created to allow easy conversion to the integer replacements and back.
  1474 +* **output:** ([QList][QList]&lt;<tt>T</tt>&gt;) Returns a list of values of user specified type. If key is not in the [metadata](#file-members-m_metadata) or if the value cannot be converted to a [QList][QList]&lt;<tt>T</tt>&gt; the default value is returned.
  1475 +* **see:** [getList](#file-function-getlist-1)
  1476 +* **example:**
1091 1477  
1092   - Template t1, t2, t3, t4;
  1478 + File file;
1093 1479  
1094   - t1.file.set("Key", QString("Class 1"));
1095   - t2.file.set("Key", QString("Class 2"));
1096   - t3.file.set("Key", QString("Class 3"));
1097   - t4.file.set("Key", QString("Class 1"));
  1480 + QList<float> list = QList<float>() << 1 << 2 << 3;
  1481 + file.setList<float>("List", list);
1098 1482  
1099   - TemplateList tList(QList<Template>() << t1 << t2 << t3 << t4);
  1483 + file.getList<float>("List", QList<float>()); // return [1., 2. 3.]
  1484 + file.getList<QRectF>("List", QList<QRectF>()); // return []
  1485 + file.getList<float>("Key", QList<float>() << 1 << 2 << 3); // return [1., 2., 3.]
1100 1486  
1101   - QHash<QString, int> valueMap;
1102   - QHash<int, QVariant> reverseLookup;
1103   - tList.indexProperty("Key", valueMap, reverseLookup); // returns [0, 1, 2, 0]
1104   - valueMap; // returns QHash(("Class 1", 0)("Class 2", 1)("Class 3", 2))
1105   - reverseLookup; // QHash((0, QVariant(QString, "Class 1")) (2, QVariant(QString, "Class 3")) (1, QVariant(QString, "Class 2")))
1106 1487  
  1488 +### [QList][QList]&lt;[QPointF][QPointF]&gt; namedPoints() const {: #file-function-namedpoints }
1107 1489  
1108   -### [QList][QList]&lt;int&gt; indexProperty(const [QString][QString] &propName, [QHash][QHash]&lt;[QString][QString], int&gt; \*valueMap=NULL, [QHash][QHash]&lt;int, [QVariant][QVariant]&gt; \*reverseLookup=NULL) const
  1490 +Find values in the [metadata](#file-members-m_metadata) that can be converted into [QPointF][QPointF]'s. Values stored as [QList][QList]&lt;[QPointF][QPointF]&gt; *will not** be returned.
1109 1491  
1110   -Shortcut to call [indexProperty](#qlistint-indexpropertyconst-qstring-propname-qhashqstring-int-valuemap-qhashint-qvariant-reverselookup-const) without **valueMap** or **reverseLookup** arguments.
  1492 +* **function definition:**
1111 1493  
1112   -### [QList][QList]&lt;int&gt; applyIndex(const [QString][QString] &propName, const [QHash][QHash]&lt;[QString][QString], int&gt; &valueMap) const
  1494 + QList<QPointF> namedPoints() const
1113 1495  
1114   -Apply a mapping to convert non-integer values to integers. Metadata values associated with **propName** are mapped through the given **valueMap**. If the value is found its integer mapping is appened to the list to be returned. If not, -1 is appened to the list.
  1496 +* **parameters:** NONE
  1497 +* **output:** ([QList][QList]&lt;[QPointF][QPointF]&gt;) Returns a list of points that can be converted from [metadata](#file-members-m_metadata) values.
  1498 +* **example:**
1115 1499  
1116   - Template t1, t2, t3, t4;
  1500 + File file;
  1501 + file.set("Key1", QVariant::fromValue<QPointF>(QPointF(1, 1)));
  1502 + file.set("Key2", QVariant::fromValue<QPointF>(QPointF(2, 2)));
  1503 + file.set("Points", QVariant::fromValue<QPointF>(QPointF(3, 3)))
1117 1504  
1118   - t1.file.set("Key", QString("Class 1"));
1119   - t2.file.set("Key", QString("Class 2"));
1120   - t3.file.set("Key", QString("Class 3"));
1121   - t4.file.set("Key", QString("Class 1"));
  1505 + f.namedPoints(); // returns [QPointF(1, 1), QPointF(2, 2), QPointF(3, 3)]
1122 1506  
1123   - TemplateList tList(QList<Template>() << t1 << t2 << t3 << t4);
  1507 + file.setPoints(QList<QPointF>() << QPointF(3, 3)); // changes metadata["Points"] to QList<QPointF>
  1508 + f.namedPoints(); // returns [QPointF(1, 1), QPointF(2, 2)]
1124 1509  
1125   - QHash<QString, int> valueMap;
1126   - valueMap.insert("Class 1", 0);
1127   - valueMap.insert("Class 2", 1);
1128 1510  
1129   - tList.applyIndex("Key", valueMap); // returns [0, 1, -1, 0]
  1511 +### [QList][QList]&lt;[QPointF][QPointF]&gt; points() const {: #file-function-points }
1130 1512  
1131   -### T bytes() const
  1513 +Get values stored in the [metadata](#file-members-m_metadata) with key "Points". It is expected that this field holds a [QList][QList]&lt;[QPointf][QPointF]>&gt;.
1132 1514  
1133   -This function requires a type specification in place of T. Returns the total number of bytes in the [TemplateList](#templatelist). Calls [bytes()](#size_t-bytes-const) on each [Template](#template) in the list.
  1515 +* **function definition:**
1134 1516  
1135   - Template t1, t2;
  1517 + QList<QPointF> points() const
1136 1518  
1137   - t1.append(Mat::ones(1, 1, CV_8U)); // 1 byte
1138   - t1.append(Mat::ones(2, 2, CV_8U)); // 4 bytes
1139   - t2.append(Mat::ones(3, 3, CV_8U)); // 9 bytes
1140   - t2.append(Mat::ones(4, 4, CV_8U)); // 16 bytes
  1519 +* **parameters:** NONE
  1520 +* **output:** ([QList][QList]&lt;[QPointf][QPointF]>&gt;) Returns a list of points stored at [metadata](#file-members-m_metadata)["Points"]
  1521 +* **see:** [appendPoint](#file-function-appendpoint), [appendPoints](#file-function-appendpoints), [clearPoints](#file-function-clearpoints), [setPoints](#file-function-setpoints)
  1522 +* **example:**
1141 1523  
1142   - TemplateList tList(QList<Template>() << t1 << t2);
1143   - tList.bytes(); // returns 30
  1524 + File file;
  1525 + file.set("Points", QVariant::fromValue<QPointF>(QPointF(1, 1)));
  1526 + file.points(); // returns [] (point is not in a list)
1144 1527  
1145   -### [QList][QList]&lt;[Mat][Mat]&gt; data(int index = 0) const
  1528 + file.setPoints(QList<QPointF>() << QPointF(2, 2));
  1529 + file.points(); // returns [QPointF(2, 2)]
1146 1530  
1147   -Returns a list of matrices. The list is compiled with one [Mat][Mat] from each [Template][#template] taken at the given index.
1148 1531  
1149   - Template t1, t2;
  1532 +### void appendPoint(const [QPointF][QPointF] &point) {: #file-function-appendpoint }
1150 1533  
1151   - t1.append(Mat::ones(1, 1, CV_8U));
1152   - t1.append(Mat::zeros(1, 1, CV_8U));
1153   - t2.append(Mat::ones(1, 1, CV_8U));
1154   - t2.append(Mat::zeros(1, 1, CV_8U));
  1534 +Append a point to the [QList][QList]&lt;[QPointF][QPointF]&gt; stored at [metadata](#file-members-m_metadata)["Points"].
1155 1535  
1156   - TemplateList tList(QList<Template>() << t1 << t2);
1157   - tList.data(); // returns ["1", "1"];
1158   - tList.data(1); // returns ["0", "0"];
  1536 +* **function definition:**
1159 1537  
1160   -### [QList][QList]&lt;[TemplateList](#templatelist)&gt; partition(const [QList][QList]&lt;int&gt; &partitionSizes) const
  1538 + void appendPoint(const QPointF &point)
1161 1539  
1162   -Returns a [QList][QList] of [TemplateLists](#templatelist). The number of [TemplateLists](#templatelist) returned is equal to the length of partitionSizes. The number of [Templates](#template) in each returned [TemplateList](#templatelist) is equal to the number of templates in the orginal [TemplateList](#templatelist). Each [Template](#template) in the original [TemplateList](#templatelist) must have length equal to the sum of the given partition sizes. Each [Template](#template) is divided into partitions and stored in the corresponding [TemplateList](#templatelist).
  1540 +* **parameters:**
1163 1541  
1164   - Template t1, t2, t3;
  1542 + Parameter | Type | Description
  1543 + --- | --- | ---
  1544 + point | const [QPoint][QPoint] & | Point to be appended
1165 1545  
1166   - t1.append(Mat::ones(1, 1, CV_8U));
1167   - t1.append(2*Mat::ones(1, 1, CV_8U));
1168   - t1.append(3*Mat::ones(1, 1, CV_8U));
  1546 +* **output:** (void)
  1547 +* **example:**
1169 1548  
1170   - t2.append(4*Mat::ones(1, 1, CV_8U));
1171   - t2.append(5*Mat::ones(1, 1, CV_8U));
1172   - t2.append(6*Mat::ones(1, 1, CV_8U));
  1549 + File file;
  1550 + file.points(); // returns []
1173 1551  
1174   - t3.append(7*Mat::ones(1, 1, CV_8U));
1175   - t3.append(8*Mat::ones(1, 1, CV_8U));
1176   - t3.append(9*Mat::ones(1, 1, CV_8U));
  1552 + file.appendPoint(QPointF(1, 1));
  1553 + file.points(); // returns [QPointF(1, 1)]
1177 1554  
1178   - TemplateList tList(QList<Template>() << t1 << t2 << t3);
1179 1555  
1180   - QList<TemplateList> partitions = tList.partition(QList<int>() << 1 << 2); // split into 2 partitions. 1 with 1 Mat and 1 with 2 Mats.
  1556 +### void appendPoints(const [QList][QList]&lt;[QPointF][QPointF]&gt; &points) {: #file-function-appendpoints }
1181 1557  
1182   - partitions[0]; // returns [("1"), ("4"), ("7")]
1183   - partitions[1]; // returns [("2", "3"), ("5", "6"), ("8", "9")]
  1558 +Append a list of points to the [QList][QList]&lt;[QPointF][QPointF]&gt; stored at [metadata](#file-members-m_metadata)["Points"].
1184 1559  
1185   -### [FileList](#filelist) files() const
  1560 +* **function definition:**
1186 1561  
1187   -Returns a [FileList](#filelist) with the [file](#file-file) of each [Template](#template) in the [TemplateList](#templatelist).
  1562 + void appendPoints(const QList<QPointF> &points)
1188 1563  
1189   - Template t1("picture1.jpg"), t2("picture2.jpg");
  1564 +* **parameters:**
1190 1565  
1191   - t1.file.set("Key", QVariant::fromValue<float>(1));
1192   - t2.file.set("Key", QVariant::fromValue<float>(2));
  1566 + Parameter | Type | Description
  1567 + --- | --- | ---
  1568 + points | const [QList][QList]&lt;[QPointF][QPointF]&gt; & | List of points to be appended
1193 1569  
1194   - TemplateList tList(QList<Template>() << t1 << t2);
  1570 +* **output:** (void)
  1571 +* **example:**
1195 1572  
1196   - tList.files(); // returns ["picture1.jpg[Key=1]", "picture2.jpg[Key=2]"]
  1573 + File file;
  1574 + file.points(); // returns []
1197 1575  
1198   -### [FileList](#filelist) operator()()
  1576 + file.appendPoints(QList<QPointF>() << QPointF(1, 1) << QPointF(2, 2));
  1577 + file.points(); // returns [QPointF(1, 1), QPointF(2, 2)]
1199 1578  
1200   -Returns [files()](#filelist-files-const).
1201 1579  
1202   -### [QMap][QMap]&lt;T, int&gt; countValues(const [QString][QString] &propName, bool excludeFailures = false) const
  1580 +### void clearPoints() {: #file-function-clearpoints }
1203 1581  
1204   -This function requires a type specification in place of T. Returns the number of occurences for each label in the list. If excludedFailures is true [Files](#file) with [fte](#bool-fte) = true are excluded from the count.
  1582 +Remove all points stored at [metadata](#file-members-m_metadata)["Points"].
1205 1583  
1206   - Template t1, t2, t3, t4;
  1584 +* **function definition:**
1207 1585  
1208   - t1.file.set("Key", QString("Class 1"));
1209   - t2.file.set("Key", QString("Class 2"));
1210   - t3.file.set("Key", QString("Class 3"));
1211   - t4.file.set("Key", QString("Class 1"));
  1586 + inline void clearPoints()
1212 1587  
1213   - TemplateList tList(QList<Template>() << t1 << t2 << t3 << t4);
  1588 +* **parameters:** NONE
  1589 +* **output:** (void)
  1590 +* **example:**
1214 1591  
1215   - tList.countValues<QString>("Key"); // returns QMap(("Class 1", 2), ("Class 2", 1), ("Class 3", 1))
  1592 + File file;
  1593 + file.appendPoints(QList<QPointF>() << QPointF(1, 1) << QPointF(2, 2));
  1594 + file.points(); // returns [QPointF(1, 1), QPointF(2, 2)]
1216 1595  
1217   -### [TemplateList](#templatelist) reduced() const
  1596 + file.clearPoints();
  1597 + file.points(); // returns []
1218 1598  
1219   -Merge all of them templates together and store the resulting template in the list. The merges are done by calling [merge()](#void-merge-const-template-other).
1220 1599  
1221   - Template t1("picture1.jpg"), t2("picture2.jpg");
  1600 +### void setPoints(const [QList][QList]&lt;[QPointF][QPointF]&gt; &points) {: #file-function-setpoints }
1222 1601  
1223   - t1.file.set("Key1", QString("Value1"));
1224   - t2.file.set("Key2", QString("Value2"));
  1602 +Replace the points stored at [metadata](#file-members-m_metadata)["Points"]
1225 1603  
1226   - TemplateList tList(QList<Template>() << t1 << t2);
  1604 +* **function definition:**
1227 1605  
1228   - TemplateList reduced = tList.reduced();
1229   - reduced.size(); // returns 1
1230   - reduced.files(); // returns ["picture1.jpg;picture2.jpg[Key1=Value1, Key2=Value2, separator=;]"]
  1606 + inline void setPoints(const QList<QPointF> &points)
1231 1607  
1232   -### [QList][QList]&lt;int&gt; find(const [QString][QString] &key, const T &value)
  1608 +* **parameters:**
1233 1609  
1234   -This function requires a type specification in place of T. Returns the indices of templates that have the given key-value pairing.
  1610 + Parameter | Type | Description
  1611 + --- | --- | ---
  1612 + points | const [QList][QList]&lt;[QPointF][QPointF]&gt; & | Points to overwrite [metadata](#file-members-m_metadata) with
1235 1613  
1236   - Template t1, t2, t3;
  1614 +* **output:** (void)
  1615 +* **example:**
1237 1616  
1238   - t1.file.set("Key", QString("Value1"));
1239   - t2.file.set("Key", QString("Value2"));
1240   - t3.file.set("Key", QString("Value2"));
  1617 + File file;
  1618 + file.appendPoints(QList<QPointF>() << QPointF(1, 1) << QPointF(2, 2));
  1619 + file.points(); // returns [QPointF(1, 1), QPointF(2, 2)]
1241 1620  
1242   - TemplateList tList(QList<Template>() << t1 << t2 << t3);
1243   - tList.find<QString>("Key", "Value2"); // returns [1, 2]
  1621 + file.setPoints(QList<QPointF>() << QPointF(3, 3) << QPointF(4, 4));
  1622 + file.points(); // returns [QPointF(3, 3), QPointF(4, 4)]
1244 1623  
1245   ----
1246 1624  
1247   -# Context
  1625 +### [QList][QList]&lt;[QRectF][QRectF]&gt; namedRects() const {: #file-function-namedrects }
1248 1626  
1249   ----
  1627 +Find values in the [metadata](#file-members-m_metadata) that can be converted into [QRectF][QRectF]'s. Values stored as [QList][QList]&lt;[QRectF][QRectF]&gt; *will not** be returned.
1250 1628  
1251   -# Object
  1629 +* **function definition:**
1252 1630  
1253   ----
  1631 + QList<QRectF> namedRects() const
1254 1632  
1255   -# Factory
  1633 +* **parameters:** NONE
  1634 +* **output:** ([QList][QList]&lt;[QRectF][QRectF]&gt;) Returns a list of rects that can be converted from [metadata](#file-members-m_metadata) values.
  1635 +* **example:**
1256 1636  
1257   ----
  1637 + File file;
  1638 + file.set("Key1", QVariant::fromValue<QRectF>(QRectF(1, 1, 5, 5)));
  1639 + file.set("Key2", QVariant::fromValue<QRectF>(QRectF(2, 2, 5, 5)));
  1640 + file.set("Rects", QVariant::fromValue<QRectF>(QRectF(3, 3, 5, 5)));
1258 1641  
1259   -# Transform
  1642 + f.namedRects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5), QRectF(3, 3, 5x5)]
1260 1643  
1261   ----
  1644 + file.setRects(QList<QRectF>() << QRectF(3, 3, 5x5)); // changes metadata["Rects"] to QList<QRectF>
  1645 + f.namedRects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
1262 1646  
1263   -# UntrainableTransform
1264 1647  
1265   ----
  1648 +### [QList][QList]&lt;[QRectF][QRectF]&gt; rects() const {: #file-function-rects }
1266 1649  
1267   -# MetaTransform
  1650 +Get values stored at [metadata](#file-members-m_metadata)["Rects"]. It is expected that this field holds a [QList][QList]&lt;[QRectf][QRectF]>&gt;.
1268 1651  
1269   ----
  1652 +* **function definition:**
1270 1653  
1271   -# UntrainableMetaTransform
  1654 + QList<QRectF> points() const
1272 1655  
1273   ----
  1656 +* **parameters:** NONE
  1657 +* **output:** ([QList][QList]&lt;[QRectf][QRectF]>&gt;) Returns a list of rects stored at [metadata](#file-members-m_metadata)["Rects"]
  1658 +* **see:** [appendRect](#file-function-appendrect-1), [appendRects](#file-function-appendrects-1), [clearRects](#file-function-clearrects), [setRects](#file-function-setrects-1)
  1659 +* **example:**
1274 1660  
1275   -# MetadataTransform
  1661 + File file;
  1662 + file.set("Rects", QVariant::fromValue<QRectF>(QRectF(1, 1, 5, 5)));
  1663 + file.rects(); // returns [] (rect is not in a list)
1276 1664  
1277   ----
  1665 + file.setRects(QList<QRectF>() << QRectF(2, 2, 5, 5));
  1666 + file.rects(); // returns [QRectF(2, 2, 5x5)]
1278 1667  
1279   -# UntrainableMetadataTransform
1280 1668  
1281   ----
  1669 +### void appendRect(const [QRectF][QRectF] &rect) {: #file-function-appendrect-1 }
1282 1670  
1283   -# TimeVaryingTransform
  1671 +Append a rect to the [QList][QList]&lt;[QRectF][QRectF]&gt; stored at [metadata](#file-members-m_metadata)["Rects"].
1284 1672  
1285   ----
  1673 +* **function definition:**
1286 1674  
1287   -# Distance
  1675 + void appendRect(const QRectF &rect)
1288 1676  
1289   ----
  1677 +* **parameters:**
1290 1678  
1291   -# UntrainableDistance
  1679 + Parameter | Type | Description
  1680 + --- | --- | ---
  1681 + rect | const [QRect][QRect] & | Rect to be appended
1292 1682  
1293   ----
  1683 +* **output:** (void)
  1684 +* **example:**
1294 1685  
1295   -# Output
  1686 + File file;
  1687 + file.rects(); // returns []
1296 1688  
1297   ----
  1689 + file.appendRect(QRectF(1, 1, 5, 5));
  1690 + file.rects(); // returns [QRectF(1, 1, 5x5)]
1298 1691  
1299   -# MatrixOutput
1300 1692  
1301   ----
  1693 +### void appendRect(const [Rect][Rect] &rect) {: #file-function-appendrect-2 }
1302 1694  
1303   -# Format
  1695 +Append an OpenCV-style [Rect][Rect] to the [QList][QList]&lt;[QRectF][QRectF]&gt; stored at [metadata](#file-members-m_metadata)["Rects"]. Supplied OpenCV-style rects are converted to [QRectF][QRectF] before being appended.
1304 1696  
1305   ----
  1697 +* **function definition:**
1306 1698  
1307   -# Representation
  1699 + void appendRect(const Rect &rect)
1308 1700  
1309   ----
  1701 +* **parameters:**
1310 1702  
1311   -# Classifier
  1703 + Parameter | Type | Description
  1704 + --- | --- | ---
  1705 + rect | const [Rect][Rect] & | OpenCV-style rect to be appended
1312 1706  
  1707 +* **output:** (void)
  1708 +* **example:**
1313 1709  
  1710 + File file;
  1711 + file.rects(); // returns []
1314 1712  
1315   -[QString]: http://doc.qt.io/qt-5/QString.html "QString"
1316   -[QStringList]: http://doc.qt.io/qt-5/qstringlist.html "QStringList"
  1713 + file.appendRect(cv::Rect(1, 1, 5, 5)); // automatically converted to QRectF
  1714 + file.rects(); // returns [QRectF(1, 1, 5x5)]
1317 1715  
1318   -[QList]: http://doc.qt.io/qt-5/QList.html "QList"
1319   -[QMap]: http://doc.qt.io/qt-5/qmap.html "QMap"
1320   -[QHash]: http://doc.qt.io/qt-5/qhash.html "QHash"
1321 1716  
1322   -[QRectF]: http://doc.qt.io/qt-5/qrectf.html "QRectF"
1323   -[QPointF]: http://doc.qt.io/qt-5/qpointf.html "QPointF"
  1717 +### void appendRects(const [QList][QList]&lt;[QRectF][QRectF]&gt; &rects) {: #file-function-appendrects-1 }
1324 1718  
1325   -[QVariant]: http://doc.qt.io/qt-5/qvariant.html "QVariant"
1326   -[QVariantList]: http://doc.qt.io/qt-5/qvariant.html#QVariantList-typedef "QVariantList"
1327   -[QVariantMap]: http://doc.qt.io/qt-5/qvariant.html#QVariantMap-typedef "QVariantMap"
  1719 +Append a list of rects to the [QList][QList]&lt;[QRectF][QRectF]&gt; stored at [metadata](#file-members-m_metadata)["Rects"].
  1720 +
  1721 +* **function definition:**
  1722 +
  1723 + void appendRects(const QList<QRectF> &rects)
  1724 +
  1725 +* **parameters:**
  1726 +
  1727 + Parameter | Type | Description
  1728 + --- | --- | ---
  1729 + rects | const [QList][QList]&lt;[QRectF][QRectF]&gt; & | List of rects to be appended
  1730 +
  1731 +* **output:** (void)
  1732 +* **example:**
  1733 +
  1734 + File file;
  1735 + file.rects(); // returns []
  1736 +
  1737 + file.appendRects(QList<QRectF>() << QRectF(1, 1, 5, 5) << QRectF(2, 2, 5, 5));
  1738 + file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1739 +
  1740 +
  1741 +### void appendRects(const [QList][QList]&lt;[QRectF][QRectF]&gt; &rects) {: #file-function-appendrects-2 }
  1742 +
  1743 +Append a list of OpenCV-style [Rects][Rect] to the [QList][QList]&lt;[QRectF][QRectF]&gt; stored at [metadata](#file-members-m_metadata)["Rects"]. Supplied OpenCV-style rects are converted to [QRectF][QRectF] before being appended.
  1744 +
  1745 +* **function definition:**
  1746 +
  1747 + void appendRects(const QList<QRectF> &rects)
  1748 +
  1749 +* **parameters:**
  1750 +
  1751 + Parameter | Type | Description
  1752 + --- | --- | ---
  1753 + rects | const [QList][QList]&lt;[Rect][Rect]&gt; & | List of OpenCV-style rects to be appended
  1754 +
  1755 +* **output:** (void)
  1756 +* **example:**
  1757 +
  1758 + File file;
  1759 + file.rects(); // returns []
  1760 +
  1761 + file.appendRects(QList<Rect>() << Rect(1, 1, 5, 5) << Rect(2, 2, 5, 5));
  1762 + file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1763 +
  1764 +### void clearRects() {: #file-function-clearrects }
  1765 +
  1766 +Remove all points stored at [metadata](#file-members-m_metadata)["Rects"].
  1767 +
  1768 +* **function definition:**
  1769 +
  1770 + inline void clearRects()
  1771 +
  1772 +* **parameters:** NONE
  1773 +* **output:** (void)
  1774 +* **example:**
  1775 +
  1776 + File file;
  1777 + file.appendRects(QList<QRectF>() << QRectF(1, 1, 5, 5) << QRectF(2, 2, 5, 5));
  1778 + file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1779 +
  1780 + file.clearRects();
  1781 + file.rects(); // returns []
  1782 +
  1783 +
  1784 +### void setRects(const [QList][QList]&lt;[QRectF][QRectF]&gt; &rects) {: #file-function-setrects-1 }
  1785 +
  1786 +Replace the rects stored at [metadata](#file-members-m_metadata) with a provided list of rects.
  1787 +
  1788 +* **function definition:**
  1789 +
  1790 + inline void setRects(const QList<QRectF> &rects)
  1791 +
  1792 +* **parameters:**
  1793 +
  1794 + Parameter | Type | Description
  1795 + --- | --- | ---
  1796 + rects | const [QList][QList]&lt;[QRectF][QRectF]&gt; & | Rects to overwrite [metadata](#file-members-m_metadata)["Rects"] with
  1797 +
  1798 +* **output:** (void)
  1799 +* **example:**
  1800 +
  1801 + File file;
  1802 + file.appendRects(QList<QRectF>() << QRectF(1, 1, 5, 5) << QRectF(2, 2, 5, 5));
  1803 + file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1804 +
  1805 + file.setRects(QList<QRectF>() << QRectF(3, 3, 5, 5) << QRectF(4, 4, 5, 5));
  1806 + file.rects(); // returns [QRectF(3, 3, 5x5), QRectF(4, 4, 5x5)]
  1807 +
  1808 +
  1809 +### void setRects(const [QList][QList]&lt;[Rect][Rect]&gt; &rects) {: #file-function-setrects-2 }
  1810 +
  1811 +Replace the rects stored at [metadata](#file-members-m_metadata) with a provided list of OpenCV-style [Rects][Rect].
  1812 +
  1813 +* **function definition:**
  1814 +
  1815 + inline void setRects(const QList<Rect> &rects)
  1816 +
  1817 +* **parameters:**
  1818 +
  1819 + Parameter | Type | Description
  1820 + --- | --- | ---
  1821 + rects | const [QList][QList]&lt;[Rect][Rect]&gt; & | OpenCV-style rects to overwrite [metadata](#file-members-m_metadata)["Rects"] with
  1822 +
  1823 +* **output:** (void)
  1824 +* **example:**
  1825 +
  1826 + File file;
  1827 + file.appendRects(QList<cv::Rect>() << cv::Rect(1, 1, 5, 5) << cv::Rect(2, 2, 5, 5));
  1828 + file.rects(); // returns [QRectF(1, 1, 5x5), QRectF(2, 2, 5x5)]
  1829 +
  1830 + file.setRects(QList<cv::Rect>() << cv::Rect(3, 3, 5, 5) << cv::Rect(4, 4, 5, 5));
  1831 + file.rects(); // returns [QRectF(3, 3, 5x5), QRectF(4, 4, 5x5)]
  1832 +
  1833 +---
  1834 +
  1835 +# FileList
  1836 +
  1837 +Inherits [QList][QList]&lt;[File](#file)&gt;.
  1838 +
  1839 +A convenience class for dealing with lists of files.
  1840 +
  1841 +## Members {: #filelist-members }
  1842 +
  1843 +NONE
  1844 +
  1845 +---
  1846 +
  1847 +## Constructors {: #filelist-constructors }
  1848 +
  1849 +Constructor | Description
  1850 +--- | ---
  1851 +FileList() | Default constructor. Doesn't do anything.
  1852 +FileList(int n) | Intialize the [FileList](#filelist) with n empty [Files](#file)
  1853 +FileList(const [QStringList][QStringList] &files) | Initialize the [FileList](#filelist) with a list of strings. Each string should have the format "filename[key1=value1, key2=value2, ... keyN=valueN]"
  1854 +FileList(const [QList][QList]&lt;[File](#file)&gt; &files) | Initialize the [FileList](#filelist) from a list of [files](#file).
  1855 +
  1856 +---
  1857 +
  1858 +## Static Functions {: #filelist-static-functions }
  1859 +
  1860 +
  1861 +### [FileList](#filelist) fromGallery(const [File](#file) &gallery, bool cache = false) {: #filelist-static-fromgallery }
  1862 +
  1863 +Create a [FileList](#filelist) from a [Gallery](#gallery). Galleries store one or more [Templates](#template) on disk. Common formats include **csv**, **xml**, and **gal**, which is a unique OpenBR format. Read more about this in the [Gallery](#gallery) section. This function creates a [FileList](#filelist) by parsing the stored gallery based on its format. Cache determines whether the gallery should be stored for faster reading later.
  1864 +
  1865 +* **function definition:**
  1866 +
  1867 + static FileList fromGallery(const File &gallery, bool cache = false)
  1868 +
  1869 +* **parameters:**
  1870 +
  1871 + Parameter | Type | Description
  1872 + --- | --- | ---
  1873 + gallery | const [File](#file) & | Gallery file to be enrolled
  1874 + cache | bool | (Optional) Retain the gallery in memory. Default is false.
  1875 +
  1876 +* **output:** ([FileList](#filelist)) Returns the filelist that the gallery was enrolled into
  1877 +* **example:**
  1878 +
  1879 + File gallery("gallery.csv");
  1880 +
  1881 + FileList fList = FileList::fromGallery(gallery);
  1882 + fList.flat(); // returns all the files that have been loaded from disk. It could
  1883 + // be 1 or 100 depending on what was stored.
  1884 +
  1885 +---
  1886 +
  1887 +## Functions {: #filelist-functions }
  1888 +
  1889 +
  1890 +### [QStringList][QStringList] flat() const {: #filelist-function-flat }
  1891 +
  1892 +Calls [flat](#file-function-flat) on every [File](#file) in the list and returns the resulting strings as a [QStringList][QStringList].
  1893 +
  1894 +* **function definition:**
  1895 +
  1896 + QStringList flat() const
  1897 +
  1898 +* **parameters:** NONE
  1899 +* **output:** ([QStringList][QStringList]) Returns a list of the output of calling [flat](#file-function-flat) on each [File](#file)
  1900 +* **example:**
  1901 +
  1902 + File f1("picture1.jpg"), f2("picture2.jpg");
  1903 + f1.set("Key", QString("Value"));
  1904 +
  1905 + FileList fList(QList<File>() << f1 << f2);
  1906 + fList.flat(); // returns ["picture1.jpg[Key=Value]", "picture2.jpg"]
  1907 +
  1908 +
  1909 +### [QStringList][QStringList] names() const {: #filelist-function-names }
  1910 +
  1911 +Get the [names](#file-members-name) of every [File](#file) in the list.
  1912 +
  1913 +* **function definition:**
  1914 +
  1915 + QStringList names() const
  1916 +
  1917 +* **parameters:** NONE
  1918 +* **output:** ([QStringList][QStringList]) Returns the [name](#file-members-name) of every [File](#file) in the list
  1919 +* **example:**
  1920 +
  1921 + File f1("picture1.jpg"), f2("picture2.jpg");
  1922 + f1.set("Key", QString("Value"));
  1923 +
  1924 + FileList fList(QList<File>() << f1 << f2);
  1925 + fList.names(); // returns ["picture1.jpg", "picture2.jpg"]
  1926 +
  1927 +
  1928 +### void sort(const [QString][QString] &key) {: #filelist-function-sort }
  1929 +
  1930 +Sort the [FileList](#filelist) based on the values associated with a provided key in each [File](#file).
  1931 +
  1932 +* **function definition:**
  1933 +
  1934 + void sort(const QString &key)
  1935 +
  1936 +* **parameters:**
  1937 +
  1938 + Parameter | Type | Description
  1939 + --- | --- | ---
  1940 + key | const [QString][QString] & | Key to look up desired values in each [Files](#file) [metadata](#file-members-m_metadata)
  1941 +
  1942 +* **output:** (void)
  1943 +* **example:**
  1944 +
  1945 + File f1("1"), f2("2"), f3("3");
  1946 + f1.set("Key", QVariant::fromValue<float>(3));
  1947 + f2.set("Key", QVariant::fromValue<float>(1));
  1948 + f3.set("Key", QVariant::fromValue<float>(2));
  1949 +
  1950 + FileList fList(QList<File>() << f1 << f2 << f3);
  1951 + fList.names(); // returns ["1", "2", "3"]
  1952 +
  1953 + fList.sort("Key");
  1954 + fList.names(); // returns ["2", "3", "1"]
  1955 +
  1956 +
  1957 +### [QList][QList]&lt;int&gt; crossValidationPartitions() const {: #filelist-function-crossvalidationpartitions }
  1958 +
  1959 +Get the cross-validation partion of each [File](#file) in the list. The partition is stored in each [File](#file) at [metadata](#file-members-m_metadata)["Partition"].
  1960 +
  1961 +* **function definition:**
  1962 +
  1963 + QList<int> crossValidationPartitions() const
  1964 +
  1965 +* **parameters:** NONE
  1966 +* **output:** ([QList][QList]&lt;int&gt;) Returns the cross-validation partion of each [File](#file) as a list. If a [File](#file) does not have the "Partition" field in it's [metadata](#file-members-m_metadata) 0 is used.
  1967 +* **example:**
  1968 +
  1969 + File f1, f2, f3;
  1970 + f1.set("Partition", QVariant::fromValue<int>(1));
  1971 + f3.set("Partition", QVariant::fromValue<int>(3));
  1972 +
  1973 + FileList fList(QList<File>() << f1 << f2 << f3);
  1974 + fList.crossValidationPartitions(); // returns [1, 0, 3]
  1975 +
  1976 +
  1977 +### int failures() const {: #filelist-function-failures }
  1978 +
  1979 +Get the number of [Files](#file) in the list that have [failed to enroll](#file-members-fte).
  1980 +
  1981 +* **function definition:**
  1982 +
  1983 + int failures() const
  1984 +
  1985 +* **parameters:** NONE
  1986 +* **output:** (int) Returns the number of [Files](#file) that have [fte](#file-members-fte) equal true.
  1987 +* **example:**
  1988 +
  1989 + File f1, f2, f3;
  1990 + f1.fte = false;
  1991 + f2.fte = true;
  1992 + f3.fte = true;
  1993 +
  1994 + FileList fList(QList<File>() << f1 << f2 << f3);
  1995 + fList.failures(); // returns 2
  1996 +
  1997 +---
  1998 +
  1999 +# Template
  2000 +
  2001 +Inherits [QList][QList]&lt;[Mat][Mat]&gt;.
  2002 +
  2003 +A list of matrices associated with a file.
  2004 +
  2005 +The Template is one of two important data structures in OpenBR (the [File](#file) is the other).
  2006 +A template represents a biometric at various stages of enrollment and can be modified by [Transforms](#transform) and compared to other [templates](#template) with [Distance](#distance).
  2007 +
  2008 +While there exist many cases (ex. video enrollment, multiple face detects, per-patch subspace learning, ...) where the template will contain more than one matrix,
  2009 +in most cases templates have exactly one matrix in their list representing a single image at various stages of enrollment.
  2010 +In the cases where exactly one image is expected, the template provides the function m() as an idiom for treating it as a single matrix.
  2011 +Casting operators are also provided to pass the template into image processing functions expecting matrices.
  2012 +
  2013 +Metadata related to the template that is computed during enrollment (ex. bounding boxes, eye locations, quality metrics, ...) should be assigned to the template's [File](#template-members-file) member.
  2014 +
  2015 +## Members {: #template-members }
  2016 +
  2017 +Member | Type | Description
  2018 +--- | --- | ---
  2019 +<a class="table-anchor" id=template-members-file></a>file | [File](#file) | The file that constructs the template and stores its associated metadata
  2020 +
  2021 +---
  2022 +
  2023 +## Constructors {: #template-constructors }
  2024 +
  2025 +Constructor | Description
  2026 +--- | ---
  2027 +Template() | The default template constructor. It doesn't do anything.
  2028 +Template(const [File](#file) &file) | Sets [file](#template-members-file) to the given [File](#file).
  2029 +Template(const [File](#file) &file, const [Mat][Mat] &mat) | Sets [file](#template-members-file) to the given [File](#file) and appends the given [Mat][Mat] to itself.
  2030 +Template(const [Mat][Mat] &mat) | Appends the given [Mat][Mat] to itself
  2031 +
  2032 +---
  2033 +
  2034 +## Static Functions {: #template-static-functions }
  2035 +
  2036 +
  2037 +### [QDataStream][QDataStream] &operator<<([QDataStream][QDataStream] &stream, const [Template](#template) &t) {: #template-static-operator-ltlt }
  2038 +
  2039 +Serialize a template
  2040 +
  2041 +* **function definition:**
  2042 +
  2043 + QDataStream &operator<<(QDataStream &stream, const Template &t)
  2044 +
  2045 +* **parameters:**
  2046 +
  2047 + Parameter | Type | Description
  2048 + --- | --- | ---
  2049 + stream | [QDataStream][QDataStream] & | The stream to serialize to
  2050 + t | const [Template](#template) & | The template to serialize
  2051 +
  2052 +* **output:** ([QDataStream][QDataStream] &) Returns the updated stream
  2053 +* **example:**
  2054 +
  2055 + void store(QDataStream &stream)
  2056 + {
  2057 + Template t("picture.jpg");
  2058 + t.append(Mat::ones(1, 1, CV_8U));
  2059 +
  2060 + stream << t; // "["1"]picture.jpg" serialized to the stream
  2061 + }
  2062 +
  2063 +### [QDataStream][QDataStream] &operator>>([QDataStream][QDataStream] &stream, [Template](#template) &t) {: #template-static-operator-gtgt }
  2064 +
  2065 +Deserialize a template
  2066 +
  2067 +* **function definition:**
  2068 +
  2069 + QDataStream &operator>>(QDataStream &stream, Template &t)
  2070 +
  2071 +* **parameters:**
  2072 +
  2073 + Parameter | Type | Description
  2074 + --- | --- | ---
  2075 + stream | [QDataStream][QDataStream] & | The stream to deserialize to
  2076 + t | const [Template](#template) & | The template to deserialize
  2077 +
  2078 +* **output:** ([QDataStream][QDataStream] &) Returns the updated stream
  2079 +* **example:**
  2080 +
  2081 + void load(QDataStream &stream)
  2082 + {
  2083 + Template in("picture.jpg");
  2084 + in.append(Mat::ones(1, 1, CV_8U));
  2085 +
  2086 + stream << in; // "["1"]picture.jpg" serialized to the stream
  2087 +
  2088 + Template out;
  2089 + stream >> out;
  2090 +
  2091 + out.file; // returns "picture.jpg"
  2092 + out; // returns ["1"]
  2093 + }
  2094 +
  2095 +---
  2096 +
  2097 +## Functions {: #template-functions }
  2098 +
  2099 +
  2100 +### operator const [File](#file) &() const {: #template-function-operator-file }
  2101 +
  2102 +Idiom to treat the template like a [File](#file).
  2103 +
  2104 +* **function definition:**
  2105 +
  2106 + inline operator const File &() const
  2107 +
  2108 +* **parameters:** NONE
  2109 +* **output:** ([File](#file) Returns [file](#template-members-file).
  2110 +
  2111 +
  2112 +### const [Mat][Mat] &m() const {: #template-function-m-1 }
  2113 +
  2114 +Idiom to treat the template like a [Mat][Mat].
  2115 +
  2116 +* **function definition:**
  2117 +
  2118 + inline const Mat &m() const
  2119 +
  2120 +* **parameters:** NONE
  2121 +* **output:** ([Mat][Mat]) Returns the last [Mat][Mat] in the list. If the list is empty an empty [Mat][Mat] is returned.
  2122 +* **example:**
  2123 +
  2124 + Template t;
  2125 + t.m(); // returns empty mat
  2126 +
  2127 + Mat m1;
  2128 + t.append(m1);
  2129 + t.m(); // returns m1;
  2130 +
  2131 + Mat m2;
  2132 + t.append(m2);
  2133 + t.m(); // returns m2;
  2134 +
  2135 +
  2136 +### [Mat][Mat] &m() {: #template-function-m-2 }
  2137 +
  2138 +Idiom to treat the template like a [Mat][Mat].
  2139 +
  2140 +* **function definition:**
  2141 +
  2142 + inline Mat &m()
  2143 +
  2144 +* **parameters:** NONE
  2145 +* **output:** ([Mat][Mat]) Returns the last [Mat][Mat] in the list. If the list is empty an empty [Mat][Mat] is returned.
  2146 +* **example:**
  2147 +
  2148 + Template t;
  2149 + t.m(); // returns empty mat
  2150 +
  2151 + Mat m1;
  2152 + t.append(m1);
  2153 + t.m(); // returns m1;
  2154 +
  2155 + Mat m2;
  2156 + t.append(m2);
  2157 + t.m(); // returns m2;
  2158 +
  2159 +
  2160 +### operator const [Mat][Mat] &() {: #template-function-operator-mat-1 }
  2161 +
  2162 +Idiom to treat the template like a [Mat][Mat]. Makes a call to [m()](#template-function-m-1).
  2163 +
  2164 +* **function definition:**
  2165 +
  2166 + inline operator const Mat&() const
  2167 +
  2168 +* **parameters:** NONE
  2169 +* **output:** ([Mat][Mat]) Returns the last [Mat][Mat] in the list. If the list is empty an empty [Mat][Mat] is returned.
  2170 +* **see:** [m](#template-function-m-1)
  2171 +
  2172 +
  2173 +### operator [Mat][Mat] &() {: #template-function-operator-mat-2 }
  2174 +
  2175 +Idiom to treat the template like a [Mat][Mat]. Makes a call to [m()](#template-function-m-1).
  2176 +
  2177 +* **function definition:**
  2178 +
  2179 + inline operator Mat&()
  2180 +
  2181 +* **parameters:** NONE
  2182 +* **output:** ([Mat][Mat]) Returns the last [Mat][Mat] in the list. If the list is empty an empty [Mat][Mat] is returned.
  2183 +* **see:** [m](#template-function-m-1)
  2184 +
  2185 +
  2186 +### operator [_InputArray][InputArray] &() {: #template-function-operator-inputarray }
  2187 +
  2188 +Idiom to treat the template like an [_InputArray][InputArray]. Makes a call to [m()](#template-function-m-1).
  2189 +
  2190 +* **function definition:**
  2191 +
  2192 + inline operator _InputArray() const
  2193 +
  2194 +<!-- _no italics_-->
  2195 +* **parameters:** NONE
  2196 +* **output:** ([_InputArray][InputArray]) Returns the last [Mat][Mat] in the list. If the list is empty an empty [Mat][Mat] is returned.
  2197 +* **see:** [m](#template-function-m-1)
  2198 +
  2199 +
  2200 +### operator [_OutputArray][OutputArray] &() {: #template-function-operator-outputarray }
  2201 +
  2202 +Idiom to treat the template like an [_OutputArray][InputArray]. Makes a call to [m()](#template-function-m-1).
  2203 +
  2204 +* **function definition:**
  2205 +
  2206 + inline operator _OutputArray()
  2207 +
  2208 +<!-- _no italics_-->
  2209 +* **parameters:** NONE
  2210 +* **output:** ([_OutputArray][OutputArray]) Returns the last [Mat][Mat] in the list. If the list is empty an empty [Mat][Mat] is returned.
  2211 +* **see:** [m](#template-function-m-1)
  2212 +
  2213 +
  2214 +### [Mat][Mat] &operator =(const [Mat][Mat] &other) {: #template-function-operator-e }
  2215 +
  2216 +Idiom to treat the template like a [Mat][Mat]. Set the result of [m()](#template-function-m-1) equal to other.
  2217 +
  2218 +* **function definition:**
  2219 +
  2220 + inline Mat &operator=(const Mat &other)
  2221 +
  2222 +* **parameters:**
  2223 +
  2224 + Parameter | Type | Description
  2225 + --- | --- | ---
  2226 + other | const Mat & | Mat to overwrite value of [m](#template-function-m-1)
  2227 +
  2228 +* **output**: ([Mat][Mat] &) Returns a reference to the updated [Mat][Mat]
  2229 +
  2230 +
  2231 +### bool isNull() const {: #template-function-isnull }
  2232 +
  2233 +Check if the template is NULL.
  2234 +
  2235 +* **function definition:**
  2236 +
  2237 + inline bool isNull() const
  2238 +
  2239 +* **parameters:** NONE
  2240 +* **output:** (bool) Returns true if the template is empty *or* if [m](#template-function-m-1) has no data.
  2241 +* **example:**
  2242 +
  2243 + Template t;
  2244 + t.isNull(); // returns true
  2245 +
  2246 + t.append(Mat());
  2247 + t.isNull(); // returns true
  2248 +
  2249 + t.append(Mat::ones(1, 1, CV_8U));
  2250 + t.isNull(); // returns false
  2251 +
  2252 +
  2253 +### void merge(const [Template](#template) &other) {: #template-function-merge }
  2254 +
  2255 +Append the contents of another template. The [files](#template-members-file) are appended using [append](#file-function-append-1).
  2256 +
  2257 +* **function definition:**
  2258 +
  2259 + inline void merge(const Template &other)
  2260 +
  2261 +* **parameters:**
  2262 +
  2263 + Parameter | Type | Description
  2264 + --- | --- | ---
  2265 + other | const [Template][#template] & | Template to be merged
  2266 +
  2267 +* **output:** (void)
  2268 +* **example:**
  2269 +
  2270 + Template t1("picture1.jpg"), t2("picture2.jpg");
  2271 + Mat m1, m2;
  2272 +
  2273 + t1.append(m1);
  2274 + t2.append(m2);
  2275 +
  2276 + t1.merge(t2);
  2277 +
  2278 + t1.file; // returns picture1.jpg;picture2.jpg[seperator=;]
  2279 + t1; // returns [m1, m2]
  2280 +
  2281 +
  2282 +### size_t bytes() const {: #template-function-bytes }
  2283 +
  2284 +Get the total number of bytes in the template
  2285 +
  2286 +* **function definition:**
  2287 +
  2288 + size_t bytes() const
  2289 +
  2290 +* **parameters:** None
  2291 +* **output:** (int) Returns the sum of the bytes in each [Mat][Mat] in the [Template](#template)
  2292 +* **example:**
  2293 +
  2294 + Template t;
  2295 +
  2296 + Mat m1 = Mat::ones(1, 1, CV_8U); // 1 byte
  2297 + Mat m2 = Mat::ones(2, 2, CV_8U); // 4 bytes
  2298 + Mat m3 = Mat::ones(3, 3, CV_8U); // 9 bytes
  2299 +
  2300 + t << m1 << m2 << m3;
  2301 +
  2302 + t.bytes(); // returns 14
  2303 +
  2304 +
  2305 +### Template clone() const {: #template-function-clone }
  2306 +
  2307 +Clone the template
  2308 +
  2309 +* **function definition:**
  2310 +
  2311 + Template clone() const
  2312 +
  2313 +* **parameters:** NONE
  2314 +* **output:** ([Template](#template)) Returns a new [Template](#template) with copies of the [file](#template-members-file) and each [Mat][Mat] that was in the original.
  2315 +* **example:**
  2316 +
  2317 + Template t1("picture.jpg");
  2318 + t1.append(Mat::ones(1, 1, CV_8U));
  2319 +
  2320 + Template t2 = t1.clone();
  2321 +
  2322 + t2.file; // returns "picture.jpg"
  2323 + t2; // returns ["1"]
  2324 +
  2325 +---
  2326 +
  2327 +# TemplateList
  2328 +
  2329 +Inherits [QList][QList]&lt;[Template][#template]&gt;.
  2330 +
  2331 +Convenience class for working with a list of templates.
  2332 +
  2333 +## Members {: #templatelist-members }
  2334 +
  2335 +NONE
  2336 +
  2337 +---
  2338 +
  2339 +## Constructors {: #templatelist-constructors }
  2340 +
  2341 +Constructor | Description
  2342 +--- | ---
  2343 +TemplateList() | The default [TemplateList](#templatelist) constructor. Doesn't do anything.
  2344 +TemplateList(const [QList][QList]&lt;[Template](#template)&gt; &templates) | Initialize the [TemplateList](#templatelist) with a list of templates. The given list is appended
  2345 +TemplateList(const [QList][QList]&lt;[File](#file)&gt; &files) | Initialize the [TemplateList](#templatelist) with a list of [Files](#file). Each [File](#file) is treated like a template and appended.
  2346 +
  2347 +---
  2348 +
  2349 +## Static Functions {: #templatelist-static-functions }
  2350 +
  2351 +### [TemplateList](#templatelist) fromGallery(const [File](#file) &gallery) {: #templatelist-static-fromgallery }
  2352 +
  2353 +Create a [TemplateList](#templatelist) from a gallery [File](#file).
  2354 +
  2355 +* **function definition:**
  2356 +
  2357 + static TemplateList fromGallery(const File &gallery)
  2358 +
  2359 +* **parameters:**
  2360 +
  2361 + Parameter | Type | Description
  2362 + --- | --- | ---
  2363 + gallery | const [File](#file) & | Gallery [file](#file) to be enrolled.
  2364 +
  2365 +* **output:** ([TemplateList](#templatelist)) Returns a [TemplateList](#templatelist) created by enrolling the gallery.
  2366 +
  2367 +
  2368 +### [TemplateList](#templatelist) fromBuffer(const [QByteArray][QByteArray] &buffer) {: #templatelist-static-frombuffer }
  2369 +
  2370 +Create a template from a memory buffer of individual templates. This is compatible with **.gal** galleries.
  2371 +
  2372 +* **function definition:**
  2373 +
  2374 + static TemplateList fromBuffer(const QByteArray &buffer)
  2375 +
  2376 +* **parameters:**
  2377 +
  2378 + Parameter | Type | Description
  2379 + --- | --- | ---
  2380 + buffer | const [QByteArray][QByteArray] & | Raw data buffer to be enrolled
  2381 +
  2382 +* **output:** ([TemplateList][TemplateList]) Returns a [TemplateList](#templatelist) created by enrolling the buffer
  2383 +
  2384 +
  2385 +### [TemplateList](#templatelist) relabel(const [TemplateList](#templatelist) &tl, const [QString][QString] &propName, bool preserveIntegers) {: #templatelist-static-relabel }
  2386 +
  2387 +Relabel the values associated with a given key in the [metadata](#file-members-m_metadata) of a provided [TemplateList](#templatelist). The values are relabeled to be between [0, numClasses-1]. If preserveIntegers is true and the [metadata](#file-members-m_metadata) can be converted to integers then numClasses equals the maximum value in the values. Otherwise, numClasses equals the number of unique values. The relabeled values are stored in the "Label" field of the returned [TemplateList](#templatelist).
  2388 +
  2389 +* **function definition:**
  2390 +
  2391 + static TemplateList relabel(const TemplateList &tl, const QString &propName, bool preserveIntegers)
  2392 +
  2393 +* **parameters:**
  2394 +
  2395 + Parameter | Type | Description
  2396 + --- | --- | ---
  2397 + tl | const [TemplateList](#templatelist) & | [TemplateList](#templatelist) to be relabeled
  2398 + propName | const [QString][QString] & | [Metadata](#file-members-m_metadata) key
  2399 + preserveIntegers | bool | If true attempt to use the [metadata](#file-members-m_metadata) values as the relabeled values. Otherwise use the number of unique values.
  2400 +
  2401 +* **output:** ([TemplateList](#templatelist)) Returns a [TemplateList](#templatelist) identical to the input [TemplateList](#templatelist) but with the new labels appended to the [metadata](#file-members-m_metadata) using the "Label" key.
  2402 +* **example:**
  2403 +
  2404 + Template t1, t2, t3;
  2405 +
  2406 + t1.file.set("Class", QString("1"));
  2407 + t2.file.set("Class", QString("10"));
  2408 + t3.file.set("Class", QString("100"));
  2409 + TemplateList tList(QList<Template>() << t1 << t2 << t3);
  2410 +
  2411 + TemplateList relabeled = TemplateList::relabel(tList, "Class", true);
  2412 + relabeled.files(); // returns [[Class=1, Label=1], [Class=10, Label=10], [Class=100, Label=100]]
  2413 +
  2414 + relabeled = TemplateList::relabel(tList, "Class", false);
  2415 + relabeled.files(); // returns [[Class=1, Label=0], [Class=10, Label=1], [Class=100, Label=2]]
  2416 +
  2417 +---
  2418 +
  2419 +## Functions {: #templatelist-functions }
  2420 +
  2421 +### [QList][QList]&lt;int&gt; indexProperty(const [QString][QString] &propName, [QHash][QHash]&lt;[QString][QString], int&gt; &valueMap, [QHash][QHash]&lt;int, [QVariant][QVariant]&gt; &reverseLookup) const {: #templatelist-function-indexproperty-1 }
  2422 +
  2423 +Convert [metadata](#file-members-m_metadata) values associated with **propName** to integers. Each unique value gets its own integer. This is useful in many classification problems where nominal data (e.g "Male", "Female") needs to represented with integers ("Male" = 0, "Female" = 1). **valueMap** and **reverseLookup** are created to allow easy conversion to the integer replacements and back.
  2424 +
  2425 +* **function definition:**
  2426 +
  2427 + QList<int> indexProperty(const QString &propName, QHash<QString, int> &valueMap, QHash<int, QVariant> &reverseLookup) const
  2428 +
  2429 +* **parameters:**
  2430 +
  2431 + Parameter | Type | Description
  2432 + --- | --- | ---
  2433 + propName | const [QString][QString] & | [Metadata](#file-members-m_metadata) key
  2434 + valueMap | [QHash][QHash]&lt;[QString][QString], int&gt; & | A mapping from [metadata](#file-members-m_metadata) values to the equivalent unique index. [QStrings][QString] are used instead of [QVariant][QVariant] so comparison operators can be used. This is filled in by the function and can be provided empty.
  2435 + reverseLookup | [QHash][QHash]&lt;int, [QVariant][QVariant]&gt; & | A mapping from the unique index to the original value. This is the *reverse* mapping of the **valueMap**. This is filled in by the function and can be provided empty.
  2436 +
  2437 +* **output:** ([QList][QList]&lt;int&gt;) Returns a list of unique integers that can be mapped to the [metadata](#file-members-m_metadata) values associated with **propName**. The integers can be mapped to their respective values using **valueMap** and the values can be mapped to the integers using **reverseLookup**.
  2438 +* **example:**
  2439 +
  2440 + Template t1, t2, t3, t4;
  2441 +
  2442 + t1.file.set("Key", QString("Class 1"));
  2443 + t2.file.set("Key", QString("Class 2"));
  2444 + t3.file.set("Key", QString("Class 3"));
  2445 + t4.file.set("Key", QString("Class 1"));
  2446 +
  2447 + TemplateList tList(QList<Template>() << t1 << t2 << t3 << t4);
  2448 +
  2449 + QHash<QString, int> valueMap;
  2450 + QHash<int, QVariant> reverseLookup;
  2451 + tList.indexProperty("Key", valueMap, reverseLookup); // returns [0, 1, 2, 0]
  2452 + valueMap; // returns QHash(("Class 1", 0)("Class 2", 1)("Class 3", 2))
  2453 + reverseLookup; // QHash((0, QVariant(QString, "Class 1")) (2, QVariant(QString, "Class 3")) (1, QVariant(QString, "Class 2")))
  2454 +
  2455 +
  2456 +### [QList][QList]&lt;int&gt; indexProperty(const [QString][QString] &propName, [QHash][QHash]&lt;[QString][QString], int&gt; \*valueMap=NULL, [QHash][QHash]&lt;int, [QVariant][QVariant]&gt; \*reverseLookup=NULL) const {: #templatelist-function-indexproperty-2 }
  2457 +
  2458 +Shortcut to call [indexProperty](#templatelist-function-indexproperty-1) without **valueMap** or **reverseLookup** arguments.
  2459 +
  2460 +* **function definition:**
  2461 +
  2462 + QList<int> indexProperty(const QString &propName, QHash<QString, int> * valueMap=NULL,QHash<int, QVariant> * reverseLookup = NULL) const
  2463 +
  2464 +* **parameters:**
  2465 +
  2466 + Parameter | Type | Description
  2467 + --- | --- | ---
  2468 + propName | const [QString][QString] & | [Metadata](#file-members-m_metadata) key
  2469 + valueMap | [QHash][QHash]&lt;[QString][QString], int&gt; \* | (Optional) A mapping from [metadata](#file-members-m_metadata) values to the equivalent unique index. [QStrings][QString] are used instead of [QVariant][QVariant] so comparison operators can be used. This is filled in by the function and can be provided empty.
  2470 + reverseLookup | [QHash][QHash]&lt;int, [QVariant][QVariant]&gt; \* | (Optional) A mapping from the unique index to the original value. This is the *reverse* mapping of the **valueMap**. This is filled in by the function and can be provided empty.
  2471 +
  2472 +* **output:** ([QList][QList]&lt;int&gt;) Returns a list of unique integers that can be mapped to the [metadata](#file-members-m_metadata) values associated with **propName**. The integers can be mapped to their respective values using **valueMap** (if provided) and the values can be mapped to the integers using **reverseLookup** (if provided).
  2473 +
  2474 +
  2475 +### [QList][QList]&lt;int&gt; applyIndex(const [QString][QString] &propName, const [QHash][QHash]&lt;[QString][QString], int&gt; &valueMap) const {: #templatelist-function-applyindex }
  2476 +
  2477 +Apply a mapping to convert non-integer values to integers. [Metadata](#file-members-m_metadata) values associated with **propName** are mapped through the given **valueMap**.
  2478 +
  2479 +* **function definition:**
  2480 +
  2481 + QList<int> applyIndex(const QString &propName, const QHash<QString, int> &valueMap) const
  2482 +
  2483 +* **parameters:**
  2484 +
  2485 + Parameter | Type | Description
  2486 + --- | --- | ---
  2487 + propName | const [QString][QString] & | [Metadata](#file-members-m_metadata) key
  2488 + valueMap | const [QHash][QHash]&lt;[QString][QString], int&gt; & | (Optional) A mapping from [metadata](#file-members-m_metadata) values to the equivalent unique index. [QStrings][QString] are used instead of [QVariant][QVariant] so comparison operators can be used.
  2489 +
  2490 +* **output:** ([Qlist][QList]&lt;int&gt;) Returns a list of integer values. The values are ordered in the same order as the [Templates](#template) in the list. The values are calculated like so:
  2491 +
  2492 + 1. If the value *is* found in the **valueMap**, its integer mapping is appened to the list.
  2493 + 2. If the value *is not* found in the **valueMap**, -1 is appened to the list.
  2494 +
  2495 +* **example:**
  2496 +
  2497 + Template t1, t2, t3, t4;
  2498 +
  2499 + t1.file.set("Key", QString("Class 1"));
  2500 + t2.file.set("Key", QString("Class 2"));
  2501 + t3.file.set("Key", QString("Class 3"));
  2502 + t4.file.set("Key", QString("Class 1"));
  2503 +
  2504 + TemplateList tList(QList<Template>() << t1 << t2 << t3 << t4);
  2505 +
  2506 + QHash<QString, int> valueMap;
  2507 + valueMap.insert("Class 1", 0);
  2508 + valueMap.insert("Class 2", 1);
  2509 +
  2510 + tList.applyIndex("Key", valueMap); // returns [0, 1, -1, 0]
  2511 +
  2512 +
  2513 +### <tt>T</tt> bytes() const {: #templatelist-function-bytes }
  2514 +
  2515 +Get the total number of bytes in the [TemplateList](#templatelist).
  2516 +
  2517 +* **function definition:**
  2518 +
  2519 + template <typename T> T bytes() const
  2520 +
  2521 +* **parameters:** NONE
  2522 +* **output:** (<tt>T</tt>) Returns the sum of the bytes in each of the [Templates](#template) in the list. <tt>T</tt> is a user specified type. It is expected to be numeric (int, float etc.)
  2523 +* **see:** [bytes](#template-function-bytes)
  2524 +* **example:**
  2525 +
  2526 + Template t1, t2;
  2527 +
  2528 + t1.append(Mat::ones(1, 1, CV_8U)); // 1 byte
  2529 + t1.append(Mat::ones(2, 2, CV_8U)); // 4 bytes
  2530 + t2.append(Mat::ones(3, 3, CV_8U)); // 9 bytes
  2531 + t2.append(Mat::ones(4, 4, CV_8U)); // 16 bytes
  2532 +
  2533 + TemplateList tList(QList<Template>() << t1 << t2);
  2534 + tList.bytes(); // returns 30
  2535 +
  2536 +
  2537 +### [QList][QList]&lt;[Mat][Mat]&gt; data(int index = 0) const {: #templatelist-function-data }
  2538 +
  2539 +Get a list of matrices compiled from each [Template](#template) in the list.
  2540 +
  2541 +* **function definition:**
  2542 +
  2543 + QList<cv::Mat> data(int index = 0) const
  2544 +
  2545 +* **parameters:**
  2546 +
  2547 + Parameter | Type | Description
  2548 + --- | --- | ---
  2549 + index | int | (Optional) Index into each [Template](#template) to select a [Mat][Mat]. Default is 0.
  2550 +
  2551 +* **output:** ([QList][QList]&lt;[Mat][Mat]&gt;) Returns a list of [Mats][Mat]. One [Mat][Mat] is supplied by each [Template](#template) in the image at the specified index.
  2552 +* **example:**
  2553 +
  2554 + Template t1, t2;
  2555 +
  2556 + t1.append(Mat::ones(1, 1, CV_8U));
  2557 + t1.append(Mat::zeros(1, 1, CV_8U));
  2558 + t2.append(Mat::ones(1, 1, CV_8U));
  2559 + t2.append(Mat::zeros(1, 1, CV_8U));
  2560 +
  2561 + TemplateList tList(QList<Template>() << t1 << t2);
  2562 + tList.data(); // returns ["1", "1"];
  2563 + tList.data(1); // returns ["0", "0"];
  2564 +
  2565 +
  2566 +### [QList][QList]&lt;[TemplateList](#templatelist)&gt; partition(const [QList][QList]&lt;int&gt; &partitionSizes) const {: #templatelist-function-partition }
  2567 +
  2568 +Divide the [TemplateList](#templatelist) into a list of [TemplateLists](#templatelist) partitions.
  2569 +
  2570 + * **function defintion:**
  2571 +
  2572 + QList<TemplateList> partition(const QList<int> &partitionSizes) const
  2573 +
  2574 +* **parameters:**
  2575 +
  2576 + Parameter | Type | Description
  2577 + --- | --- | ---
  2578 + partitionSizes | [QList][QList]&lt;int&gt; | A list of sizes for the partitions. The total number of partitions is equal to the length of this list. Each value in this list specifies the number of [Mats][Mat] that should be in each template of the associated partition. The sum of values in this list *must* equal the number of [Mats][Mat] in each [Template](#template) in the original [TemplateList](#templatelist).
  2579 +
  2580 +* **output:** ([QList][QList]&lt;[TemplateList](#templatelist)&gt;) Returns a [QList][QList] of [TemplateLists](#templatelist) of partitions. Each partition has length equal to the number of templates in the original [TemplateList](#templatelist). Each [Template](#template) has length equal to the size specified in the associated value in **partitionSizes**.
  2581 +* **example:**
  2582 +
  2583 + Template t1, t2, t3;
  2584 +
  2585 + t1.append(Mat::ones(1, 1, CV_8U));
  2586 + t1.append(2*Mat::ones(1, 1, CV_8U));
  2587 + t1.append(3*Mat::ones(1, 1, CV_8U));
  2588 +
  2589 + t2.append(4*Mat::ones(1, 1, CV_8U));
  2590 + t2.append(5*Mat::ones(1, 1, CV_8U));
  2591 + t2.append(6*Mat::ones(1, 1, CV_8U));
  2592 +
  2593 + t3.append(7*Mat::ones(1, 1, CV_8U));
  2594 + t3.append(8*Mat::ones(1, 1, CV_8U));
  2595 + t3.append(9*Mat::ones(1, 1, CV_8U));
  2596 +
  2597 + TemplateList tList(QList<Template>() << t1 << t2 << t3);
  2598 +
  2599 + QList<TemplateList> partitions = tList.partition(QList<int>() << 1 << 2); // split into 2 partitions. 1 with 1 Mat and 1 with 2 Mats.
  2600 +
  2601 + partitions[0]; // returns [("1"), ("4"), ("7")]
  2602 + partitions[1]; // returns [("2", "3"), ("5", "6"), ("8", "9")]
  2603 +
  2604 +### [FileList](#filelist) files() const {: #templatelist-function-files }
  2605 +
  2606 +Get a list of all the [Files](#file) in the [TemplateList](#templatelist)
  2607 +
  2608 +* **function definition:**
  2609 +
  2610 + FileList files() const
  2611 +
  2612 +* **parameters:** NONE
  2613 +* **output:** ([FileList](#filelist)) Returns a [FileList](#filelist) with the [file](#template-members-file) of each [Template](#template) in the [TemplateList](#templatelist).
  2614 +* **example:**
  2615 +
  2616 + Template t1("picture1.jpg"), t2("picture2.jpg");
  2617 +
  2618 + t1.file.set("Key", QVariant::fromValue<float>(1));
  2619 + t2.file.set("Key", QVariant::fromValue<float>(2));
  2620 +
  2621 + TemplateList tList(QList<Template>() << t1 << t2);
  2622 +
  2623 + tList.files(); // returns ["picture1.jpg[Key=1]", "picture2.jpg[Key=2]"]
  2624 +
  2625 +
  2626 +### [FileList](#filelist) operator()() {: #templatelist-function-operator-pp }
  2627 +
  2628 +Shortcut call to [files](#templatelist-function-files)
  2629 +
  2630 +* **function definition:**
  2631 +
  2632 + FileList operator()() const
  2633 +
  2634 +* **parameters:** NONE
  2635 +* **output:** ([FileList](#filelist)) Returns a [FileList](#filelist) with the [file](#template-members-file) of each [Template](#template) in the [TemplateList](#templatelist).
  2636 +* **example:**
  2637 +
  2638 + Template t1("picture1.jpg"), t2("picture2.jpg");
  2639 +
  2640 + t1.file.set("Key", QVariant::fromValue<float>(1));
  2641 + t2.file.set("Key", QVariant::fromValue<float>(2));
  2642 +
  2643 + TemplateList tList(QList<Template>() << t1 << t2);
  2644 +
  2645 + tList.files(); // returns ["picture1.jpg[Key=1]", "picture2.jpg[Key=2]"]
  2646 +
  2647 +
  2648 +### [QMap][QMap]&lt;T, int&gt; countValues(const [QString][QString] &propName, bool excludeFailures = false) const {: #templatelist-function-countvalues }
  2649 +
  2650 +Get the frequency of each unique value associated with a provided [metadata](#file-members-m_metadata) key.
  2651 +
  2652 +* **function definition:**
  2653 +
  2654 +template<typename T> QMap<T,int> countValues(const QString &propName, bool excludeFailures = false) const
  2655 +
  2656 +* **parameters:**
  2657 +
  2658 + Parameter | Type | Description
  2659 + --- | --- | ---
  2660 + propName | const [QString][QString] & | [Metadata](#file-members-m_metadata) key
  2661 + excludeFailures | bool | (Optional) Exclude [File](#file) [metadata](#file-members-m_metadata) if the [File](#file) has [fte](#file-members-fte) equal to true. Default is false
  2662 +
  2663 +* **output:** ([QMap][QMap]&lt;<T, int&gt;) Returns a mapping between unique [metadata](#file-members-m_metadata) and their frequency.
  2664 +* **example:**
  2665 +
  2666 + Template t1, t2, t3, t4;
  2667 +
  2668 + t1.file.set("Key", QString("Class 1"));
  2669 + t2.file.set("Key", QString("Class 2"));
  2670 + t3.file.set("Key", QString("Class 3"));
  2671 + t4.file.set("Key", QString("Class 1"));
  2672 +
  2673 + TemplateList tList(QList<Template>() << t1 << t2 << t3 << t4);
  2674 +
  2675 + tList.countValues<QString>("Key"); // returns QMap(("Class 1", 2), ("Class 2", 1), ("Class 3", 1))
  2676 +
  2677 +### [TemplateList](#templatelist) reduced() const {: #templatelist-function-reduced }
  2678 +
  2679 +Reduce the [Templates](#template) in the [TemplateList](#templatelist) by merging them together.
  2680 +
  2681 +* **function definition:**
  2682 +
  2683 + TemplateList reduced() const
  2684 +
  2685 +* **parameters:** NONE
  2686 +* **output:** ([TemplateList](#templatelist)) Returns a [TemplateList](#templatelist) with a single [Template](#template). The [Template](#template) is the result of calling [merge](#template-function-merge) on every [Template](#template).
  2687 +* **see:** [merge](#template-function-merge)
  2688 +* **example:**
  2689 +
  2690 + Template t1("picture1.jpg"), t2("picture2.jpg");
  2691 +
  2692 + t1.file.set("Key1", QString("Value1"));
  2693 + t2.file.set("Key2", QString("Value2"));
  2694 +
  2695 + TemplateList tList(QList<Template>() << t1 << t2);
  2696 +
  2697 + TemplateList reduced = tList.reduced();
  2698 + reduced.size(); // returns 1
  2699 + reduced.files(); // returns ["picture1.jpg;picture2.jpg[Key1=Value1, Key2=Value2, separator=;]"]
  2700 +
  2701 +### [QList][QList]&lt;int&gt; find(const [QString][QString] &key, const T &value) {: #templatelist-function-find }
  2702 +
  2703 +Get the indices of every [Template](#template) that has a provided key value pairing in its [metadata](#file-members-m_metadata)
  2704 +
  2705 +* **function definition:**
  2706 +
  2707 + template<typename T> QList<int> find(const QString &key, const <tt>T</tt> &value)
  2708 +
  2709 +* **parameters:**
  2710 +
  2711 + Parameter | Type | Description
  2712 + --- | --- | ---
  2713 + key | const [QString][QString] & | [Metadata](#file-members-m_metadata) key to search for
  2714 + value | const <tt>T</tt> & | Value to search for. Both the **key** and value must match. <tt>T</tt> is a user specified type.
  2715 +
  2716 +* **output:** ([QList][QList]&lt;int&gt;) Returns a list of indices for [Templates](#template) that contained the key-value pairing in their [metadata](#file-members-m_metadata)
  2717 +* **example:**
  2718 +
  2719 + Template t1, t2, t3;
  2720 +
  2721 + t1.file.set("Key", QString("Value1"));
  2722 + t2.file.set("Key", QString("Value2"));
  2723 + t3.file.set("Key", QString("Value2"));
  2724 +
  2725 + TemplateList tList(QList<Template>() << t1 << t2 << t3);
  2726 + tList.find<QString>("Key", "Value2"); // returns [1, 2]
  2727 +
  2728 +---
  2729 +
  2730 +# Factory
  2731 +
  2732 +For run time construction of objects from strings.
  2733 +
  2734 +Uses the Industrial Strength Pluggable Factory model described [here](http://adtmag.com/articles/2000/09/25/industrial-strength-pluggable-factories.aspx).
  2735 +
  2736 +The factory might be the most important construct in OpenBR. It is what enables the entire plugin architecture to function. All plugins in OpenBR are children of the [Object](#object) type. At compile time, each plugin is registered in the factory using the plugin name and abstraction type ([Transform](#transform), [Distance](#distance), etc.). At runtime, OpenBR utilizes
  2737 +
  2738 +## Members {: #factory-members }
  2739 +
  2740 +Member | Type | Description
  2741 +--- | --- | ---
  2742 +registry | static [QMap][QMap]&lt;[QString][QString],[Factory](#factory)&lt;<tt>T</tt>&gt;\*&gt; | Registered
  2743 +
  2744 +---
  2745 +
  2746 +# Object
  2747 +
  2748 +---
  2749 +
  2750 +# Context
  2751 +
  2752 +The singleton class of global settings. Before including and using OpenBR in a project the user must call [initialize](#context-static-initialize). Before the program terminates the user must call [finalize](#context-static-finalize). The settings are accessible as Context \*Globals.
  2753 +
  2754 +## Members {: #context-members }
  2755 +
  2756 +Member | Type | Description
  2757 +--- | --- | ---
  2758 +<a class="table-anchor" id=context-members-sdkpath></a>sdkPath | [QString][QString] | Path to the sdk. Path + **share/openbr/openbr.bib** must exist.
  2759 +<a class="table-anchor" id=context-members-algorithm></a>algorithm | [QString][QString] | The default algorithm to use when enrolling and comparing templates.
  2760 +<a class="table-anchor" id=context-members-log></a>log | [QString][QString] | Optional log file to copy **stderr** to.
  2761 +<a class="table-anchor" id=context-members-path></a>path | [QString][QString] | Path to use when resolving images specified with relative paths. Multiple paths can be specified using a semicolon separator.
  2762 +<a class="table-anchor" id=context-members-parallelism></a>parallelism | int | The number of threads to use. The default is the maximum of 1 and the value returned by ([QThread][QThread]::idealThreadCount() + 1).
  2763 +<a class="table-anchor" id=context-members-usegui></a>useGui | bool | Whether or not to use GUI functions. The default is true.
  2764 +<a class="table-anchor" id=context-members-blocksize></a>blockSize | int | The maximum number of templates to process in parallel. The default is: ```parallelism * ((sizeof(void*) == 4) ? 128 : 1024)```
  2765 +<a class="table-anchor" id=context-members-quiet></a>quiet | bool | If true, no messages will be sent to the terminal. The default is false.
  2766 +<a class="table-anchor" id=context-members-verbose></a>verbose | bool | If true, extra messages will be sent to the terminal. The default is false.
  2767 +<a class="table-anchor" id=context-members-mostrecentmessage></a>mostRecentMessage | [QString][QString] | The most recent message sent to the terminal.
  2768 +<a class="table-anchor" id=context-members-currentstep></a>currentStep | double | Used internally to compute [progress](#context-function-progress) and [timeRemaining](#context-function-timeremaining).
  2769 +<a class="table-anchor" id=context-members-totalsteps></a>totalSteps | double | Used internally to compute [progress](#context-function-progress) and [timeRemaining](#context-function-timeremaining).
  2770 +<a class="table-anchor" id=context-members-enrollall></a>enrollAll | bool | If true, enroll 0 or more templates per image. Otherwise, enroll exactly one. The default is false.
  2771 +<a class="table-anchor" id=context-members-filters></a>filters | Filters | Filters is a ```typedef QHash<QString,QStringList> Filters```. Filters that automatically determine imposter matches based on target ([gallery](#gallery)) template metadata. See [FilterDistance](plugins/distance.md#filterdistance).
  2772 +<a class="table-anchor" id=context-members-buffer></a>buffer | [QByteArray][QByteArray] | File output is redirected here if the file's basename is "buffer". This clears previous contents.
  2773 +<a class="table-anchor" id=context-members-scorenormalization></a>scoreNormalization | bool | If true, enable score normalization. Otherwise disable it. The default is true.
  2774 +<a class="table-anchor" id=context-members-crossValidate></a>crossValidate | int | Perform k-fold cross validation where k is the value of **crossValidate**. The default value is 0.
  2775 +<a class="table-anchor" id=context-members-modelsearch></a>modelSearch | [QList][QList]&lt;[QString][QString]&gt; | List of paths to search for sub-models on.
  2776 +<a class="table-anchor" id=context-members-abbreviations></a>abbreviations | [QHash][QHash]&lt;[QString][QString], [QString][QString]&gt; | Used by [Transform](#transform)::[make](#transform-function-make) to expand abbreviated algorithms into their complete definitions.
  2777 +<a class="table-anchor" id=context-members-starttime></a>startTime | [QTime][QTime] | Used to estimate [timeRemaining](#context-function-timeremaining).
  2778 +<a class="table-anchor" id=context-members-logfile></a>logFile | [QFile][QFile] | Log file to write to.
  2779 +
  2780 +---
  2781 +
  2782 +## Constructors {: #context-constructors }
  2783 +
  2784 +NONE
  2785 +
  2786 +---
  2787 +
  2788 +## Static Functions {: #context-static-functions }
  2789 +
  2790 +### void initialize(int &argc, char \*argv[], [QString][QString] sdkPath = "", bool useGui = true) {: #context-static-initialize }
  2791 +
  2792 +Call *once* at the start of the application to allocate global variables. If the project is a [Qt][Qt] project this call should occur after initializing <tt>QApplication</tt>.
  2793 +
  2794 +* **function definition:**
  2795 +
  2796 + static void initialize(int &argc, char *argv[], QString sdkPath = "", bool useGui = true);
  2797 +
  2798 +* **parameters:**
  2799 +
  2800 + Parameter | Type | Description
  2801 + --- | --- | ---
  2802 + argc | int & | Number of command line arguments as provided by <tt>main()</tt>
  2803 + argv | char * [] | Command line arguments as provided by <tt>main()</tt>
  2804 + sdkPath | [QString][QString] | (Optional) The path to the folder containing **share/openbr/openbr.bib**. If no path is provided (default) OpenBR automatically searches: <ul> <li>The working directory</li> <li>The executable's location</li> </ul>
  2805 + useGui | bool | (Optional) Make OpenBR as a [QApplication][QApplication] instead of a [QCoreApplication][QCoreApplication]. Default is true.
  2806 +
  2807 +* **output:** (void)
  2808 +* **see:** [finalize](#context-static-finalize)
  2809 +* **example:**
  2810 +
  2811 + int main(int argc, char \*argv[])
  2812 + {
  2813 + QApplication(argc, argv); // ONLY FOR QT PROJECTS
  2814 + br::Context::initialize(argc, argv);
  2815 +
  2816 + // ...
  2817 +
  2818 + br::Context::finalize();
  2819 + return 0;
  2820 + }
  2821 +
  2822 +### void finalize() {: #context-static-finalize }
  2823 +
  2824 +Call *once* at the end of the application to deallocate global variables.
  2825 +
  2826 +* **function definition:**
  2827 +
  2828 + static void finalize();
  2829 +
  2830 +* **parameters:** NONE
  2831 +* **output:** (void)
  2832 +* **see:** [initialize](#context-static-initialize)
  2833 +
  2834 +
  2835 +### bool checkSDKPath(const [QString][QString] &sdkPath) {: #context-static-checksdkpath }
  2836 +
  2837 +Check if a given SDK path is valid. A valid SDK satisfies
  2838 +
  2839 + exists(sdkPath + "share/openbr/openbr.bib")
  2840 +
  2841 +* **function definition:**
  2842 +
  2843 + static bool checkSDKPath(const QString &sdkPath);
  2844 +
  2845 +* **parameters:**
  2846 +
  2847 + Parameter | Type | Description
  2848 + --- | --- | ---
  2849 + sdkPath | const [QString][QString] & | Possible sdk path to examine
  2850 +
  2851 +* **output:** (bool) Returns true if the sdkPath + "share/openbr/openbr.bib" exists, otherwise returns false.
  2852 +* **example:**
  2853 +
  2854 + // OpenBR is at /libs/openbr
  2855 +
  2856 + checkSDKPath("/libs/openbr/"); // returns true
  2857 + checkSDKPath("/libs/"); // returns false
  2858 +
  2859 +### [QString][QString] about() {: #context-static-about }
  2860 +
  2861 +Get a string with the name, version, and copyright of the project. This string is suitable for printing or terminal.
  2862 +
  2863 +* **function definition:**
  2864 +
  2865 + static QString about();
  2866 +
  2867 +* **parameters:** NONE
  2868 +* **output:** ([QString][QString]) Returns a string containing the name, version and copyright of the project
  2869 +* **example:**
  2870 +
  2871 + // Using OpenBR version 0.6.0
  2872 + Context::about(); // returns "OpenBR 0.6.0 Copyright (c) 2013 OpenBiometrics. All rights reserved."
  2873 +
  2874 +### [QString][QString] version() {: #context-static-version }
  2875 +
  2876 +Get the version of the SDK.
  2877 +
  2878 +* **function definition:**
  2879 +
  2880 + static QString version();
  2881 +
  2882 +* **parameters:** NONE
  2883 +* **output:** ([QString][QString]) Returns a string containing the version of the OpenBR SDK. The string has the format *<MajorVersion\>*\.*<MinorVersion\>*\.*<PatchVersion\>*
  2884 +* **example:**
  2885 +
  2886 + // Using OpenBR version 0.6.0
  2887 + Context::version(); // returns "0.6.0"
  2888 +
  2889 +### [QString][QString] scratchPath() {: #context-static-scratchpath }
  2890 +
  2891 +Get the scratch directory used by OpenBR. This directory should be used as the root directory for managing temporary files and providing process persistence.
  2892 +
  2893 +* **function definition:**
  2894 +
  2895 + static QString scratchPath();
  2896 +
  2897 +* **parameters:** NONE
  2898 +* **output:** ([QString][QString]) Returns a string pointing to the OpenBR scratch directory. The string has the format *<path/to/user/home\><OpenBR-\><MajorVersion\>*\.*<MinorVersion\>*.
  2899 +* **see:** [version](#context-static-version)
  2900 +* **example:**
  2901 +
  2902 + // Using OpenBR version 0.6.0
  2903 + Context::scratchPath(); // returns "/path/to/user/home/OpenBR-0.6"
  2904 +
  2905 +### [QStringList][QStringList] objects(const char \*abstractions = ".\*", const char \*implementations = ".\*", bool parameters = true) {: #context-static-objects }
  2906 +
  2907 +Get a collection of objects in OpenBR that match provided regular expressions. This function uses [QRegExp][QRegExp] syntax.
  2908 +
  2909 +* **function definition:**
  2910 +
  2911 + static QStringList objects(const char *abstractions = ".*", const char *implementations = ".*", bool parameters = true)
  2912 +
  2913 +* **parameters:**
  2914 +
  2915 + Parameter | Type | Description
  2916 + --- | --- | ---
  2917 + abstractions | const char \* | (Optional) Regular expression of the abstractions to search. Default is ".\*"
  2918 + implementations | const char \* | (Optional) Regular expression of the implementations to search. Default is ".\*".
  2919 + parameters | bool | (Optional) If true include parameters after object name. Default is true.
  2920 +
  2921 +* **output:** ([QStringList][QStringList]) Return names and parameters for the requested objects. Each object is newline separated. Arguments are separated from the object name with tabs.
  2922 +* **example:**
  2923 +
  2924 + // Find all 'Rnd' Transforms
  2925 + Context::objects("Transform", "Rnd.*", false); // returns ["RndPoint", "RndRegion", "RndRotate", "RndSample", "RndSubspace"]
  2926 +
  2927 +<!-- no italics* -->
  2928 +
  2929 +---
  2930 +
  2931 +## Functions {: #context-functions }
  2932 +
  2933 +
  2934 +### bool contains(const [QString][QString] &name) {: #context-function-contains }
  2935 +
  2936 +Check if a property exists in the [global metadata](#context).
  2937 +
  2938 +* **function definition:**
  2939 +
  2940 + bool contains(const QString &name);
  2941 +
  2942 +* **parameters:**
  2943 +
  2944 + Parameter | Type | Description
  2945 + --- | --- | ---
  2946 + name | const [QString][QString] & | [Metadata](#context) key. It must be queryable using [QObject::property][QObject::property].
  2947 +
  2948 +* **output:** (bool) Returns true if the provided key is a global property.
  2949 +* **see:** [setProperty](#context-function-setproperty)
  2950 +* **example:**
  2951 +
  2952 + Globals->contains("path"); // returns true
  2953 + Globals->contains("key"); // returns false
  2954 +
  2955 +
  2956 +### void setProperty(const [QString][QString] &key, const [QString][QString] &value) {: #context-function-setproperty }
  2957 +
  2958 +Set a global property.
  2959 +
  2960 +* **function definition:**
  2961 +
  2962 + void setProperty(const QString &key, const QString &value)
  2963 +
  2964 +* **parameters:**
  2965 +
  2966 + Parameter | Type | Description
  2967 + --- | --- | ---
  2968 + key | const [QString][QString] & | [Metadata](#context) key
  2969 + value | const [QString][QString] & | Value to be added to the [Metadata](#context)
  2970 +
  2971 +* **output:** (void)
  2972 +* **see:** [contains](#context-function-contains)
  2973 +* **example:**
  2974 +
  2975 + Globals->contains("key"); // returns false
  2976 + Globals->setProperty("key", "value");
  2977 + Globals->contains("key"); // returns true
  2978 +
  2979 +
  2980 +### void printStatus() {: #context-function-printstatus }
  2981 +
  2982 +Prints the current progress statistics to **stdout**.
  2983 +
  2984 +* **function definition:**
  2985 +
  2986 +void printStatus();
  2987 +
  2988 +* **parameters:** NONE
  2989 +* **output:** (void)
  2990 +* **see:** [progress](#context-function-progress)
  2991 +* **example:**
  2992 +
  2993 + Globals->printStatus(); // returns 00.00% ELAPSED=00:00:00 REMAINING=99:99:99 COUNT=0
  2994 +
  2995 +
  2996 +### int timeRemaining() const {: #context-function-timeremaining }
  2997 +
  2998 +Get the time remaining in seconds of a call to [Train](#function-train), [Enroll](#function-enroll-1) or [Compare](#function-compare).
  2999 +
  3000 +* **function defintion:**
  3001 +
  3002 + int timeRemaining() const;
  3003 +
  3004 +* **parameters:** NONE
  3005 +* **output:** (int) Returns the estimated time remaining in the currently running process. If not process is running returns -1.
  3006 +
  3007 +### float progress() {: #context-function-progress }
  3008 +
  3009 +Get the completion percentage of a call to [Train](#function-train), [Enroll](#function-enroll-1), or [Compare](#function-compare).
  3010 +
  3011 +* **function definition:**
  3012 +
  3013 + float progress() const;
  3014 +
  3015 +* **parameters:** NONE
  3016 +* **output:** (float) Returns the fraction of the currently running job that has been completed.
  3017 +
  3018 +---
  3019 +
  3020 +# Initializer
  3021 +
  3022 +Inherits [Object](#object)
  3023 +
  3024 +Plugin base class for initializing resources. On startup (the call to [Context](#context)::(initialize)(#context-static-initialize)), OpenBR will call [initialize](#initializer-function-initialize) on every Initializer that has been registered with the [Factory](#factory). On shutdown (the call to [Context](#context)::(finalize)(#context-static-finalize)), OpenBR will call [finalize](#initializer-function-finalize) on every registered initializer.
  3025 +
  3026 +The general use case for initializers is to launch shared contexts for third party integrations into OpenBR. These cannot be launched during [Transform](#transform)::(init)(#transform-function-init) for example, because multiple instances of the [Transform](#transform) object could exist across multiple threads.
  3027 +
  3028 +## Members {: #initializer-members }
  3029 +
  3030 +NONE
  3031 +
  3032 +## Constructors {: #initializer-constructors }
  3033 +
  3034 +Destructor | Description
  3035 +--- | ---
  3036 +virtual ~Initializer() | Virtual function. Default destructor.
  3037 +
  3038 +## Static Functions {: #initializer-static-functions }
  3039 +
  3040 +NONE
  3041 +
  3042 +## Functions {: #initializer-functions }
  3043 +
  3044 +### virtual void initialize() const {: #initializer-function-initialize }
  3045 +
  3046 +Initialize
  3047 +
  3048 +* **function definition:**
  3049 +
  3050 + virtual void initialize() const = 0
  3051 +
  3052 +---
  3053 +
  3054 +# Transform
  3055 +
  3056 +Inherits [Object](#object)
  3057 +
  3058 +---
  3059 +
  3060 +# UntrainableTransform
  3061 +
  3062 +Inherits [Object](#object)
  3063 +
  3064 +---
  3065 +
  3066 +# MetaTransform
  3067 +
  3068 +Inherits [Object](#object)
  3069 +
  3070 +---
  3071 +
  3072 +# UntrainableMetaTransform
  3073 +
  3074 +Inherits [Object](#object)
  3075 +
  3076 +---
  3077 +
  3078 +# MetadataTransform
  3079 +
  3080 +Inherits [Object](#object)
  3081 +
  3082 +---
  3083 +
  3084 +# UntrainableMetadataTransform
  3085 +
  3086 +Inherits [Object](#object)
  3087 +
  3088 +---
  3089 +
  3090 +# TimeVaryingTransform
  3091 +
  3092 +Inherits [Object](#object)
  3093 +
  3094 +---
  3095 +
  3096 +# Distance
  3097 +
  3098 +Inherits [Object](#object)
  3099 +
  3100 +---
  3101 +
  3102 +# UntrainableDistance
  3103 +
  3104 +Inherits [Object](#object)
  3105 +
  3106 +---
  3107 +
  3108 +# Output
  3109 +
  3110 +Inherits from [Object](#object)
  3111 +
  3112 +## Properties {: #output-properties }
  3113 +
  3114 +Property | Type | Description
  3115 +--- | --- | ---
  3116 +<a class="table-anchor" id=output-properties-blockrows></a>blockRows | int | DOCUMENT ME
  3117 +<a class="table-anchor" id=output-properties-blockcols></a>blockCols | int | DOCUMENT ME
  3118 +
  3119 +## Members {: #output-members }
  3120 +
  3121 +Member | Type | Description
  3122 +--- | --- | ---
  3123 +<a class="table-anchor" id=output-members-targetfiles></a>targetFiles | [FileList][#filelist] | DOCUMENT ME
  3124 +<a class="table-anchor" id=output-members-queryfiles></a>queryFiles | [FileList](#filelist) | DOCUMENT ME
  3125 +<a class="table-anchor" id=output-members-selfsimilar></a>selfSimilar | bool | DOCUMENT ME
  3126 +<a class="table-anchor" id=output-members-next></a>next | [QSharedPointer][QSharedPointer]<[Output](#output)> | DOCUMENT ME
  3127 +<a class="table-anchor" id=output-members-offset></a>offset | [QPoint][QPoint] | DOCUMENT ME
  3128 +
  3129 +## Constructors {: #output-constructors }
  3130 +
  3131 +Constructor \| Destructor | Description
  3132 +--- | ---
  3133 +virtual ~Output() | DOCUMENT ME
  3134 +
  3135 +## Static Functions {: #output-static-functions }
  3136 +
  3137 +### Output \*make(const [File][#file] &file, const [FileList](#filelist) &targetFiles, const [FileList](#filelist) &queryFiles) {: #output-function-make}
  3138 +
  3139 +DOCUMENT ME
  3140 +
  3141 +* **function definition:**
  3142 +
  3143 + static Output *make(const File &file, const FileList &targetFiles, const FileList &queryFiles)
  3144 +
  3145 +* **parameters:**
  3146 +
  3147 + Parameter | Type | Description
  3148 + --- | --- | ---
  3149 + file | const [File](#file) & | DOCUMENT ME
  3150 + targetFiles | const [FileList](#filelist) & | DOCUMENT ME
  3151 + queryFiles | const [FileList](#filelist) & | DOCUMENT ME
  3152 +
  3153 +* **output:** ([Output](#output)) DOCUMENT ME
  3154 +
  3155 +
  3156 +## Functions {: #output-functions }
  3157 +
  3158 +### virtual void initialize(const [FileList](#filelist) &targetFiles, const [FileList](#filelist) &queryFiles) {: #output-function-initialize }
  3159 +
  3160 +DOCUMENT ME
  3161 +
  3162 +* **function definition:**
  3163 +
  3164 + virtual void initialize(const [FileList](#filelist) &targetFiles, const [FileList](#filelist) &queryFiles)
  3165 +
  3166 +* **parameters:**
  3167 +
  3168 + Parameter | Type | Description
  3169 + --- | --- | ---
  3170 + targetFiles | const [FileList](#filelist) & | DOCUMENT ME
  3171 + queryFiles | const [FileList](#filelist) & | DOCUMENT ME
  3172 +
  3173 +* **output:** (void) DOCUMENT ME
  3174 +
  3175 +
  3176 +### virtual void setBlock(int rowBlock, int columnBlock) {: #output-function-setblock }
  3177 +
  3178 +DOCUMENT ME
  3179 +
  3180 +* **function definition:**
  3181 +
  3182 + virtual void setBlock(int rowBlock, int columnBlock)
  3183 +
  3184 +* **parameters:**
  3185 +
  3186 + Parameter | Type | Description
  3187 + --- | --- | ---
  3188 + rowBlock | int | DOCUMENT ME
  3189 + columnBlock | int | DOCUMENT ME
  3190 +
  3191 +* **output:** (void) DOCUMENT ME
  3192 +
  3193 +
  3194 +### virtual void setRelative(float value, int i, int j) {: #output-function-setrelative }
  3195 +
  3196 +DOCUMENT ME
  3197 +
  3198 +* **function definition:**
  3199 +
  3200 + virtual void setRelative(float value, int i, int j)
  3201 +
  3202 +* **parameters:**
  3203 +
  3204 + Parameter | Type | Description
  3205 + --- | --- | ---
  3206 + value | float | DOCUMENT ME
  3207 + i | int | DOCUMENT ME
  3208 + j | int | DOCUMENT ME
  3209 +
  3210 +* **output:** (void) DOCUMENT ME
  3211 +
  3212 +
  3213 +### virtual void set(float value, int i, int j) = 0 {: #output-function-set }
  3214 +
  3215 +DOCUMENT ME
  3216 +
  3217 +* **function definition:**
  3218 +
  3219 + virtual void set(float value, int i, int j) = 0
  3220 +
  3221 +* **parameters:**
  3222 +
  3223 + Parameter | Type | Description
  3224 + --- | --- | ---
  3225 + value | float | DOCUMENT ME
  3226 + i | int | DOCUMENT ME
  3227 + j | int | DOCUMENT ME
  3228 +
  3229 +* **output:** (void) DOCUMENT ME
  3230 +
  3231 +---
  3232 +
  3233 +# MatrixOutput
  3234 +
  3235 +Inherits [Object](#object)
  3236 +
  3237 +---
  3238 +
  3239 +# Format
  3240 +
  3241 +Inherits [Object](#object)
  3242 +
  3243 +---
  3244 +
  3245 +# Gallery
  3246 +
  3247 +Inherits [Object](#object)
  3248 +
  3249 +---
  3250 +
  3251 +# FileGallery
  3252 +
  3253 +Inherits [Object](#object)
  3254 +
  3255 +---
  3256 +
  3257 +# Representation
  3258 +
  3259 +Inherits [Object](#object).
  3260 +
  3261 +---
  3262 +
  3263 +# Classifier
  3264 +
  3265 +Inherits [Object](#object)
  3266 +
  3267 +[Qt]: http://qt-project.org/ "Qt"
  3268 +[QApplication]: http://doc.qt.io/qt-5/qapplication.html "QApplication"
  3269 +[QCoreApplication]: http://doc.qt.io/qt-5/qcoreapplication.html "QCoreApplication"
  3270 +
  3271 +[QString]: http://doc.qt.io/qt-5/QString.html "QString"
  3272 +[QStringList]: http://doc.qt.io/qt-5/qstringlist.html "QStringList"
  3273 +
  3274 +[QList]: http://doc.qt.io/qt-5/QList.html "QList"
  3275 +[QMap]: http://doc.qt.io/qt-5/qmap.html "QMap"
  3276 +[QHash]: http://doc.qt.io/qt-5/qhash.html "QHash"
  3277 +
  3278 +[QRectF]: http://doc.qt.io/qt-5/qrectf.html "QRectF"
  3279 +[QPoint]: http://doc.qt.io/qt-5/qpoint.html "QPoint"
  3280 +[QPointF]: http://doc.qt.io/qt-5/qpointf.html "QPointF"
  3281 +
  3282 +[QVariant]: http://doc.qt.io/qt-5/qvariant.html "QVariant"
  3283 +[QVariantList]: http://doc.qt.io/qt-5/qvariant.html#QVariantList-typedef "QVariantList"
  3284 +[QVariantMap]: http://doc.qt.io/qt-5/qvariant.html#QVariantMap-typedef "QVariantMap"
  3285 +
  3286 +[QRegExp]: http://doc.qt.io/qt-5/QRegExp.html "QRegExp"
  3287 +[QThread]: http://doc.qt.io/qt-5/qthread.html "QThread"
  3288 +[QFile]: http://doc.qt.io/qt-5/qfile.html "QFile"
  3289 +
  3290 +[QSharedPointer]: http://doc.qt.io/qt-5/qsharedpointer.html "QSharedPointer"
1328 3291  
  3292 +[QTime]: http://doc.qt.io/qt-5/QTime.html "QTime"
1329 3293 [QDebug]: http://doc.qt.io/qt-5/qdebug.html "QDebug"
1330 3294 [QDataStream]: http://doc.qt.io/qt-5/qdatastream.html "QDataStream"
1331 3295 [QByteArray]: http://doc.qt.io/qt-5/qbytearray.html "QByteArray"
... ...
docs/docs/docs/plugins/classification.md
... ... @@ -8,10 +8,10 @@ Wraps OpenCV&#39;s Ada Boost framework
8 8 * **author:** Scott Klum
9 9 * **properties:**
10 10  
11   -Name | Type | Description
  11 +Property | Type | Description
12 12 --- | --- | ---
13   -type | enum | Type of Adaboost to perform. Options are Discrete, Real, Logit, and Gentle. Default is Real.
14   -splitCriteria | enum | Splitting criteria used to choose optimal splits during a weak tree construction. Options are Default, Gini, Misclass, Sqerr. Default is Default.
  13 +type | enum | Type of Adaboost to perform. Options are:<ul><li>Discrete</li><li>Real</li><li>Logit</li><li>Gentle</li></ul>Default is Real.
  14 +splitCriteria | enum | Splitting criteria used to choose optimal splits during a weak tree construction. Options are:<ul><li>Default</li><li>Gini</li><li>Misclass</li><li>Sqerr</li></ul>Default is Default.
15 15 weakCount | int | Maximum number of weak classifiers per stage. Default is 100.
16 16 trimRate | float | A threshold between 0 and 1 used to save computational time. Samples with summary weight
17 17 folds | int | OpenCV parameter variable. Default value is 0.
... ... @@ -32,7 +32,7 @@ Computes Distance From Feature Space (DFFS)
32 32 * **author:** Josh Klontz
33 33 * **properties:**
34 34  
35   -Name | Type | Description
  35 +Property | Type | Description
36 36 --- | --- | ---
37 37 keep | float | Sets PCA keep property. Default is 0.95.
38 38  
... ... @@ -44,11 +44,11 @@ Face Recognition Using Early Biologically Inspired Features
44 44  
45 45 * **file:** classification/ebif.cpp
46 46 * **inherits:** [UntrainableTransform](../cpp_api.md#untrainabletransform)
47   -* **see:** [Min Li (IBM China Research Lab, China), Nalini Ratha (IBM Watson Research Center, USA), Weihong Qian (IBM China Research Lab, China), Shenghua Bao (IBM China Research Lab, China), Zhong Su (IBM China Research Lab, China)](Min Li (IBM China Research Lab, China), Nalini Ratha (IBM Watson Research Center, USA), Weihong Qian (IBM China Research Lab, China), Shenghua Bao (IBM China Research Lab, China), Zhong Su (IBM China Research Lab, China))
  47 +* **see:** [Min Li (IBM China Research Lab, China), Nalini Ratha (IBM Watson Research Center, USA), Weihong Qian (IBM China Research Lab, China), Shenghua Bao (IBM China Research Lab, China), Zhong Su (IBM China Research Lab, China)](#min li (ibm china research lab, china), nalini ratha (ibm watson research center, usa), weihong qian (ibm china research lab, china), shenghua bao (ibm china research lab, china), zhong su (ibm china research lab, china))
48 48 * **author:** Josh Klontz
49 49 * **properties:**
50 50  
51   -Name | Type | Description
  51 +Property | Type | Description
52 52 --- | --- | ---
53 53 N | int | The number of scales. Default is 6.
54 54 M | int | The number of orientations between 0 and pi. Default is 9.
... ... @@ -60,12 +60,12 @@ M | int | The number of orientations between 0 and pi. Default is 9.
60 60 Wraps OpenCV's random trees framework to induce features
61 61  
62 62 * **file:** classification/forest.cpp
63   -* **inherits:** [ForestTransform](../cpp_api.md#foresttransform)
  63 +* **inherits:** [ForestTransform](#foresttransform)
64 64 * **see:** [https://lirias.kuleuven.be/bitstream/123456789/316661/1/icdm11-camready.pdf](https://lirias.kuleuven.be/bitstream/123456789/316661/1/icdm11-camready.pdf)
65 65 * **author:** Scott Klum
66 66 * **properties:**
67 67  
68   -Name | Type | Description
  68 +Property | Type | Description
69 69 --- | --- | ---
70 70 useRegressionValue | bool | SCOTT FILL ME IN.
71 71  
... ... @@ -81,7 +81,7 @@ Wraps OpenCV&#39;s random trees framework
81 81 * **author:** Scott Klum
82 82 * **properties:**
83 83  
84   -Name | Type | Description
  84 +Property | Type | Description
85 85 --- | --- | ---
86 86 classification | bool | If true the labels are expected to be categorical. Otherwise they are expected to be numerical. Default is true.
87 87 splitPercentage | float | Used to calculate the minimum number of samples per split in a random tree. The minimum number of samples is calculated as the number of samples x splitPercentage. Default is 0.01.
... ... @@ -118,7 +118,7 @@ Projects input into learned Linear Discriminant Analysis subspace.
118 118 * **authors:** Brendan Klare, Josh Klontz
119 119 * **properties:**
120 120  
121   -Name | Type | Description
  121 +Property | Type | Description
122 122 --- | --- | ---
123 123 pcaKeep | float | BRENDAN OR JOSH FILL ME IN. Default is 0.98.
124 124 pcaWhiten | bool | BRENDAN OR JOSH FILL ME IN. Default is false.
... ... @@ -140,7 +140,7 @@ Wraps OpenCV&#39;s multi-layer perceptron framework
140 140 * **author:** Scott Klum
141 141 * **properties:**
142 142  
143   -Name | Type | Description
  143 +Property | Type | Description
144 144 --- | --- | ---
145 145 kernel | enum | Type of MLP kernel to use. Options are Identity, Sigmoid, Gaussian. Default is Sigmoid.
146 146 alpha | float | Determines activation function for neural network. See OpenCV documentation for more details. Default is 1.
... ... @@ -208,9 +208,9 @@ Projects input into learned Principal Component Analysis subspace.
208 208 * **authors:** Brendan Klare, Josh Klontz
209 209 * **properties:**
210 210  
211   -Name | Type | Description
  211 +Property | Type | Description
212 212 --- | --- | ---
213   -keep | float | Default is 0.95. If (keep < 0) then all eigenvalues are retained. If (keep = 0) then no PCA is performed and the eigenvectors form an identity matrix. If (0 < keep < 1) then keep is the fraction of the variance to retain. If (keep >= 1) then keep is the number of leading eigenvectors to retain.
  213 +keep | float | Options are:<ul><li>keep < 0 - All eigenvalues are retained</li><li>keep == 0 - No PCA is performed and the eigenvectors form an identity matrix</li><li>0 < keep < 1 - Keep is the fraction of the variance to retain</li><li>keep >= 1 - keep is the number of leading eigenvectors to retain</li></ul>Default is 0.95.
214 214 drop | int | BRENDAN OR JOSH FILL ME IN. Default is 0.
215 215 whiten | bool | BRENDAN OR JOSH FILL ME IN. Default is false.
216 216  
... ... @@ -221,7 +221,7 @@ whiten | bool | BRENDAN OR JOSH FILL ME IN. Default is false.
221 221 Compare faces using PittPatt 4.
222 222  
223 223 * **file:** classification/pp4.cpp
224   -* **inherits:** [Distance,](../cpp_api.md#distance,)
  224 +* **inherits:** [Distance](../cpp_api.md#distance)
225 225 * **author:** Josh Klontz
226 226 * **properties:** None
227 227  
... ... @@ -237,7 +237,7 @@ Enroll faces in PittPatt 4
237 237 * **author:** Josh Klontz
238 238 * **properties:**
239 239  
240   -Name | Type | Description
  240 +Property | Type | Description
241 241 --- | --- | ---
242 242 detectOnly | bool | If true, return all detected faces. Otherwise, return only faces that are suitable for recognition. Default is false.
243 243  
... ... @@ -264,7 +264,7 @@ Enroll faces in PP5
264 264 * **authors:** Josh Klontz, E. Taborsky
265 265 * **properties:**
266 266  
267   -Name | Type | Description
  267 +Property | Type | Description
268 268 --- | --- | ---
269 269 detectOnly | bool | If true, enroll all detected faces. Otherwise, only enroll faces suitable for recognition. Default is false.
270 270 requireLandmarks | bool | If true, require the right eye, left eye, and nose base to be detectable by PP5. If this does not happen FTE is set to true for that template. Default is false.
... ... @@ -280,7 +280,7 @@ searchPruningAggressiveness | int | The amount of aggressiveness involved in sea
280 280 PCA on each row.
281 281  
282 282 * **file:** classification/lda.cpp
283   -* **inherits:** [PCATransform](../cpp_api.md#pcatransform)
  283 +* **inherits:** [PCATransform](#pcatransform)
284 284 * **author:** Josh Klontz
285 285 * **properties:** None
286 286  
... ... @@ -301,7 +301,7 @@ Wraps OpenCV&#39;s SVM framework.
301 301 * **author:** Josh Klontz
302 302 * **properties:**
303 303  
304   -Name | Type | Description
  304 +Property | Type | Description
305 305 --- | --- | ---
306 306 Kernel | enum | The type of SVM kernel to use. Options are Linear, Poly, RBF, Sigmoid. Default is Linear.
307 307 Type | enum | The type of SVM to do. Options are C_SVC, NU_SVC, ONE_CLASS, EPS_SVR, NU_SVR. Default is C_SVC.
... ... @@ -325,7 +325,7 @@ Projects input into learned Linear Discriminant Analysis subspace learned on a s
325 325 * **author:** Brendan Klare
326 326 * **properties:**
327 327  
328   -Name | Type | Description
  328 +Property | Type | Description
329 329 --- | --- | ---
330 330 varThreshold | float | BRENDAN FILL ME IN. Default is 1.5.
331 331 pcaKeep | float | BRENDAN FILL ME IN. Default is 0.98.
... ... @@ -342,10 +342,10 @@ Convenience class for training turk attribute regressors
342 342 * **author:** Josh Klontz
343 343 * **properties:**
344 344  
345   -Name | Type | Description
  345 +Property | Type | Description
346 346 --- | --- | ---
347 347 key | QString | Metadata key to pass input values to SVM. Actual lookup key is "key_value" where value is each value in the parameter values. Default is "".
348   -values | QStringList | Metadata keys to pass input values to SVM. Actual lookup key is "key_value" where key is the parameter key and value is each value in this list. Each passed value trains a new SVM with the input values found in metadata["key_value"]. Default is "".
  348 +values | QStringList | Metadata keys to pass input values to SVM. Actual lookup key is "key_value" where key is the parameter key and value is each value in this list. Each passed value trains a new SVM with the input values found in metadata<ul><li>"key_value"</li></ul>. Default is "".
349 349 isMeta | bool | If true, "Average+SaveMat(predicted_key_value)" is appended to each classifier. If false, nothing is appended. Default is false.
350 350  
351 351 ---
... ...
docs/docs/docs/plugins/cluster.md
... ... @@ -5,8 +5,11 @@ Collect nearest neighbors and append them to metadata.
5 5 * **file:** cluster/collectnn.cpp
6 6 * **inherits:** [UntrainableMetaTransform](../cpp_api.md#untrainablemetatransform)
7 7 * **author:** Charles Otto
8   -* **properties:** None
  8 +* **properties:**
9 9  
  10 +Property | Type | Description
  11 +--- | --- | ---
  12 +keep | int | The maximum number of nearest neighbors to keep. Default is 20.
10 13  
11 14 ---
12 15  
... ... @@ -16,9 +19,14 @@ Wraps OpenCV kmeans and flann.
16 19  
17 20 * **file:** cluster/kmeans.cpp
18 21 * **inherits:** [Transform](../cpp_api.md#transform)
  22 +* **see:** [http://docs.opencv.org/modules/flann/doc/flann_fast_approximate_nearest_neighbor_search.html](http://docs.opencv.org/modules/flann/doc/flann_fast_approximate_nearest_neighbor_search.html)
19 23 * **author:** Josh Klontz
20   -* **properties:** None
  24 +* **properties:**
21 25  
  26 +Property | Type | Description
  27 +--- | --- | ---
  28 +kTrain | int | The number of random centroids to make at train time. Default is 256.
  29 +kSearch | int | The number of nearest neighbors to search for at runtime. Default is 1.
22 30  
23 31 ---
24 32  
... ... @@ -41,8 +49,11 @@ Log nearest neighbors to specified file.
41 49 * **file:** cluster/lognn.cpp
42 50 * **inherits:** [TimeVaryingTransform](../cpp_api.md#timevaryingtransform)
43 51 * **author:** Charles Otto
44   -* **properties:** None
  52 +* **properties:**
45 53  
  54 +Property | Type | Description
  55 +--- | --- | ---
  56 +fileName | QString | The name of the log file. An empty fileName won't be written to. Default is "".
46 57  
47 58 ---
48 59  
... ... @@ -52,10 +63,14 @@ Chooses k random points to be centroids.
52 63  
53 64 * **file:** cluster/randomcentroids.cpp
54 65 * **inherits:** [Transform](../cpp_api.md#transform)
55   -* **see:** [KMeansTransform](KMeansTransform)
  66 +* **see:** [http://docs.opencv.org/modules/flann/doc/flann_fast_approximate_nearest_neighbor_search.html](http://docs.opencv.org/modules/flann/doc/flann_fast_approximate_nearest_neighbor_search.html)
56 67 * **author:** Austin Blanton
57   -* **properties:** None
  68 +* **properties:**
58 69  
  70 +Property | Type | Description
  71 +--- | --- | ---
  72 +kTrain | int | The number of random centroids to make at train time. Default is 256.
  73 +kSearch | int | The number of nearest neighbors to search for at runtime. Default is 1.
59 74  
60 75 ---
61 76  
... ...
docs/docs/docs/plugins/core.md
... ... @@ -40,7 +40,7 @@ Removes all template&#39;s matrices.
40 40  
41 41 * **file:** core/discard.cpp
42 42 * **inherits:** [UntrainableMetaTransform](../cpp_api.md#untrainablemetatransform)
43   -* **see:** [IdentityTransform FirstTransform RestTransform RemoveTransform](IdentityTransform FirstTransform RestTransform RemoveTransform)
  43 +* **see:** [IdentityTransform FirstTransform RestTransform RemoveTransform](#identitytransform firsttransform resttransform removetransform)
44 44 * **author:** Josh Klontz
45 45 * **properties:** None
46 46  
... ... @@ -53,7 +53,7 @@ Performs an expansion step on input templatelists
53 53  
54 54 * **file:** core/expand.cpp
55 55 * **inherits:** [UntrainableMetaTransform](../cpp_api.md#untrainablemetatransform)
56   -* **see:** [PipeTransform](PipeTransform)
  56 +* **see:** [PipeTransform](#pipetransform)
57 57 * **author:** Josh Klontz
58 58 * **properties:** None
59 59  
... ... @@ -78,7 +78,7 @@ Removes all but the first matrix from the template.
78 78  
79 79 * **file:** core/first.cpp
80 80 * **inherits:** [UntrainableMetaTransform](../cpp_api.md#untrainablemetatransform)
81   -* **see:** [IdentityTransform DiscardTransform RestTransform RemoveTransform](IdentityTransform DiscardTransform RestTransform RemoveTransform)
  81 +* **see:** [IdentityTransform DiscardTransform RestTransform RemoveTransform](#identitytransform discardtransform resttransform removetransform)
82 82 * **author:** Josh Klontz
83 83 * **properties:** None
84 84  
... ... @@ -90,8 +90,8 @@ Removes all but the first matrix from the template.
90 90 Transforms in parallel.
91 91  
92 92 * **file:** core/fork.cpp
93   -* **inherits:** [CompositeTransform](../cpp_api.md#compositetransform)
94   -* **see:** [PipeTransform](PipeTransform)
  93 +* **inherits:** [CompositeTransform](#compositetransform)
  94 +* **see:** [PipeTransform](#pipetransform)
95 95 * **author:** Josh Klontz
96 96 * **properties:** None
97 97  
... ... @@ -116,7 +116,7 @@ A no-op transform.
116 116  
117 117 * **file:** core/identity.cpp
118 118 * **inherits:** [UntrainableMetaTransform](../cpp_api.md#untrainablemetatransform)
119   -* **see:** [DiscardTransform FirstTransform RestTransform RemoveTransform](DiscardTransform FirstTransform RestTransform RemoveTransform)
  119 +* **see:** [DiscardTransform FirstTransform RestTransform RemoveTransform](#discardtransform firsttransform resttransform removetransform)
120 120 * **author:** Josh Klontz
121 121 * **properties:** None
122 122  
... ... @@ -164,7 +164,7 @@ Caches transform training.
164 164 Transforms in series.
165 165  
166 166 * **file:** core/pipe.cpp
167   -* **inherits:** [CompositeTransform](../cpp_api.md#compositetransform)
  167 +* **inherits:** [CompositeTransform](#compositetransform)
168 168 * **see:**
169 169  
170 170 * [ExpandTransform](ExpandTransform)
... ... @@ -181,7 +181,7 @@ Transforms in series.
181 181 Interface to a separate process
182 182  
183 183 * **file:** core/processwrapper.cpp
184   -* **inherits:** [WrapperTransform](../cpp_api.md#wrappertransform)
  184 +* **inherits:** [WrapperTransform](#wrappertransform)
185 185 * **author:** Charles Otto
186 186 * **properties:** None
187 187  
... ... @@ -206,7 +206,7 @@ Removes the first matrix from the template.
206 206  
207 207 * **file:** core/rest.cpp
208 208 * **inherits:** [UntrainableMetaTransform](../cpp_api.md#untrainablemetatransform)
209   -* **see:** [IdentityTransform DiscardTransform FirstTransform RemoveTransform](IdentityTransform DiscardTransform FirstTransform RemoveTransform)
  209 +* **see:** [IdentityTransform DiscardTransform FirstTransform RemoveTransform](#identitytransform discardtransform firsttransform removetransform)
210 210 * **author:** Josh Klontz
211 211 * **properties:** None
212 212  
... ...
docs/docs/docs/plugins/format.md
... ... @@ -75,7 +75,7 @@ Likely matrix format
75 75 Reads a NIST BEE mask matrix.
76 76  
77 77 * **file:** format/mtx.cpp
78   -* **inherits:** [mtxFormat](../cpp_api.md#mtxformat)
  78 +* **inherits:** [mtxFormat](#mtxformat)
79 79 * **author:** Josh Klontz
80 80 * **properties:** None
81 81  
... ...
docs/docs/docs/plugins/gallery.md
  1 +# BinaryGallery
  2 +
  3 +An abstract gallery for handling binary data
  4 +
  5 +* **file:** gallery/binary.cpp
  6 +* **inherits:** [Gallery](../cpp_api.md#gallery)
  7 +* **author:** Unknown
  8 +* **properties:** None
  9 +
  10 +
  11 +---
  12 +
1 13 # DefaultGallery
2 14  
3 15 Treats the gallery as a br::Format.
... ... @@ -64,7 +76,7 @@ Treats each line as a file.
64 76  
65 77 * **file:** gallery/csv.cpp
66 78 * **inherits:** [FileGallery](../cpp_api.md#filegallery)
67   -* **see:** [txtGallery](txtGallery)
  79 +* **see:** [txtGallery](#txtgallery)
68 80 * **author:** Josh Klontz
69 81 * **properties:** None
70 82  
... ... @@ -100,7 +112,7 @@ Treats each line as a call to File::flat()
100 112 A binary gallery.
101 113  
102 114 * **file:** gallery/binary.cpp
103   -* **inherits:** [BinaryGallery](../cpp_api.md#binarygallery)
  115 +* **inherits:** [BinaryGallery](#binarygallery)
104 116 * **author:** Josh Klontz
105 117 * **properties:** None
106 118  
... ... @@ -124,7 +136,7 @@ Input from a google image search.
124 136 Newline-separated JSON objects.
125 137  
126 138 * **file:** gallery/binary.cpp
127   -* **inherits:** [BinaryGallery](../cpp_api.md#binarygallery)
  139 +* **inherits:** [BinaryGallery](#binarygallery)
128 140 * **author:** Josh Klontz
129 141 * **properties:** None
130 142  
... ... @@ -196,7 +208,7 @@ A gallery held in memory.
196 208 Read key frames of a .mp4 video file with LibAV
197 209  
198 210 * **file:** gallery/keyframes.cpp
199   -* **inherits:** [keyframesGallery](../cpp_api.md#keyframesgallery)
  211 +* **inherits:** [keyframesGallery](#keyframesgallery)
200 212 * **author:** Ben Klein
201 213 * **properties:** None
202 214  
... ... @@ -257,7 +269,7 @@ Treats each line as a file.
257 269  
258 270 * **file:** gallery/txt.cpp
259 271 * **inherits:** [FileGallery](../cpp_api.md#filegallery)
260   -* **see:** [csvGallery](csvGallery)
  272 +* **see:** [csvGallery](#csvgallery)
261 273 * **author:** Josh Klontz
262 274 * **properties:** None
263 275  
... ... @@ -269,7 +281,7 @@ Treats each line as a file.
269 281 Newline-separated URLs.
270 282  
271 283 * **file:** gallery/binary.cpp
272   -* **inherits:** [BinaryGallery](../cpp_api.md#binarygallery)
  284 +* **inherits:** [BinaryGallery](#binarygallery)
273 285 * **author:** Josh Klontz
274 286 * **properties:** None
275 287  
... ... @@ -281,7 +293,7 @@ Newline-separated URLs.
281 293 A contiguous array of br_universal_template.
282 294  
283 295 * **file:** gallery/binary.cpp
284   -* **inherits:** [BinaryGallery](../cpp_api.md#binarygallery)
  296 +* **inherits:** [BinaryGallery](#binarygallery)
285 297 * **author:** Josh Klontz
286 298 * **properties:** None
287 299  
... ...
docs/docs/docs/plugins/gui.md
... ... @@ -99,7 +99,7 @@ Renders metadata onto the image.
99 99 Elicits metadata for templates in a pretty GUI
100 100  
101 101 * **file:** gui/show.cpp
102   -* **inherits:** [ShowTransform](../cpp_api.md#showtransform)
  102 +* **inherits:** [ShowTransform](#showtransform)
103 103 * **author:** Scott Klum
104 104 * **properties:** None
105 105  
... ... @@ -135,7 +135,7 @@ Limits the frequency of projects going through this transform to the input targe
135 135 Manual select rectangular regions on an image.
136 136  
137 137 * **file:** gui/show.cpp
138   -* **inherits:** [ShowTransform](../cpp_api.md#showtransform)
  138 +* **inherits:** [ShowTransform](#showtransform)
139 139 * **author:** Charles Otto
140 140 * **properties:** None
141 141  
... ... @@ -147,7 +147,7 @@ Manual select rectangular regions on an image.
147 147 Manual selection of landmark locations
148 148  
149 149 * **file:** gui/show.cpp
150   -* **inherits:** [ShowTransform](../cpp_api.md#showtransform)
  150 +* **inherits:** [ShowTransform](#showtransform)
151 151 * **author:** Scott Klum
152 152 * **properties:** None
153 153  
... ... @@ -183,7 +183,7 @@ Displays templates in a GUI pop-up window using QT.
183 183 Display an image, and asks a yes/no question about it
184 184  
185 185 * **file:** gui/show.cpp
186   -* **inherits:** [ShowTransform](../cpp_api.md#showtransform)
  186 +* **inherits:** [ShowTransform](#showtransform)
187 187 * **author:** Charles Otto
188 188 * **properties:** None
189 189  
... ...
docs/docs/docs/plugins/imgproc.md
... ... @@ -579,7 +579,7 @@ Sliding window feature extraction from a multi-channel integral image.
579 579 Overloads SlidingWindowTransform for integral images that should be
580 580  
581 581 * **file:** imgproc/slidingwindow.cpp
582   -* **inherits:** [SlidingWindowTransform](../cpp_api.md#slidingwindowtransform)
  582 +* **inherits:** [SlidingWindowTransform](#slidingwindowtransform)
583 583 * **author:** Josh Klontz
584 584 * **properties:** None
585 585  
... ... @@ -775,7 +775,7 @@ Normalize matrix to unit length
775 775 * **author:** Josh Klontz
776 776 * **properties:**
777 777  
778   -Name | Type | Description
  778 +Property | Type | Description
779 779 --- | --- | ---
780 780 NormType | enum | Values are NORM_INF, NORM_L1, NORM_L2, NORM_MINMAX
781 781 ByRow | bool | If true normalize each row independently otherwise normalize the entire matrix.
... ...
docs/docs/index.md
1 1 # OpenBR ![Overview](img/openbr_48x48.png)
2 2  
3   -Open source, industry quality biometrics.
  3 +<p id=tagline>Open source, industry quality biometrics.</p>
4 4  
5 5 ---
6 6  
... ... @@ -35,7 +35,7 @@ OpenBR is supported on multiple operating systems. Please select yours from the
35 35 We have created a few tutorials to help teach you the basic principles of the OpenBR system. If this is your first time using OpenBR you should look at these before moving on to the more technical descriptions below.
36 36  
37 37 * [Quick Start](tutorials.md#quick-start)
38   -* [Training in OpenBR](tutorials.md#training-in-openbr)
  38 +* [Training in OpenBR](tutorials.md#training-algorithms)
39 39 * [Face Recognition](tutorials.md#face-recognition)
40 40 * [Age Estimation](tutorials.md#age-estimation)
41 41 * [Gender Estimation](tutorials.md#gender-estimation)
... ...
docs/docs/install.md
... ... @@ -13,7 +13,7 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
13 13  
14 14 $ sudo apt-get install cmake cmake-curses-gui
15 15  
16   -3. <a href="http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.5/opencv-2.4.5.tar.gz">Download OpenCV 2.4.5</a>, **note** <a href="https://github.com/biometrics/openbr/wiki/Build-OpenCV-with-Video-Support-on-Ubuntu">this</a>
  16 +3. [Download OpenCV 2.4.5](http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.5/opencv-2.4.5.tar.gz), **note** [Build OpenCV with video support](https://github.com/biometrics/openbr/wiki/Build-OpenCV-with-Video-Support-on-Ubuntu)
17 17  
18 18 $ cd ~/Downloads
19 19 $ tar -xf opencv-2.4.5.tar.gz
... ... @@ -31,7 +31,7 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
31 31  
32 32 $ sudo apt-get install qt5-default libqt5svg5-dev qtcreator
33 33  
34   -5. Create a <a href="github.com">GitHub</a> account, follow their instructions for <a href="https://help.github.com/articles/set-up-git">setting up Git</a>.
  34 +5. Create a [GitHub](https://github.com/) account, follow their instructions for [setting up Git](https://help.github.com/articles/set-up-git).
35 35  
36 36 $ git clone https://github.com/biometrics/openbr.git
37 37 $ cd openbr
... ... @@ -56,7 +56,7 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
56 56 3. Select "openbr/CMakeLists.txt" then "Open".
57 57 4. Browse to your pre-existing build directory "openbr/build" then select "Next".
58 58 5. Select "Run CMake" then "Finish".
59   - 6. You're all set! You can find more information on Qt Creator <a href="http://qt-project.org/doc/qtcreator">here</a> if you need.
  59 + 6. You're all set! You can find more information on Qt Creator [here](http://qt-project.org/doc/qtcreator) if you need it.
60 60  
61 61 8. (Optional) Test OpenBR!
62 62  
... ... @@ -72,19 +72,15 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
72 72  
73 73 10. (Optional) Build OpenBR documentation!
74 74  
75   - $ sudo apt-get install doxygen
76   - $ cd openbr/build
77   - $ cmake -DBR_BUILD_DOCUMENTATION=ON ..
78   - $ make -j4
79   - $ sudo apt-get install libgnome2-bin
80   - $ gnome-open html/index.html
  75 +Need to rewrite this step for the new docs!
81 76  
82 77 ---
83 78  
84 79 # OSX
85 80  
86   -1. Download and install the latest "Xcode" and "Command Line Tools" from the <a href="https://developer.apple.com/downloads/index.action#">Apple Developer Downloads</a> page.
87   - 1. <a href="http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz">Download CMake 2.8.11.2</a>
  81 +1. Download and install the latest "Xcode" and "Command Line Tools" from the [Apple Developer Downloads](https://developer.apple.com/downloads/index.action#) page.
  82 +
  83 +2. [Download CMake 2.8.11.2](http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz)
88 84  
89 85 $ cd ~/Downloads
90 86 $ tar -xf cmake-2.8.11.2.tar.gz
... ... @@ -95,7 +91,7 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
95 91 $ cd ..
96 92 $ rm -rf cmake-2.8.11.2*
97 93  
98   -2. <a href="http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.6.1/opencv-2.4.6.1.tar.gz">Download OpenCV 2.4.6.1</a>
  94 +3. [Download OpenCV 2.4.6.1](http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.6.1/opencv-2.4.6.1.tar.gz)
99 95  
100 96 $ cd ~/Downloads
101 97 $ tar -xf opencv-2.4.6.1.tar.gz
... ... @@ -108,9 +104,9 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
108 104 $ cd ../..
109 105 $ rm -rf opencv-2.4.6.1*
110 106  
111   -3. <a href="http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-mac-opensource-5.1.1-clang-offline.dmg">Download and install Qt 5.1.1</a>
  107 +4. [Download and install Qt 5.1.1](http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-mac-opensource-5.1.1-clang-offline.dmg)
112 108  
113   -4. Create a <a href="github.com">GitHub</a> account, follow their instructions for <a href="https://help.github.com/articles/set-up-git">setting up Git</a>.
  109 +5. Create a [GitHub](https://github.com/) account, follow their instructions for [setting up Git](https://help.github.com/articles/set-up-git).
114 110  
115 111 $ git clone https://github.com/biometrics/openbr.git
116 112 $ cd openbr
... ... @@ -118,7 +114,7 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
118 114 $ git submodule init
119 115 $ git submodule update
120 116  
121   -5. Build OpenBR!
  117 +6. Build OpenBR!
122 118  
123 119 $ mkdir build # from the OpenBR root directory
124 120 $ cd build
... ... @@ -126,7 +122,7 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
126 122 $ make -j4
127 123 $ sudo make install
128 124  
129   -6. Hack OpenBR!
  125 +7. Hack OpenBR!
130 126 1. Open Qt Creator IDE
131 127  
132 128 $ open ~/Qt5.1.1/Qt\ Creator.app
... ... @@ -135,9 +131,9 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
135 131 3. Select "openbr/CMakeLists.txt" then "Open".
136 132 4. Browse to your pre-existing build directory "openbr/build" then select "Continue".
137 133 5. Select "Run CMake" then "Done".
138   - 6. You're all set! You can find more information on Qt Creator <a href="http://qt-project.org/doc/qtcreator">here</a> if you need.
  134 + 6. You're all set! You can find more information on Qt Creator [here](http://qt-project.org/doc/qtcreator) if you need it.
139 135  
140   -7. (Optional) Test OpenBR!
  136 +8. (Optional) Test OpenBR!
141 137  
142 138 $ cd openbr/scripts
143 139 $ ./downloadDatasets.sh
... ... @@ -145,47 +141,31 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
145 141 $ make test
146 142  
147 143  
148   -8. (Optional) Package OpenBR!
  144 +9. (Optional) Package OpenBR!
149 145  
150 146 $ cd openbr/build
151 147 $ sudo cpack -G TGZ
152 148  
153 149  
154   -9. (Optional) Build OpenBR documentation!
155   - 1. <a href="ftp://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.5.src.tar.gz">Download Doxygen 1.8.5</a>
156   -
157   - $ cd ~/Downloads
158   - $ tar -xf doxygen-1.8.5.src.tar.gz
159   - $ cd doxygen-1.8.5
160   - $ ./configure
161   - $ make -j4
162   - $ sudo make install
163   - $ cd ..
164   - $ rm -rf doxygen-1.8.5*
165   -
166   -
167   - 2. Modify build settings and recompile.
  150 +10. (Optional) Build OpenBR documentation!
168 151  
169   - $ cd openbr/build
170   - $ cmake -DBR_BUILD_DOCUMENTATION=ON ..
171   - $ make -j4
172   - $ open html/index.html
  152 +Need to remake this step with the new docs!
173 153  
174 154 ---
175 155  
176 156 # Windows
177 157  
178   -1. <a href="http://www.microsoft.com/en-us/download/details.aspx?id=34673">Download Visual Studio 2012 Express Edition for Windows Desktop</a> and install.
179   - 1. Consider the free open source program <a href="http://wincdemu.sysprogs.org">WinCDEmu</a> if you need a program to mount ISO images.
  158 +1. [Download Visual Studio 2012 Express Edition for Windows Desktop](http://www.microsoft.com/en-us/download/details.aspx?id=34673) and install.
  159 + 1. Consider the free open source program [WinCDEmu](http://wincdemu.sysprogs.org) if you need a program to mount ISO images.
180 160 2. You will have to register with Microsoft after installation, but it's free.
181   - 3. Grab any available <a href="http://www.microsoft.com/visualstudio/eng/downloads#d-visual-studio-2012-update">Visual Studio Updates</a>.
182   - 4. Download and install <a href="http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx">Windows 8 SDK</a>.
  161 + 3. Grab any available [Visual Studio Updates](http://www.microsoft.com/visualstudio/eng/downloads#d-visual-studio-2012-update).
  162 + 4. Download and install [Windows 8 SDK](http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx).
183 163  
184   -2. <a href="http://www.cmake.org/files/v2.8/cmake-2.8.11.2-win32-x86.exe">Download and Install CMake 2.8.11.2</a>
  164 +2. [Download and Install CMake 2.8.11.2](http://www.cmake.org/files/v2.8/cmake-2.8.11.2-win32-x86.exe)
185 165 1. During installation setup select "add CMake to PATH".
186 166  
187   -3. <a href="http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.6.1/opencv-2.4.6.1.tar.gz">Download OpenCV 2.4.6.1</a>
188   - 1. Consider the free open source program <a href="http://www.7-zip.org/">7-Zip</a> if you need a program to unarchive tarballs.
  167 +3. [Download OpenCV 2.4.6.1](http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.6.1/opencv-2.4.6.1.tar.gz)
  168 + 1. Consider the free open source program [7-Zip](http://www.7-zip.org/) if you need a program to unarchive tarballs.
189 169 2. Move the "opencv-2.4.6.1" folder to "C:\".
190 170 3. Open "VS2012 x64 Cross Tools Command Prompt" (from the Start Menu, select "All Programs" -> "Microsoft Visual Studio 2012" -> "Visual Studio Tools" -> "VS2012 x64 Cross Tools Command Prompt") and enter:
191 171  
... ... @@ -200,9 +180,9 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
200 180 $ nmake install
201 181 $ nmake clean
202 182  
203   -4. <a href="http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-windows-opensource-5.1.1-msvc2012-x86_64-offline.exe">Download and Install Qt 5.1.1</a>
  183 +4. [Download and Install Qt 5.1.1](http://download.qt-project.org/official_releases/qt/5.1/5.1.1/qt-windows-opensource-5.1.1-msvc2012-x86_64-offline.exe)
204 184  
205   -5. Create a <a href="github.com">GitHub</a> account and follow their instructions for <a href="https://help.github.com/articles/set-up-git">setting up Git</a>.
  185 +5. Create a [GitHub](https://github.com/) account and follow their instructions for [setting up Git](https://help.github.com/articles/set-up-git).
206 186 1. Launch "Git Bash" from the Desktop and clone OpenBR:
207 187  
208 188 $ cd /c
... ... @@ -285,7 +265,7 @@ A hacker&#39;s guide to building, editing, and running OpenBR.
285 265  
286 266 $ sudo apt-get install qt5-default libqt5svg5-dev
287 267  
288   -6. Create a <a href="github.com">GitHub</a> account, follow their instructions for <a href="https://help.github.com/articles/set-up-git">setting up Git</a>.
  268 +6. Create a [GitHub](https://github.com/) account, follow their instructions for [setting up Git](https://help.github.com/articles/set-up-git).
289 269  
290 270 $ git clone https://github.com/biometrics/openbr.git
291 271 $ cd openbr
... ...
docs/docs/technical.md
... ... @@ -16,7 +16,7 @@ Ok, you probably knew all of this already, let&#39;s move on.
16 16 The only way of creating an algorithm in OpenBR is from a text string that describes it.
17 17 We call this string the *algorithm description*.
18 18 The algorithm description is separated into two parts by a ':', with the left hand side indicating how to generate templates and the right hand side indicating how to compare them.
19   -Some algorithms, like [age_estimation](tutorials.md#age estimation) and [gender estimation](tutorials.md#gender estimation) are *classifiers* that don't create templates.
  19 +Some algorithms, like [age_estimation](tutorials.md#age-estimation) and [gender estimation](tutorials.md#gender-estimation) are *classifiers* that don't create templates.
20 20 In these cases, the colon and the template comparison technique can be omitted from the algorithm description.
21 21  
22 22 There are several motivations for mandating that algorithms are defined from these strings, here are the most important:
... ... @@ -29,12 +29,12 @@ Let&#39;s look at some of the important parts of the code base that make this possib
29 29  
30 30 In `AlgorithmCore::init()` in `openbr/core/core.cpp` you can see the code for splitting the algorithm description at the colon.
31 31 Shortly thereafter in this function we *make* the template generation and comparison methods.
32   -These make calls are defined in the public [C++ plugin API](#the c++ plugin api) and can also be called from end user code.
  32 +These make calls are defined in the public [C++ plugin API](docs/cpp_api.md) and can also be called from end user code.
33 33  
34 34 Below we discuss some of the source code for `Transform::make` in `openbr/openbr_plugin.cpp`.
35 35 Note, the make functions for other plugin types are similar in spirit and will not be covered.
36 36  
37   -One of the first steps when converting the template enrollment description into a [Transform](docs/cpp_api.md#Transform) is to replace the operators, like '+', with their full form:
  37 +One of the first steps when converting the template enrollment description into a [Transform](docs/cpp_api.md#transform) is to replace the operators, like '+', with their full form:
38 38  
39 39 { // Check for use of '+' as shorthand for Pipe(...)
40 40 QStringList words = parse(str, '+');
... ... @@ -83,10 +83,10 @@ The *Biometric Evaluation Environment* (BEE) is a [NIST](http://www.nist.gov/ind
83 83  
84 84 OpenBR implements the following portions of the BEE specification:
85 85  
86   -* Signature Set- A signature set (or *sigset*) is a [Gallery](docs/cpp_api.md#gallery) compliant **XML** file-list specified on page 9 of [MBGC File Overview](MBGC_file_overview.pdf#page=9) and implemented in [xmlGallery](docs/plugins/gallery.md#xmlGallery). Sigsets are identified with a **.xml** extension.
  86 +* Signature Set- A signature set (or *sigset*) is a [Gallery](docs/cpp_api.md#gallery) compliant **XML** file-list specified on page 9 of [MBGC File Overview](DOCUMENT ME) and implemented in [xmlGallery](docs/plugins/gallery.md#xmlgallery). Sigsets are identified with a **.xml** extension.
87 87  
88   -* Similarity Matrix- A similarity matrix (or *simmat*) is an [Output](docs/cpp_api.md#output) compliant binary score matrix specified on page 12 of [MBGC File Overview](MBGC_file_overview.pdf#page=12) and implemented in [mtxOutput](docs/plugins/output.md#mtxOutput). Simmats are identified with a **.mtx** extension. See [br_eval](docs/c_api.md#br_eval) for more information.
  88 +* Similarity Matrix- A similarity matrix (or *simmat*) is an [Output](docs/cpp_api.md#output) compliant binary score matrix specified on page 12 of [MBGC File Overview](DOCUMENT ME) and implemented in [mtxOutput](docs/plugins/output.md#mtxoutput). Simmats are identified with a **.mtx** extension. See [br_eval](docs/c_api.md#br_eval) for more information.
89 89  
90   -* Mask Matrix- A mask matrix (or *mask*) is a binary matrix specified on page 14 of [MBGC File Overview](MBGC_file_overview.pdf#page=14) identifying the ground truth genuines and impostors of a corresponding *simmat*. Masks are identified with a **.mask** extension. See [br_make_mask](docs/c_api.md#br_make_mask) and [br_combine_masks](docs/c_api.md#br_combine_masks) for more information.
  90 +* Mask Matrix- A mask matrix (or *mask*) is a binary matrix specified on page 14 of [MBGC File Overview](DOCUMENT ME) identifying the ground truth genuines and impostors of a corresponding *simmat*. Masks are identified with a **.mask** extension. See [br_make_mask](docs/c_api.md#br_make_mask) and [br_combine_masks](docs/c_api.md#br_combine_masks) for more information.
91 91  
92 92 ---
... ...
docs/docs/tutorials.md
... ... @@ -32,7 +32,7 @@ You&#39;re webcam should be open again but this time a box should have appeared arou
32 32 3. [Draw(lineThickness=3)](docs/plugins/gui.md#drawtransform): Take the rects detected by [Cascade](docs/plugins/metadata.md#cascadetransform) and draw them onto the frame from the webcam. **lineThickness** determines the thickness of the drawn rect.
33 33 4. [Show(false)](docs/plugins/gui.md#showtransform): Show the image in a GUI window. **false** indicates the images should be shown in succession without waiting for a key press.
34 34  
35   -Pretty straightforward right? Each plugin completes one task and the passes the output on to the next plugin. You can pipe together as many plugins as you like as long as the output data from one can be the input data to the next. But wait! Output data? Input data? we haven't talked about data at all yet! How does OpenBR handle data? There are two objects that handle data is OpenBR; [Files](docs/cpp_api.md#file), which handle metadata, and [Templates](docs/cpp_api.md#template) which are containers for images and [Files](docs/cpp_api.md#file). Let's talk about [Files](docs/cpp_api.md#file) first. A file consists of file name, which is a path to a file on disk, and metadata which is a map of key-value pairs. The metadata can contain any textual information about the file. In the example above we use it to store the rectangles detected by [Cascade](docs/plugins/metadata.md#cascadetransform) and pass them along to [Draw](docs/plugins/metadata.md#drawtransform) for drawing. [Templates](docs/cpp_api.md#template) are containers for images, given as OpenCV [Mats](http://docs.opencv.org/modules/core/doc/basic_structures.html#mat), and [Files](docs/cpp_api.md#file). They can contain one image or a list of images. Plugins are either [Template](docs/cpp_api.md#template) in, [Template](docs/cpp_api.md#template) out or [TemplateList](docs/cpp_api.md#templatelist) in, [TemplateList](docs/cpp_api.md#templatelist) out. [TemplateLists](docs/cpp_api.md#templatelist) are, of course, just a list of [Templates](docs/cpp_api.md#template) which a few functions added for your convenience.
  35 +Pretty straightforward right? Each plugin completes one task and the passes the output on to the next plugin. You can pipe together as many plugins as you like as long as the output data from one can be the input data to the next. But wait! Output data? Input data? we haven't talked about data at all yet! How does OpenBR handle data? There are two objects that handle data is OpenBR; [Files](docs/cpp_api.md#file), which handle metadata, and [Templates](docs/cpp_api.md#template) which are containers for images and [Files](docs/cpp_api.md#file). Let's talk about [Files](docs/cpp_api.md#file) first. A file consists of file name, which is a path to a file on disk, and metadata which is a map of key-value pairs. The metadata can contain any textual information about the file. In the example above we use it to store the rectangles detected by [Cascade](docs/plugins/metadata.md#cascadetransform) and pass them along to [Draw](docs/plugins/gui.md#drawtransform) for drawing. [Templates](docs/cpp_api.md#template) are containers for images, given as OpenCV [Mats](http://docs.opencv.org/modules/core/doc/basic_structures.html#mat), and [Files](docs/cpp_api.md#file). They can contain one image or a list of images. Plugins are either [Template](docs/cpp_api.md#template) in, [Template](docs/cpp_api.md#template) out or [TemplateList](docs/cpp_api.md#templatelist) in, [TemplateList](docs/cpp_api.md#templatelist) out. [TemplateLists](docs/cpp_api.md#templatelist) are, of course, just a list of [Templates](docs/cpp_api.md#template) which a few functions added for your convenience.
36 36  
37 37 And there you go! You have gotten your quick start in OpenBR. We covered the [command line](docs/cl_api.md), plugins, and the key [data structures](docs/cpp_api.md) in OpenBR. If you want to learn more the next few tutorials will cover these fields with more depth. For even more information check out the [technical overviews](technical.md) and class documentation!
38 38  
... ...
docs/extensions/highlighter.py 0 โ†’ 100644
  1 +import re
  2 +
  3 +from markdown.postprocessors import Postprocessor
  4 +from markdown.extensions import Extension
  5 +
  6 +class HighlighterPostprocessor(Postprocessor):
  7 + def run(self, text):
  8 + print text
  9 + return text
  10 +
  11 +class HighlighterExtension(Extension):
  12 + def extendMarkdown(self, md, md_globals):
  13 + md.postprocessors.add('highlight', HighlighterPostprocessor(md))
... ...
docs/mkdocs.yml
... ... @@ -3,7 +3,7 @@ repo_url: https://github.com/biometrics/openbr
3 3 site_favicon: docs/img/openbr.ico
4 4 copyright: 2012 The MITRE Corporation
5 5  
6   -theme: readly
  6 +theme: spacelab
7 7 theme_dir: themes/spacelab/
8 8  
9 9 pages:
... ...
docs/scripts/check_format_cpp.py 0 โ†’ 100644
docs/scripts/check_links.py 0 โ†’ 100644
  1 +import os
  2 +import markdown
  3 +from HTMLParser import HTMLParser
  4 +
  5 +def subfiles(path, ext):
  6 + return [os.path.join(path, name) for name in os.listdir(path) if os.path.isfile(os.path.join(path, name)) and name[-len(ext):] == ext]
  7 +
  8 +def subdirs(path):
  9 + return [name for name in os.listdir(path) if os.path.isdir(os.path.join(path, name))]
  10 +
  11 +def walk(path, ext):
  12 + files = []
  13 + for d in subdirs(path):
  14 + files.extend(walk(os.path.join(path, d), ext))
  15 +
  16 + files.extend(subfiles(path, ext))
  17 + return files
  18 +
  19 +def basename_no_ext(name):
  20 + basename = os.path.basename(name)
  21 + return basename.split('.')[0]
  22 +
  23 +class Link():
  24 + def __init__(self, raw_link):
  25 + if 'http' in raw_link:
  26 + self.http = raw_link
  27 + self.file = None
  28 + self.anchor = None
  29 + elif raw_link[0] == '#':
  30 + self.http = None
  31 + self.file = None
  32 + self.anchor = raw_link[1:]
  33 + elif '#' in raw_link:
  34 + self.http = None
  35 +
  36 + split_link = raw_link.split('#')
  37 + self.file = basename_no_ext(split_link[0])
  38 + self.anchor = split_link[1]
  39 + else:
  40 + self.http = None
  41 + self.file = basename_no_ext(raw_link)
  42 + self.anchor = None
  43 +
  44 +class LinkParser(HTMLParser):
  45 + def __init__(self):
  46 + HTMLParser.__init__(self)
  47 +
  48 + self.headers = []
  49 + self.links = []
  50 +
  51 + def handle_starttag(self, tag, attrs):
  52 + for attr in attrs:
  53 + if u'href' == attr[0]:
  54 + self.links.append(Link(attr[1].encode('ascii', 'ignore')))
  55 +
  56 + elif u'class' == attr[0]:
  57 + self.headers.append(attr[1].encode('ascii', 'ignore'))
  58 +
  59 + elif u'name' == attr[0]:
  60 + self.headers.append(attr[1].encode('ascii', 'ignore'))
  61 +
  62 + elif u'id' == attr[0]:
  63 + self.headers.append(attr[1].encode('ascii', 'ignore'))
  64 +
  65 +
  66 +def parse(html):
  67 + parser = LinkParser()
  68 + parser.feed(html)
  69 +
  70 + return parser.headers, parser.links
  71 +
  72 +def check(headers, links):
  73 + for f, file_links in links.items():
  74 + for link in file_links:
  75 + if link.http:
  76 + continue
  77 +
  78 + link_file = f
  79 + if link.file:
  80 + link_file = link.file
  81 +
  82 + if link_file not in headers:
  83 + print 'BAD FILE IN ' + f + '.md:', link_file
  84 + continue
  85 +
  86 + if link.anchor and link.anchor not in headers[link_file]:
  87 + print 'BAD LINK IN ' + f + '.md:', link_file + ', ' + link.anchor
  88 +
  89 +
  90 +def main():
  91 + docs_dir = '../docs/'
  92 + ext = 'md'
  93 +
  94 + md_files = walk(docs_dir, ext)
  95 + md = markdown.Markdown( ['meta', 'toc', 'tables', 'fenced_code'] )
  96 +
  97 + html_files = [md.convert(open(f, 'r').read()) for f in md_files]
  98 +
  99 + headers = {}
  100 + links = {}
  101 + for i in range(len(md_files)):
  102 + local_headers, local_links = parse(html_files[i])
  103 +
  104 + headers[basename_no_ext(md_files[i])] = local_headers
  105 + links[basename_no_ext(md_files[i])] = local_links
  106 +
  107 + check(headers, links)
  108 +
  109 +main()
... ...
docs/scripts/generate_api_class_doc.py 0 โ†’ 100644
  1 +# This script is intended to take an API-style class from OpenBR and output
  2 +# structured Markdown text in the OpenBR documentation format. The class details
  3 +# should then be filled in.
  4 +
  5 +import sys
  6 +import re
  7 +
  8 +def find_name_parent(content):
  9 + name_re = re.compile('class(.*?):')
  10 + name = name_re.search(content).group()[:-1].strip().split(' ')[-1]
  11 +
  12 + parent_re = re.compile('public.*')
  13 + parent = parent_re.search(content).group().strip().split(' ')[-1]
  14 +
  15 + return name, parent
  16 +
  17 +def find_properties(content):
  18 + properties = []
  19 +
  20 + property_re = re.compile('Q_PROPERTY\((.*?)\)')
  21 + it = property_re.finditer(content)
  22 + for prop in it:
  23 + prop_type = prop.group()[11:-1].split(' ')[0]
  24 + prop_name = prop.group()[11:-1].split(' ')[1]
  25 + properties.append((prop_name, prop_type))
  26 +
  27 + return properties
  28 +
  29 +def find_members(content):
  30 + members = []
  31 +
  32 + member_re = re.compile('(\w+(<\w+>)*)\s(\w+);')
  33 + it = member_re.finditer(content)
  34 + for member in it:
  35 + member_type = member.group()[:-1].strip().split(' ')[0]
  36 + member_name = member.group()[:-1].strip().split(' ')[1]
  37 + members.append((member_name, member_type))
  38 +
  39 + return members
  40 +
  41 +def find_constructors(name, content):
  42 + constructors = []
  43 +
  44 + constructor_re = re.compile('(.*)' + name + '\(\)')
  45 + it = constructor_re.finditer(content)
  46 + for constructor in it:
  47 + constructors.append(constructor.group().strip())
  48 +
  49 + return constructors
  50 +
  51 +def find_functions(content):
  52 + functions = []
  53 +
  54 + function_re = re.compile('(.*)[^PROPERTY]\(.*\).*;')
  55 + it = function_re.finditer(content)
  56 + for func in it:
  57 + function = {}
  58 +
  59 + function['Full'] = func.group()[:-1].strip() #don't include semi colon
  60 +
  61 + func_split = func.group().strip().split(' ')
  62 + if func_split[0] == "static":
  63 + function['Type'] = 'static'
  64 + function['Return'] = func_split[1]
  65 + function['Name'] = func_split[2].split('(')[0]
  66 + elif func_split[0] == "virtual":
  67 + function['Type'] = 'virtual'
  68 + function['Return'] = func_split[1]
  69 + function['Name'] = func_split[2].split('(')[0]
  70 + else:
  71 + function['Type'] = 'normal'
  72 + function['Return'] = func_split[0]
  73 + function['Name'] = func_split[1].split('(')[0]
  74 +
  75 + args = []
  76 +
  77 + args_list = func.group()[func.group().find('(')+1:func.group().find(')')].split(',')
  78 + for arg in args_list:
  79 + arg = arg.strip()
  80 + split_idx = arg.rfind(' ')
  81 + if arg[split_idx:].strip()[0] == '*' or arg[split_idx:].strip()[0] == '&':
  82 + split_idx += 2
  83 +
  84 + args.append((arg[split_idx:].strip(), arg[:split_idx].strip()))
  85 +
  86 + function['Args'] = args
  87 +
  88 + functions.append(function)
  89 +
  90 + return functions
  91 +
  92 +def parse(content):
  93 + name, parent = find_name_parent(content)
  94 + properties = find_properties(content)
  95 + members = find_members(content)
  96 + constructors = find_constructors(name, content)
  97 + functions = find_functions(content)
  98 +
  99 + return name, parent, properties, members, constructors, functions
  100 +
  101 +def function_builder(name, function):
  102 + markdown = ""
  103 +
  104 + markdown += "### <h3 id=" + name.lower() + "-function-" + function['Name'].lower() + ">" + function['Full'] + "</h3>\n\n"
  105 + markdown += "DOCUMENT ME\n\n"
  106 +
  107 + markdown += "* **function definition:**\n\n"
  108 + markdown += "\t\t" + function['Full'] + "\n\n"
  109 +
  110 + markdown += "* **parameters:**"
  111 + if len(function['Args']) == 0:
  112 + markdown += " NONE\n"
  113 + else:
  114 + markdown += "\n\n"
  115 + markdown += "\tParameter | Type | Description\n"
  116 + markdown += "\t--- | --- | ---\n"
  117 + for arg in function['Args']:
  118 + markdown += "\t" + arg[0] + " | " + arg[1] + " | DOCUMENT ME\n"
  119 + markdown += "\n"
  120 +
  121 + markdown += "* **output:** (" + function['Return'] + ") DOCUMENT ME\n\n\n"
  122 +
  123 + return markdown
  124 +
  125 +def format_md(name, parent, properties, members, constructors, functions):
  126 + markdown = ""
  127 +
  128 + markdown += "# " + name + "\n\n"
  129 + markdown += "Inherits from [" + parent + "](#" + parent.lower() + ")\n\n"
  130 +
  131 + markdown += "## <h2 id=" + name.lower() + "-properties>Properties</h2>\n\n"
  132 + if len(properties) == 0:
  133 + markdown += "NONE\n\n"
  134 + else:
  135 + markdown += "Property | Type | Description\n"
  136 + markdown += "--- | --- | ---\n"
  137 + for prop in properties:
  138 + markdown += '<a class="table-anchor" id=' + name.lower() + '-properties-' + prop[0].lower() + '></a>'
  139 + markdown += prop[0] + " | " + prop[1] + " | DOCUMENT ME\n"
  140 + markdown += "\n"
  141 +
  142 + markdown += "## <h2 id=" + name.lower() + "-members>Members</h2>\n\n"
  143 + if len(members) == 0:
  144 + markdown += "NONE\n\n"
  145 + else:
  146 + markdown += "Member | Type | Description\n"
  147 + markdown += "--- | --- | ---\n"
  148 + for member in members:
  149 + markdown += '<a class="table-anchor" id=' + name.lower() + '-members-' + member[0].lower() + '></a>'
  150 + markdown += member[0] + " | " + member[1] + " | DOCUMENT ME\n"
  151 + markdown += "\n"
  152 +
  153 + markdown += "## <h2 id=" + name.lower() + "-constructors>Constructors</h2>\n\n"
  154 + if len(constructors) == 0:
  155 + markdown += "NONE\n\n"
  156 + else:
  157 + markdown += "Constructor \| Destructor | Description\n"
  158 + markdown += "--- | ---\n"
  159 + for constructor in constructors:
  160 + markdown += constructor + " | DOCUMENT ME\n"
  161 + markdown += "\n"
  162 +
  163 + markdown += "## <h2 id=" + name.lower() + "-static-functions>Static Functions</h2>\n\n"
  164 + for function in functions:
  165 + if function['Type'] == 'static':
  166 + markdown += function_builder(name, function)
  167 +
  168 + markdown += "## <h2 id=" + name.lower() + "-functions>Functions</h2>\n\n"
  169 + for function in functions:
  170 + if not function['Type'] == 'static':
  171 + markdown += function_builder(name, function)
  172 +
  173 + return markdown
  174 +
  175 +def main():
  176 + if len(sys.argv) != 3:
  177 + print 'Inputs => class documentation'
  178 + sys.exit(1)
  179 +
  180 + class_file = open(sys.argv[1], 'r')
  181 + doc_file = open(sys.argv[2], 'w+')
  182 +
  183 + name, parent, properties, members, constructors, functions = parse(class_file.read())
  184 +
  185 + doc_file.write(format_md(name, parent, properties, members, constructors, functions))
  186 +
  187 +main()
... ...
docs/scripts/generate_docs.py renamed to docs/scripts/generate_plugin_docs.py
... ... @@ -35,9 +35,27 @@ def parse(group):
35 35 attributes[key] = [value]
36 36  
37 37 attributes['Name'] = clss[5:clss.find(':')].strip()
38   - attributes['Parent'] = clss[clss.find('public')+6:].strip()
  38 + attributes['Parent'] = clss[clss.find('public')+6:].strip().strip(',') # Handles the edge case of multiple inheritence
39 39 return attributes
40 40  
  41 +def parseInheritance(inheritance):
  42 + abstractions = ['Transform', 'UntrainableTransform',
  43 + 'MetaTransform', 'UntrainableMetaTransform',
  44 + 'MetadataTransform', 'UntrainableMetadataTransform',
  45 + 'TimeVaryingTransform',
  46 + 'Distance', 'UntrainableDistance',
  47 + 'Output', 'MatrixOutput',
  48 + 'Format',
  49 + 'Gallery', 'FileGallery',
  50 + 'Representation',
  51 + 'Classifier'
  52 + ]
  53 +
  54 + if inheritance in abstractions:
  55 + return '../cpp_api.md#' + inheritance.lower()
  56 + else: # Not an abstraction must inherit in the local file!
  57 + return '#' + inheritance.lower()
  58 +
41 59 def parseSees(sees):
42 60 if not sees:
43 61 return ""
... ... @@ -49,7 +67,10 @@ def parseSees(sees):
49 67 output += "\t* [" + see + "](" + see + ")\n"
50 68 output += "\n"
51 69 else:
52   - output += " [" + sees[0] + "](" + sees[0] + ")\n"
  70 + link = sees[0]
  71 + if not 'http' in link:
  72 + link = '#' + link.lower()
  73 + output += " [" + sees[0] + "](" + link + ")\n"
53 74  
54 75 return output
55 76  
... ... @@ -70,7 +91,7 @@ def parseProperties(properties):
70 91 return "* **properties:** None\n\n"
71 92  
72 93 output = "* **properties:**\n\n"
73   - output += "Name | Type | Description\n"
  94 + output += "Property | Type | Description\n"
74 95 output += "--- | --- | ---\n"
75 96 for prop in properties:
76 97 split = prop.split(' ')
... ... @@ -78,6 +99,22 @@ def parseProperties(properties):
78 99 name = split[1]
79 100 desc = ' '.join(split[2:])
80 101  
  102 + table_regex = re.compile('\[(.*?)\]')
  103 + table_match = table_regex.search(desc)
  104 + while table_match:
  105 + before = desc[:table_match.start()]
  106 + after = desc[table_match.end():]
  107 +
  108 + table_content = desc[table_match.start()+1:table_match.end()-1].split(',')
  109 +
  110 + table = "<ul>"
  111 + for field in table_content:
  112 + table += "<li>" + field.strip() + "</li>"
  113 + table += "</ul>"
  114 +
  115 + desc = before.strip() + table + after.strip()
  116 + table_match = table_regex.search(desc)
  117 +
81 118 output += name + " | " + ty + " | " + desc + "\n"
82 119  
83 120 return output
... ... @@ -109,7 +146,7 @@ def main():
109 146 plugin_string = "# " + attributes["Name"] + "\n\n"
110 147 plugin_string += ' '.join([brief for brief in attributes["brief"]]) + "\n\n"
111 148 plugin_string += "* **file:** " + os.path.join(module, plugin) + "\n"
112   - plugin_string += "* **inherits:** [" + attributes["Parent"] + "](../cpp_api.md#" + attributes["Parent"].lower() + ")\n"
  149 + plugin_string += "* **inherits:** [" + attributes["Parent"] + "](" + parseInheritance(attributes["Parent"]) + ")\n"
113 150  
114 151 plugin_string += parseSees(attributes.get("see", None))
115 152 plugin_string += parseAuthors(attributes.get("author", None))
... ...
docs/themes/spacelab/css/base.css
... ... @@ -3,6 +3,21 @@ body {
3 3 padding-top: 5%;
4 4 }
5 5  
  6 +/* Center the header and tagline */
  7 +#openbr, #tagline {
  8 + text-align: center;
  9 +}
  10 +
  11 +/* The anchor tags in the tables
  12 + * are blocked by the navbar when
  13 + * they are used. This fixes that */
  14 +a.table-anchor {
  15 + display: block;
  16 + position: relative;
  17 + top: -70px;
  18 + visibility: hidden;
  19 +}
  20 +
6 21 h1[id]:before, h2[id]:before {
7 22 content: "";
8 23 display: block;
... ... @@ -10,8 +25,19 @@ h1[id]:before, h2[id]:before {
10 25 height: 75px;
11 26 }
12 27  
  28 +h3 {
  29 + margin-top: 50px;
  30 + margin-bottom: 20px;
  31 + padding: 10px;
  32 + border-radius: 5px;
  33 + font-size: 120%;
  34 + background-color: #e7e7e7;/* text-color => #3399f3;*/
  35 + display: block;
  36 +}
  37 +
13 38 ul.nav li.main {
14 39 font-weight: bold;
  40 + font-size: 90%;
15 41 }
16 42  
17 43 div.col-md-3 {
... ...
docs/themes/spacelab/js/base.js
... ... @@ -7,9 +7,18 @@ $( document ).ready(function() {
7 7  
8 8  
9 9 $('body').scrollspy({
10   - target: '.bs-sidebar',
  10 + target: '#bs-sidebar',
11 11 });
12 12  
  13 +$('[data-spy="scroll"]').each(function()
  14 +{
  15 + $(this).scrollspy('refresh');
  16 +});
  17 +
  18 +$('#myScrollspy').on('activate.bs.scrollspy', function () {
  19 + $(this).parent().children('ul.scroll_toggle').toggle(50)
  20 +})
  21 +
13 22 /* Prevent disabled links from causing a page reload */
14 23 $("li.disabled a").click(function() {
15 24 event.preventDefault();
... ...
docs/themes/spacelab/toc.html
1   -<div class="bs-sidebar hidden-print affix" role="complementary">
  1 +<div id="bs-sidebar" class="bs-sidebar hidden-print affix" role="complementary">
2 2 <ul class="nav bs-sidenav">
3   - {% for toc_item in toc %}
4   - <li class="main {% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
5   - {% for toc_item in toc_item.children %}
6   - <li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
  3 + {% for toc_item in toc %}
  4 + <li class="main {% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
  5 + {% if toc_item.children %}
  6 + <ul class="nav scroll_toggle">
  7 + {% for toc_item in toc_item.children %}
  8 + <li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
  9 + {% endfor %}
  10 + </ul>
  11 + <hr />
  12 + {% endif %}
7 13 {% endfor %}
8   - {% endfor %}
  14 +
  15 + <!-- Isn't working yet :( -->
  16 + {% if current_page == "Home" %}
  17 + <li class="github-button">
  18 + <div align="center">
  19 + <iframe src="http://ghbtns.com/github-btn.html?user=biometrics&amp;repo=openbr&amp;type=watch&amp;count=true&amp;size=large"
  20 + allowtransparency="true" frameborder="0" scrolling="0" width="150" height="30">
  21 + </iframe>
  22 + </div>
  23 + </li>
  24 + {% endif %}
9 25 </ul>
10 26 </div>
... ...
openbr/openbr.h
... ... @@ -23,41 +23,6 @@
23 23 extern "C" {
24 24 #endif
25 25  
26   - /*!
27   - * \defgroup c_sdk C SDK
28   - * \brief High-level API for running algorithms and evaluating results.
29   - *
30   - * In order to provide a high-level interface that is usable from the command line and callable from other programming languages,
31   - * the API is designed to operate at the "file system" level.
32   - * In other words, arguments to many functions are file paths that specify either a source of input or a desired output.
33   - * File extensions are relied upon to determine \em how files should be interpreted in the context of the function being called.
34   - * The \ref cpp_plugin_sdk should be used if more fine-grained control is required.
35   - *
36   - * \code
37   - * #include <openbr/openbr.h>
38   - * \endcode
39   - * <a href="http://www.cmake.org/">CMake</a> developers may wish to use <tt>share/openbr/cmake/OpenBRConfig.cmake</tt>.
40   - *
41   - * \section managed_return_value Managed Return Value
42   - * Memory for <tt>const char*</tt> return values is managed internally and guaranteed until the next call to the function.
43   - *
44   - * \section input_string_buffer Input String Buffer
45   - * Users should input a char * buffer and the size of that buffer. String data will be copied into the buffer, if the buffer is too
46   - * small, only part of the string will be copied. Returns the buffer size required to contain the complete string.
47   - *
48   - * \section examples Examples
49   - * - \ref c_face_recognition_evaluation
50   - *
51   - * \subsection c_face_recognition_evaluation Face Recognition Evaluation
52   - * \ref cli_face_recognition_evaluation "Command Line Interface Equivalent"
53   - * \snippet app/examples/face_recognition_evaluation.cpp face_recognition_evaluation
54   - */
55   -
56   -/*!
57   - * \addtogroup c_sdk
58   - * @{
59   - */
60   -
61 26 /*!
62 27 * \brief Wraps br::Context::about()
63 28 * \see br_version
... ... @@ -77,7 +42,6 @@ BR_EXPORT void br_cat(int num_input_galleries, const char *input_galleries[], co
77 42 * \note If a gallery contains n duplicates, the first n-1 duplicates in the gallery will be removed and the nth will be kept.
78 43 * \note Users are encouraged to use binary gallery formats as the entire gallery is read into memory in one call to Gallery::read.
79 44 */
80   -
81 45 BR_EXPORT void br_deduplicate(const char *input_gallery, const char *output_gallery, const char *threshold);
82 46  
83 47 /*!
... ... @@ -122,6 +86,9 @@ BR_EXPORT void br_compare(const char *target_gallery, const char *query_gallery,
122 86 */
123 87 BR_EXPORT void br_compare_n(int num_targets, const char *target_galleries[], const char *query_gallery, const char *output);
124 88  
  89 +/*!
  90 + * \brief DOCUMENT ME!
  91 + */
125 92 BR_EXPORT void br_pairwise_compare(const char *target_gallery, const char *query_gallery, const char *output = "");
126 93  
127 94 /*!
... ...
openbr/openbr_plugin.cpp
... ... @@ -1040,11 +1040,6 @@ void Object::init(const File &amp;file_)
1040 1040 }
1041 1041  
1042 1042 /* Context - public methods */
1043   -int br::Context::blocks(int size) const
1044   -{
1045   - return std::ceil(1.f*size/blockSize);
1046   -}
1047   -
1048 1043 bool br::Context::contains(const QString &name)
1049 1044 {
1050 1045 return property(qPrintable(name)).isValid();
... ...
openbr/openbr_plugin.h
... ... @@ -764,12 +764,6 @@ public:
764 764 QTime startTime; /*!< \brief Used to estimate timeRemaining(). */
765 765  
766 766 /*!
767   - * \brief Returns the suggested number of partitions \em size should be divided into for processing.
768   - * \param size The length of the list to be partitioned.
769   - */
770   - int blocks(int size) const;
771   -
772   - /*!
773 767 * \brief Returns true if \em name is queryable using <a href="http://doc.qt.digia.com/qt/qobject.html#property">QObject::property</a>
774 768 * \param name The property key to check for existance.
775 769 * \return \c true if \em name is a property, \c false otherwise.
... ...
openbr/plugins/classification/adaboost.cpp
... ... @@ -27,8 +27,8 @@ namespace br
27 27 * \brief Wraps OpenCV's Ada Boost framework
28 28 * \author Scott Klum \cite sklum
29 29 * \see http://docs.opencv.org/modules/ml/doc/boosting.html
30   - * \property enum type Type of Adaboost to perform. Options are Discrete, Real, Logit, and Gentle. Default is Real.
31   - * \property enum splitCriteria Splitting criteria used to choose optimal splits during a weak tree construction. Options are Default, Gini, Misclass, Sqerr. Default is Default.
  30 + * \property enum type Type of Adaboost to perform. Options are: [Discrete, Real, Logit, Gentle] Default is Real.
  31 + * \property enum splitCriteria Splitting criteria used to choose optimal splits during a weak tree construction. Options are: [Default, Gini, Misclass, Sqerr] Default is Default.
32 32 * \property int weakCount Maximum number of weak classifiers per stage. Default is 100.
33 33 * \property float trimRate A threshold between 0 and 1 used to save computational time. Samples with summary weight \leq 1 - weight\_trim\_rate do not participate in the next iteration of training. Set this parameter to 0 to turn off this functionality. Default is 0.95.
34 34 * \property int folds OpenCV parameter variable. Default value is 0.
... ...
openbr/plugins/classification/lda.cpp
... ... @@ -49,7 +49,7 @@ BR_REGISTER(Initializer, EigenInitializer)
49 49 * \author Brendan Klare \cite bklare
50 50 * \author Josh Klontz \cite jklontz
51 51 *
52   - * \property float keep Default is 0.95. If (keep < 0) then all eigenvalues are retained. If (keep = 0) then no PCA is performed and the eigenvectors form an identity matrix. If (0 < keep < 1) then keep is the fraction of the variance to retain. If (keep >= 1) then keep is the number of leading eigenvectors to retain.
  52 + * \property float keep Options are: [keep < 0 - All eigenvalues are retained, keep == 0 - No PCA is performed and the eigenvectors form an identity matrix, 0 < keep < 1 - Keep is the fraction of the variance to retain, keep >= 1 - keep is the number of leading eigenvectors to retain] Default is 0.95.
53 53 * \property int drop BRENDAN OR JOSH FILL ME IN. Default is 0.
54 54 * \property bool whiten BRENDAN OR JOSH FILL ME IN. Default is false.
55 55 */
... ...
openbr/plugins/cluster/collectnn.cpp
... ... @@ -23,6 +23,7 @@ namespace br
23 23 * \ingroup transforms
24 24 * \brief Collect nearest neighbors and append them to metadata.
25 25 * \author Charles Otto \cite caotto
  26 + * \property int keep The maximum number of nearest neighbors to keep. Default is 20.
26 27 */
27 28 class CollectNNTransform : public UntrainableMetaTransform
28 29 {
... ...
openbr/plugins/cluster/kmeans.cpp
... ... @@ -28,6 +28,9 @@ namespace br
28 28 * \ingroup transforms
29 29 * \brief Wraps OpenCV kmeans and flann.
30 30 * \author Josh Klontz \cite jklontz
  31 + * \property int kTrain The number of random centroids to make at train time. Default is 256.
  32 + * \property int kSearch The number of nearest neighbors to search for at runtime. Default is 1.
  33 + * \see http://docs.opencv.org/modules/flann/doc/flann_fast_approximate_nearest_neighbor_search.html
31 34 */
32 35 class KMeansTransform : public Transform
33 36 {
... ...
openbr/plugins/cluster/lognn.cpp
... ... @@ -25,6 +25,7 @@ namespace br
25 25 * \ingroup transforms
26 26 * \brief Log nearest neighbors to specified file.
27 27 * \author Charles Otto \cite caotto
  28 + * \property QString fileName The name of the log file. An empty fileName won't be written to. Default is "".
28 29 */
29 30 class LogNNTransform : public TimeVaryingTransform
30 31 {
... ...
openbr/plugins/cluster/randomcentroids.cpp
... ... @@ -29,7 +29,9 @@ namespace br
29 29 * \ingroup transforms
30 30 * \brief Chooses k random points to be centroids.
31 31 * \author Austin Blanton \cite imaus10
32   - * \see KMeansTransform
  32 + * \property int kTrain The number of random centroids to make at train time. Default is 256.
  33 + * \property int kSearch The number of nearest neighbors to search for at runtime. Default is 1.
  34 + * \see http://docs.opencv.org/modules/flann/doc/flann_fast_approximate_nearest_neighbor_search.html
33 35 */
34 36 class RandomCentroidsTransform : public Transform
35 37 {
... ...
openbr/plugins/gallery/binary.cpp
... ... @@ -29,6 +29,11 @@
29 29 namespace br
30 30 {
31 31  
  32 +/*!
  33 + * \ingroup galleries
  34 + * \brief An abstract gallery for handling binary data
  35 + * \author Unknown
  36 + */
32 37 class BinaryGallery : public Gallery
33 38 {
34 39 Q_OBJECT
... ...
openbr/plugins/metadata/tester.cpp deleted
No preview for this file type
share/openbr/Doxyfile.in
... ... @@ -58,7 +58,7 @@ PROJECT_LOGO = ${CPACK_PACKAGE_ICON}
58 58 # entered, it will be relative to the location where doxygen was started. If
59 59 # left blank the current directory will be used.
60 60  
61   -OUTPUT_DIRECTORY =
  61 +OUTPUT_DIRECTORY = ${CMAKE_SOURCE_DIR}/docs/doxygen/
62 62  
63 63 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
64 64 # directories (in 2 levels) under the output directory of each output format and
... ... @@ -1026,7 +1026,7 @@ IGNORE_PREFIX =
1026 1026 # If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
1027 1027 # The default value is: YES.
1028 1028  
1029   -GENERATE_HTML = YES
  1029 +GENERATE_HTML = NO
1030 1030  
1031 1031 # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
1032 1032 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
... ... @@ -1813,7 +1813,7 @@ MAN_LINKS = NO
1813 1813 # captures the structure of the code including all documentation.
1814 1814 # The default value is: NO.
1815 1815  
1816   -GENERATE_XML = NO
  1816 +GENERATE_XML = YES
1817 1817  
1818 1818 # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
1819 1819 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
... ...