2,599
edits
Efernandez (talk | contribs) |
Efernandez (talk | contribs) |
||
Line 82: | Line 82: | ||
== Redaction Algorithm == | == Redaction Algorithm == | ||
The Object Redaction library | The Object Redaction library comprises the following stages: detect, track (optional), and redact. These stages can be performed in a single step using the '''apply''' method or in a step-by-step process. | ||
The Object Redaction library | The Object Redaction library uses a vector of a structure Rectangle to save the detected and tracked faces coordinates in an image for the redaction algorithm to modify the output buffer. This vector must be initialized before performing the detect stage. | ||
<syntaxhighlight lang=cpp> | <syntaxhighlight lang=cpp> | ||
Line 92: | Line 92: | ||
=== Step-by-step === | === Step-by-step === | ||
* | * The first step is to detect the faces in the input image and save the coordinates in the vector of rectangles. | ||
<syntaxhighlight lang=cpp> | <syntaxhighlight lang=cpp> | ||
algorithm-> | algorithm->detect(model, input_gpu, &faces); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''NOTE:''' Since the detection model usually works with a fixed resolution and format, an internal conversion to the resolution and format expected by the model. This is transparent so the user doesn't have to worry about any conversion, however, a convert method is also available in case the user wants to do this conversion before calling the detect method. | |||
<syntaxhighlight lang=cpp> | <syntaxhighlight lang=cpp> | ||
algorithm-> | algorithm->convert(input_gpu, input_convert); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* The second and optional step would be to perform tracking (this is a work in progress) | |||
* The final step is to redact the detected faces in the given coordinates. | * The final step is to redact the detected faces in the given coordinates. |