Commit 3d38dee7af5594a329dcb7dc5ac37457701a4d0b

Authored by Scott Klum
1 parent e1413198

More edits

Showing 1 changed file with 44 additions and 41 deletions
docs/docs/tutorials.md
@@ -7,7 +7,7 @@ Welcome to OpenBR! Here we have a series of tutorials designed to get you up to @@ -7,7 +7,7 @@ Welcome to OpenBR! Here we have a series of tutorials designed to get you up to
7 7
8 This tutorial is meant to familiarize you with the ideas, objects and motivations behind OpenBR using some fun examples. **Note that parts of this tutorial require a webcam.** 8 This tutorial is meant to familiarize you with the ideas, objects and motivations behind OpenBR using some fun examples. **Note that parts of this tutorial require a webcam.**
9 9
10 -OpenBR is a C++ library built on top of [Qt](http://www.qt.io/) and [OpenCV](http://opencv.org/). It can either be used from the command line using the `br` application, or from interfacing with the [C++](api_docs/cpp_api.md) or [C](api_docs/c_api.md) APIs. Using the command line application `br` is the easiest and fastest way to get started and this tutorial will use it for all of the examples. 10 +OpenBR is a C++ library built on top of [Qt](http://www.qt.io/), [OpenCV](http://opencv.org/), and [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page). It can either be used from the command line using the `br` application, or from interfacing with the [C++](api_docs/cpp_api.md) or [C](api_docs/c_api.md) APIs. Using the `br` application is the easiest and fastest way to get started and this tutorial will use it for all of the examples.
11 11
12 First, make sure that OpenBR has been installed on your system using the steps described in the [installation section](install.md). 12 First, make sure that OpenBR has been installed on your system using the steps described in the [installation section](install.md).
13 13
@@ -19,37 +19,37 @@ If everything has gone according to plan, your webcam should be on and capturing @@ -19,37 +19,37 @@ If everything has gone according to plan, your webcam should be on and capturing
19 19
20 Let's talk about what's happening in the above command. `-gui`, `-algorithm`, and `-enroll` are examples of OpenBR's flags and are used to specify instructions to `br`. OpenBR expects flags to be prepended by a `-` and arguments that follow the flags to be separated by spaces. Flags normally require a specific number of arguments. All of the possible flags and their values are [documented here](api_docs/cl_api.md). Let's step through the individual arguments and values: 20 Let's talk about what's happening in the above command. `-gui`, `-algorithm`, and `-enroll` are examples of OpenBR's flags and are used to specify instructions to `br`. OpenBR expects flags to be prepended by a `-` and arguments that follow the flags to be separated by spaces. Flags normally require a specific number of arguments. All of the possible flags and their values are [documented here](api_docs/cl_api.md). Let's step through the individual arguments and values:
21 21
22 -* `-gui` is the flag that tells OpenBR to open up a GUI window. Note that when `-gui` is used, it must be the first flag passed to `br`. Take a look at the [GUI](api_docs/plugins/gui.md) plugins for other plugins that require the `-gui` flag.  
23 -* `-algorithm` is one of the most important flags in OpenBR. It expects one argument, referred to as the *algorithm string*. This string determines the pipeline that images and metadata propagate through.  
24 -* `-enroll` reads files from a [Gallery](api_docs/cpp_api/gallery/gallery.md) and *enrolls* them through the algorithm pipeline and serializes them to another [Gallery](api_docs/cpp_api/gallery/gallery.md). `-enroll` takes one input argument (`0.webcam` in this example) and an optional output argument. OpenBR supports multiple formats including `.jpg`, `.png`, `.csv`, and `.xml`. `.webcam` tells OpenBR to enroll frames from the computer's webcam. 22 +* `-gui` is the flag that tells OpenBR to open up a GUI window. Note that when `-gui` is used, it must be the first flag passed to `br`.
  23 +* `-algorithm` is one of the most important flags in OpenBR. It expects one argument, referred to as the *algorithm string*. This string determines the pipeline through which images and metadata propagate. It is composed of [Transform](api_docs/cpp_api/transform/transform.md)s, which are described in detail later in this tutorial.
  24 +* `-enroll` reads files from a [Gallery](api_docs/cpp_api/gallery/gallery.md) or a [Format](api_docs/cpp_api/format/format.md) and *enrolls* them through the algorithm pipeline and serializes them to another [Gallery](api_docs/cpp_api/gallery/gallery.md) or [Format](api_docs/cpp_api/format/format.md). `-enroll` takes one input argument (`0.webcam` in this example) and an optional output argument. OpenBR supports multiple formats including `.jpg`, `.png`, `.csv`, and `.xml`. The `.webcam` [Format](api_docs/cpp_api/format/format.md) tells OpenBR to enroll frames from the computer's webcam.
25 25
26 Let's try a slightly more complicated example. After all, OpenBR can do way more then just open webcams! Fire up the terminal again and enter: 26 Let's try a slightly more complicated example. After all, OpenBR can do way more then just open webcams! Fire up the terminal again and enter:
27 27
28 $ br -gui -algorithm "Cvt(Gray)+Show(false)" -enroll 0.webcam 28 $ br -gui -algorithm "Cvt(Gray)+Show(false)" -enroll 0.webcam
29 29
30 -Here, we took our normal BGR (OpenCV's alternative to RGB) image and converted it to a grayscale image simply by adding `Cvt(Gray)` to the algorithm string. [Cvt](api_docs/plugins/imgproc.md#cvttransform), short for convert, is an example of an OpenBR *Transform*. [Show](api_docs/plugins/gui.md#showtransform) is a Transform as well. Every algorithm string in OpenBR is just a series of Transforms joined to form a pipeline. In fact, the `+` symbol is shorthand for a [Pipe](api_docs/plugins/core.md#pipetransform), another kind of OpenBR Transform. 30 +Here, we took our normal BGR (OpenCV's alternative to RGB) image and converted it to a grayscale image simply by adding `Cvt(Gray)` to the algorithm string. [Cvt](api_docs/plugins/imgproc.md#cvttransform), short for convert, is an example of an OpenBR *[Transform](api_docs/cpp_api/transform/transform.md)*. [Show](api_docs/plugins/gui.md#showtransform) is a [Transform](api_docs/cpp_api/transform/transform.md) as well. In fact, every algorithm string in OpenBR is just a series of [Transform](api_docs/cpp_api/transform/transform.md)s joined to form a pipeline; even the `+` symbol is shorthand for a [Pipe](api_docs/plugins/core.md#pipetransform), another kind of OpenBR [Transform](api_docs/cpp_api/transform/transform.md).
31 31
32 -Typically, Transforms accept parameters. We specify `Gray` to [Cvt](api_docs/plugins/imgproc.md#cvttransform) as a runtime parameter to tell the plugin which color space to convert the image to. We also could have written `Cvt(HSV)` if we wanted to convert to the HSV color space or `Cvt(Luv)` if we wanted to convert to LUV. They can be provided as key-value pairs or as keyless values (`Cvt(Gray)` is equivalent to `Cvt(colorSpace=Gray)`) . Note that if you are supplying values only, the parameters are expected to be supplied in the order they are defined. Try running changing the algorithm string above to include `Show(true)` to see how changing the parameters affect the output of the command (Hint: hit a key to cycle through the images). 32 +Typically, [Transform](api_docs/cpp_api/transform/transform.md)s accept parameters. We specify `Gray` to [Cvt](api_docs/plugins/imgproc.md#cvttransform) as a runtime parameter to tell the [Transform](api_docs/cpp_api/transform/transform.md) which color space to convert the image to. We also could have written `Cvt(HSV)` if we wanted to convert to the HSV color space or `Cvt(Luv)` if we wanted to convert to LUV. Parameters can be provided as key-value pairs or as keyless values (`Cvt(Gray)` is equivalent to `Cvt(colorSpace=Gray)`) . Note that if you are supplying values only, the parameters are expected to be supplied in the order they are defined. Try changing the algorithm string above to include `Show(true)` to see how modifying the parameters affects the output of the command (Hint: hit a key to cycle through the images).
33 33
34 Let's make this example a little bit more exciting and relevant to OpenBR's biometric roots. Face detection is normally the first step in a [face recognition](#face-recognition) algorithm. Let's perform face detection in OpenBR. Back in the terminal enter: 34 Let's make this example a little bit more exciting and relevant to OpenBR's biometric roots. Face detection is normally the first step in a [face recognition](#face-recognition) algorithm. Let's perform face detection in OpenBR. Back in the terminal enter:
35 35
36 $ br -gui -algorithm "Cvt(Gray)+Cascade(FrontalFace)+Draw(lineThickness=3)+Show(false)" -enroll 0.webcam 36 $ br -gui -algorithm "Cvt(Gray)+Cascade(FrontalFace)+Draw(lineThickness=3)+Show(false)" -enroll 0.webcam
37 37
38 -You're webcam should be open again but this time a bounding-box should have appeared around your face! We added two new Transforms to our string, [Cascade](api_docs/plugins/metadata.md#cascadetransform) and [Draw](api_docs/plugins/gui.md#drawtransform). Let's walk through this Transform by Transform and see how it works: 38 +You're webcam should be open again but this time a bounding-box should have appeared around your face! We added two new [Transform](api_docs/cpp_api/transform/transform.md)s to our string: [Cascade](api_docs/plugins/metadata.md#cascadetransform) and [Draw](api_docs/plugins/gui.md#drawtransform). Let's walk through this [Transform](api_docs/cpp_api/transform/transform.md) by [Transform](api_docs/cpp_api/transform/transform.md) and see how it works:
39 39
40 1. [Cvt(Gray)](api_docs/plugins/imgproc.md#cvttransform): Convert the image from BGR to grayscale. Grayscale is required for [Cascade](api_docs/plugins/metadata.md#cascadetransform) to work properly. 40 1. [Cvt(Gray)](api_docs/plugins/imgproc.md#cvttransform): Convert the image from BGR to grayscale. Grayscale is required for [Cascade](api_docs/plugins/metadata.md#cascadetransform) to work properly.
41 2. [Cascade(FrontalFace)](api_docs/plugins/metadata.md#cascadetransform): This is a wrapper on the OpenCV [Cascade Classification](http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html) framework. It detects frontal faces using the `FrontalFace` model. 41 2. [Cascade(FrontalFace)](api_docs/plugins/metadata.md#cascadetransform): This is a wrapper on the OpenCV [Cascade Classification](http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html) framework. It detects frontal faces using the `FrontalFace` model.
42 3. [Draw(lineThickness=3)](api_docs/plugins/gui.md#drawtransform): Take the rectangles detected by [Cascade](api_docs/plugins/metadata.md#cascadetransform) and draw them onto the frame from the webcam. `lineThickness` determines the thickness of the drawn rectangle. 42 3. [Draw(lineThickness=3)](api_docs/plugins/gui.md#drawtransform): Take the rectangles detected by [Cascade](api_docs/plugins/metadata.md#cascadetransform) and draw them onto the frame from the webcam. `lineThickness` determines the thickness of the drawn rectangle.
43 4. [Show(false)](api_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. 43 4. [Show(false)](api_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.
44 44
45 -Each Transform completes one task and the passes the output on to the next Transform. You can pipe together as many Transforms as you like, but note that certain Transforms have specific expectations for their input. 45 +Each [Transform](api_docs/cpp_api/transform/transform.md) completes one task and the passes the output on to the next [Transform](api_docs/cpp_api/transform/transform.md). You can pipe together as many [Transform](api_docs/cpp_api/transform/transform.md)s as you like, but note that certain [Transform](api_docs/cpp_api/transform/transform.md)s have specific expectations for their input.
46 46
47 You may be wondering what objects are actually being propagated through the algorithm pipeline. There are two objects that handle data in OpenBR: 47 You may be wondering what objects are actually being propagated through the algorithm pipeline. There are two objects that handle data in OpenBR:
48 48
49 * [File](api_docs/cpp_api/file/file.md)s are typically used to store the path to a file on disk with associated metadata (in the form of key-value pairs). In the example above, we store the rectangles detected by [Cascade](api_docs/plugins/metadata.md#cascadetransform) as metadata which are then used by [Draw](api_docs/plugins/gui.md#drawtransform) for visualization. 49 * [File](api_docs/cpp_api/file/file.md)s are typically used to store the path to a file on disk with associated metadata (in the form of key-value pairs). In the example above, we store the rectangles detected by [Cascade](api_docs/plugins/metadata.md#cascadetransform) as metadata which are then used by [Draw](api_docs/plugins/gui.md#drawtransform) for visualization.
50 * [Template](api_docs/cpp_api/template/template.md)s are containers for images and [File](api_docs/cpp_api/file/file.md)s. Images in OpenBR are OpenCV Mats and are member variables of Templates. Templates can contain one or more images. 50 * [Template](api_docs/cpp_api/template/template.md)s are containers for images and [File](api_docs/cpp_api/file/file.md)s. Images in OpenBR are OpenCV Mats and are member variables of Templates. Templates can contain one or more images.
51 51
52 -If you want to learn more about the [command line](api_docs/cl_api.md) or the [plugins, and the key data structures](api_docs/cpp_api.md), the next few tutorials will cover these fields with more depth. 52 +If you want to learn more about the [command line](api_docs/cl_api.md) or [all of the plugins and the key data structures](api_docs/cpp_api.md), please refer to the linked documentation. The next few tutorials will explore algorithms and their use in more depth.
53 53
54 --- 54 ---
55 55
@@ -142,7 +142,7 @@ Easy enough? You should see results printed to terminal that look like @@ -142,7 +142,7 @@ Easy enough? You should see results printed to terminal that look like
142 $ Loading /usr/local/share/openbr/models/transforms//FaceRecognitionExtraction 142 $ Loading /usr/local/share/openbr/models/transforms//FaceRecognitionExtraction
143 $ Loading /usr/local/share/openbr/models/transforms//FaceRecognitionEmbedding 143 $ Loading /usr/local/share/openbr/models/transforms//FaceRecognitionEmbedding
144 $ Loading /usr/local/share/openbr/models/transforms//FaceRecognitionQuantization 144 $ Loading /usr/local/share/openbr/models/transforms//FaceRecognitionQuantization
145 - $Comparing ../data/MEDS/img/S354-01-t10_01.jpg and ../data/MEDS/img/S354-02-t10_01.jpg 145 + $ Comparing ../data/MEDS/img/S354-01-t10_01.jpg and ../data/MEDS/img/S354-02-t10_01.jpg
146 $ Enrolling ../data/MEDS/img/S354-01-t10_01.jpg to S354-01-t10_01r7Rv4W.mem 146 $ Enrolling ../data/MEDS/img/S354-01-t10_01.jpg to S354-01-t10_01r7Rv4W.mem
147 $ 100.00% ELAPSED=00:00:00 REMAINING=00:00:00 COUNT=1 147 $ 100.00% ELAPSED=00:00:00 REMAINING=00:00:00 COUNT=1
148 $ 100.00% ELAPSED=00:00:00 REMAINING=00:00:00 COUNT=1 148 $ 100.00% ELAPSED=00:00:00 REMAINING=00:00:00 COUNT=1
@@ -155,24 +155,27 @@ Easy enough? You should see results printed to terminal that look like @@ -155,24 +155,27 @@ Easy enough? You should see results printed to terminal that look like
155 155
156 So what is 'FaceRecognition'? It's an abbrieviation to make running the algorithm easier. All of the algorithm abbreviations are located in ```openbr/plugins/core/algorithms.cpp```. 156 So what is 'FaceRecognition'? It's an abbrieviation to make running the algorithm easier. All of the algorithm abbreviations are located in ```openbr/plugins/core/algorithms.cpp```.
157 157
158 -It is also possible to evaluate face recognition performance (Note that this requires [R](http://www.r-project.org/) to be installed): 158 +It is also possible to:
159 159
160 - $ br -algorithm FaceRecognition -path ../data/MEDS/img/ \  
161 - -enroll ../data/MEDS/sigset/MEDS_frontal_target.xml target.gal \  
162 - -enroll ../data/MEDS/sigset/MEDS_frontal_query.xml query.gal \  
163 - -compare target.gal query.gal scores.mtx \  
164 - -makeMask ../data/MEDS/sigset/MEDS_frontal_target.xml ../data/MEDS/sigset/MEDS_frontal_query.xml MEDS.mask \  
165 - -eval scores.mtx MEDS.mask Algorithm_Dataset/FaceRecognition_MEDS.csv \  
166 - -plot Algorithm_Dataset/FaceRecognition_MEDS.csv MEDS 160 +* Evaluate face recognition performance (Note that this requires [R](http://www.r-project.org/) to be installed):
167 161
168 -Perform a 1:N face recognition search: 162 + $ br -algorithm FaceRecognition -path ../data/MEDS/img/ \
  163 + -enroll ../data/MEDS/sigset/MEDS_frontal_target.xml target.gal \
  164 + -enroll ../data/MEDS/sigset/MEDS_frontal_query.xml query.gal \
  165 + -compare target.gal query.gal scores.mtx \
  166 + -makeMask ../data/MEDS/sigset/MEDS_frontal_target.xml ../data/MEDS/sigset/MEDS_frontal_query.xml MEDS.mask \
  167 + -eval scores.mtx MEDS.mask Algorithm_Dataset/FaceRecognition_MEDS.csv \
  168 + -plot Algorithm_Dataset/FaceRecognition_MEDS.csv MEDS
  169 +
169 170
170 - $ br -algorithm FaceRecognition -enrollAll -enroll ../data/MEDS/img 'meds.gal;meds.csv[separator=;]'  
171 - $ br -algorithm FaceRecognition -compare meds.gal ../data/MEDS/img/S001-01-t10_01.jpg match_scores.csv 171 +* Perform a 1:N face recognition search:
172 172
173 -Or, train a new face recognition algorithm (on a different dataset): 173 + $ br -algorithm FaceRecognition -enrollAll -enroll ../data/MEDS/img 'meds.gal'
  174 + $ br -algorithm FaceRecognition -compare meds.gal ../data/MEDS/img/S001-01-t10_01.jpg match_scores.csv
174 175
175 - $ br -algorithm 'Open+Cvt(Gray)+Cascade(FrontalFace)+ASEFEyes+Affine(128,128,0.33,0.45)+(Grid(10,10)+SIFTDescriptor(12)+ByRow)/(Blur(1.1)+Gamma(0.2)+DoG(1,2)+ContrastEq(0.1,10)+LBP(1,2)+RectRegions(8,8,6,6)+Hist(59))+PCA(0.95)+Normalize(L2)+Dup(12)+RndSubspace(0.05,1)+LDA(0.98)+Cat+PCA(0.95)+Normalize(L1)+Quantize:NegativeLogPlusOne(ByteL1)' -train ../data/ATT/img FaceRecognitionATT 176 +* Train a new face recognition algorithm (on a different dataset):
  177 +
  178 + $ br -algorithm 'Open+Cvt(Gray)+Cascade(FrontalFace)+ASEFEyes+Affine(128,128,0.33,0.45)+(Grid(10,10)+SIFTDescriptor(12)+ByRow)/(Blur(1.1)+Gamma(0.2)+DoG(1,2)+ContrastEq(0.1,10)+LBP(1,2)+RectRegions(8,8,6,6)+Hist(59))+PCA(0.95)+Normalize(L2)+Dup(12)+RndSubspace(0.05,1)+LDA(0.98)+Cat+PCA(0.95)+Normalize(L1)+Quantize:NegativeLogPlusOne(ByteL1)' -train ../data/ATT/img FaceRecognitionATT
176 179
177 The entire command line API is documented [here](api_docs/cl_api.md). 180 The entire command line API is documented [here](api_docs/cl_api.md).
178 181
@@ -180,14 +183,14 @@ The entire command line API is documented [here](api_docs/cl_api.md). @@ -180,14 +183,14 @@ The entire command line API is documented [here](api_docs/cl_api.md).
180 183
181 # Age Estimation 184 # Age Estimation
182 185
183 -Age Estimation is very similar in spirit to [Face Recognition](#face-recognition) and will be covered in far less detail. 186 +Age estimation is very similar in spirit to [Face Recognition](#face-recognition) and will be covered in far less detail.
184 187
185 -To implement Age Estimation from the command line you can run 188 +To perform age estimation from the command line you can run:
186 189
187 $ br -algorithm AgeEstimation \ 190 $ br -algorithm AgeEstimation \
188 -enroll ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S001-01-t10_01.jpg metadata.csv 191 -enroll ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S001-01-t10_01.jpg metadata.csv
189 192
190 -The results will be stored in metadata.csv under the key 'Age'. Remember from the [Face Recognition](#face-recognition) 'AgeEstimation' is just an abbreviation for the full algorithm description. The expanded version is stored in ```openbr/plugins/core/algorithms.cpp```. 193 +The results will be stored in metadata.csv under the key 'Age'. Remember from the [Face Recognition](#face-recognition) tutorial that `AgeEstimation` is just an abbreviation for the full algorithm description.
191 194
192 The source code to run age estimation as an application is in ```app/examples/age_estimation.cpp``` 195 The source code to run age estimation as an application is in ```app/examples/age_estimation.cpp```
193 196
@@ -195,14 +198,14 @@ The source code to run age estimation as an application is in ```app/examples/ag @@ -195,14 +198,14 @@ The source code to run age estimation as an application is in ```app/examples/ag
195 198
196 # Gender Estimation 199 # Gender Estimation
197 200
198 -Gender Estimation is very similar in spirit to [Face Recognition](#face-recognition) and will be covered in far less detail. 201 +As with age estimation, gender estimation is very similar in spirit to [Face Recognition](#face-recognition) and will be covered in far less detail.
199 202
200 -To implement Gender Estimation from the command line you can run 203 +To perform gender estimation from the command line you can run:
201 204
202 $ br -algorithm GenderEstimation \ 205 $ br -algorithm GenderEstimation \
203 -enroll ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S001-01-t10_01.jpg metadata.csv 206 -enroll ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S001-01-t10_01.jpg metadata.csv
204 207
205 -The results will be stored in metadata.csv under the key 'Gender'. Remember from the [Face Recognition](#face-recognition) 'GenderEstimation' is just an abbreviation for the full algorithm description. The expanded version is stored in ```openbr/plugins/core/algorithms.cpp```. 208 +The results will be stored in metadata.csv under the key 'Gender'. Remember from the [Face Recognition](#face-recognition) tutorial that `GenderEstimation` is just an abbreviation for the full algorithm description.
206 209
207 The source code to run gender estimation as an application is in ```app/examples/gender_estimation.cpp``` 210 The source code to run gender estimation as an application is in ```app/examples/gender_estimation.cpp```
208 211
@@ -212,11 +215,11 @@ The source code to run gender estimation as an application is in ```app/examples @@ -212,11 +215,11 @@ The source code to run gender estimation as an application is in ```app/examples
212 215
213 OpenBR exposes a [C++ API](api_docs/cpp_api.md) that can be embedded into your own applications. Let's step through the example code at ```app/example/face_recognition.cpp``` and learn about using OpenBR as a library. 216 OpenBR exposes a [C++ API](api_docs/cpp_api.md) that can be embedded into your own applications. Let's step through the example code at ```app/example/face_recognition.cpp``` and learn about using OpenBR as a library.
214 217
215 -Our main function starts with- 218 +Our main function starts with:
216 219
217 br::Context::initialize(argc, argv) 220 br::Context::initialize(argc, argv)
218 221
219 -This is the first step in any OpenBR application, it initializes the global context. 222 +This is the first step in any OpenBR-based application, it initializes the global context.
220 223
221 QSharedPointer<br::Transform> transform = br::Transform::fromAlgorithm("FaceRecognition"); 224 QSharedPointer<br::Transform> transform = br::Transform::fromAlgorithm("FaceRecognition");
222 QSharedPointer<br::Distance> distance = br::Distance::fromAlgorithm("FaceRecognition"); 225 QSharedPointer<br::Distance> distance = br::Distance::fromAlgorithm("FaceRecognition");
@@ -227,29 +230,29 @@ Here, we split our algorithm into *enrollment* ([Transform](api_docs/cpp_api/tra @@ -227,29 +230,29 @@ Here, we split our algorithm into *enrollment* ([Transform](api_docs/cpp_api/tra
227 br::Template queryB("../data/MEDS/img/S382-08-t10_01.jpg"); 230 br::Template queryB("../data/MEDS/img/S382-08-t10_01.jpg");
228 br::Template target("../data/MEDS/img/S354-02-t10_01.jpg"); 231 br::Template target("../data/MEDS/img/S354-02-t10_01.jpg");
229 232
230 -These lines create our [Templates](api_docs/cpp_api/template/template.md) for enrollment. They are just images loaded from disk. For this example queryA is the same person (different picture) as target and queryB is a different person. 233 +These lines create our [Template](api_docs/cpp_api/template/template.md)s for enrollment. At this point, the Templates simply store the file path to the specified image on disk. In this example, `queryA` depicts the same person as `target` (often referred to as a *genuine match*) and `queryB` depicts a different person from `target` (often referred to as an *impostor match*).
231 234
232 queryA >> *transform; 235 queryA >> *transform;
233 queryB >> *transform; 236 queryB >> *transform;
234 target >> *transform; 237 target >> *transform;
235 238
236 -And now we enroll them! **>>** is a convienience operator for enrolling [Templates](api_docs/cpp_api/template/template.md) in [Transforms](api_docs/cpp_api/transform/transform.md). The enrollment is done in-place, which means the output overwrites the input. Our [Templates](api_docs/cpp_api/template/template.md) now store the results of enrollment. 239 +`>>` is a convienience operator for enrolling [Template](api_docs/cpp_api/template/template.md)s in [Transform](api_docs/cpp_api/transform/transform.md)s. Thus, at this stage, our [Template](api_docs/cpp_api/template/template.md)s now store the images enrolled via the `FaceRecognition` algorithm.
237 240
238 float comparisonA = distance->compare(target, queryA); 241 float comparisonA = distance->compare(target, queryA);
239 float comparisonB = distance->compare(target, queryB); 242 float comparisonB = distance->compare(target, queryB);
240 243
241 -Compare our query [Templates](api_docs/cpp_api/template/template.md) against the target [Template](api_docs/cpp_api/template/template.md). The result is a float. 244 +We then compare our query [Template](api_docs/cpp_api/template/template.md)s against the target [Template](api_docs/cpp_api/template/template.md). The result is a floating point value indicating similarity.
242 245
243 printf("Genuine match score: %.3f\n", comparisonA); 246 printf("Genuine match score: %.3f\n", comparisonA);
244 printf("Impostor match score: %.3f\n", comparisonB); 247 printf("Impostor match score: %.3f\n", comparisonB);
245 248
246 -Print out our results. You can see that comparisonA (between queryA and target) has a higher score then comparisonB, which is exactly what we expect! 249 +After printing the results, you can see that `comparisonA` (between `queryA` and `target`) has a higher similarity score then `comparisonB`, which is exactly what we expect!
247 250
248 br::Context::finalize(); 251 br::Context::finalize();
249 252
250 -The last line in any OpenBR application has to be call to finalize. This shuts down OpenBR. 253 +The last line in any OpenBR application has to be call to `finalize`. This functions performs the clean up of OpenBR.
251 254
252 -And that's it! Now you can embed face recognition into all of your applications. 255 +That's it! You can now embed face recognition into all of your applications.
253 256
254 --- 257 ---
255 258
@@ -257,13 +260,13 @@ And that&#39;s it! Now you can embed face recognition into all of your applications. @@ -257,13 +260,13 @@ And that&#39;s it! Now you can embed face recognition into all of your applications.
257 260
258 OpenBR implements a complete, [NIST](http://www.nist.gov/index.html) compliant, evaluation harness for evaluating face recognition, face detection, and facial landmarking. The goal is to provide a consistent environment for the repeatable evaluation of algorithms to the academic and open source communities. To accompish this OpenBR defines the following portions of the biometrics evaluation environment (BEE) standard- 261 OpenBR implements a complete, [NIST](http://www.nist.gov/index.html) compliant, evaluation harness for evaluating face recognition, face detection, and facial landmarking. The goal is to provide a consistent environment for the repeatable evaluation of algorithms to the academic and open source communities. To accompish this OpenBR defines the following portions of the biometrics evaluation environment (BEE) standard-
259 262
260 -* Signature Set- A signature set (or *sigset*) is a [Gallery](api_docs/cpp_api/gallery/gallery.md) compliant **XML** file-list specified on page 9 of the [MBGC File Overview](misc/MBGC_file_overview.pdf) and implemented in [xmlGallery](api_docs/plugins/gallery.md#xmlgallery). Sigsets are identified with a **.xml** extension. 263 +* Signature set - A signature set (or *sigset*) is an XML file-list specified on page 9 of the [MBGC File Overview](misc/MBGC_file_overview.pdf) and is implemented in [xmlGallery](api_docs/plugins/gallery.md#xmlgallery). Sigsets are identified with an `.xml` extension.
261 264
262 -* Similarity Matrix- A similarity matrix (or *simmat*) is an [Output](api_docs/cpp_api/output/output.md) compliant binary score matrix specified on page 12 of the [MBGC File Overview](misc/MBGC_file_overview.pdf) and implemented in [mtxOutput](api_docs/plugins/output.md#mtxoutput). Simmats are identified with a **.mtx** extension. See [br_eval](api_docs/c_api/functions.md#br_eval) for more information. 265 +* Similarity matrix - A similarity matrix (or *simmat*) is a binary score matrix specified on page 12 of the [MBGC File Overview](misc/MBGC_file_overview.pdf) and is implemented in [mtxOutput](api_docs/plugins/output.md#mtxoutput). Simmats are identified with a `.mtx` extension. See [br_eval](api_docs/c_api/functions.md#br_eval) for more information.
263 266
264 -* Mask Matrix- A mask matrix (or *mask*) is a binary matrix specified on page 14 of the [MBGC File Overview](misc/MBGC_file_overview.pdf) identifying the ground truth genuines and impostors of a corresponding *simmat*. Masks are identified with a **.mask** extension. See [br_make_mask](api_docs/c_api/functions.md#br_make_mask) and [br_combine_masks](api_docs/c_api/functions.md#br_combine_masks) for more information. 267 +* Mask matrix - A mask matrix (or *mask*) is a binary matrix specified on page 14 of the [MBGC File Overview](misc/MBGC_file_overview.pdf) identifying the genuine and impostor matches within a corresponding *simmat*. Masks are identified with a `.mask` extension. See [br_make_mask](api_docs/c_api/functions.md#br_make_mask) and [br_combine_masks](api_docs/c_api/functions.md#br_combine_masks) for more information.
265 268
266 -The evaluation harness is also accessible from the command line! Please see [-eval](api_docs/cl_api.md#eval), [-evalDetection](api_docs/cl_api.md#evaldetection), [-evalLandmarking](api_docs/cl_api.md#evallandmarking), [-evalClassification](api_docs/cl_api.md#evalclassification), [-evalClustering](api_docs/cl_api.md#evalclustering), or [-evalRegression](api_docs/cl_api.md#evalregression) for relevant information. 269 +The evaluation harness is also accessible from the command line. See [-eval](api_docs/cl_api.md#eval), [-evalDetection](api_docs/cl_api.md#evaldetection), [-evalLandmarking](api_docs/cl_api.md#evallandmarking), [-evalClassification](api_docs/cl_api.md#evalclassification), [-evalClustering](api_docs/cl_api.md#evalclustering), or [-evalRegression](api_docs/cl_api.md#evalregression) for relevant information.
267 270
268 [^1]: *Matthew Turk and Alex Pentland.* 271 [^1]: *Matthew Turk and Alex Pentland.*
269 **Eigenfaces for recognition.** 272 **Eigenfaces for recognition.**