Skip to content

Best shot example with TrackEngine#

What it does#

This example demonstrates how to use the TrackEngine to track human face detection and to check him with eye estimation status. This example shows how to pick frame with the best quality face out of video sequence. You can find binary of this example in FSDK_ROOT/examples/bin/possible_output_prefix. BestShot example can display the following results:

  • accepted - user blinked
  • denied - user did not blink

Prerequisites#

This example assumes that you have read the FaceEngine Handbook and TrackEngine Handbook already (or at least have it somewhere nearby for reference) and are familiar with some core concepts, like memory management, object ownership and life-time control. This sample will not explain these aspects in detail.

Requirements

OpenCV library installation containing next modules:

  • highgui
  • imgproc
  • videoio

Example walkthrough#

To get familiar with FSDK and TSDK usage and common practices, please go through example_estimation first.

How to run#

This example can be run without parameters in this case a video camera with index 0 will be used,

./example_bestshot_trackengine

or you can pass the number of video cameras:

./example_bestshot_trackengine 2

Building for Linux#

Building command (from FSDK_ROOT/examples/build):

$ cmake -DFSDK_ROOT=<absolute_path_to_fsdk_root_dir> -DTSDK_ROOT=<absolute_path_to_fsdk_root_dir> -DWITH_BESTSHOT_EXAMPLE=ON -DOpenCV_DIR=<abs_path_to_opencv> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=<absolute_path_to_fsdk_root_dir>/examples -DCMAKE_MODULE_PATH=<absolute_path_to_fsdk_root_dir>/examples/cmake ../example_bestshot_trackengine
$ cmake --build . --config Release --target install

Building for Windows#

Building command (from FSDK_ROOT/examples/build):

$ cmake -G "Visual Studio 14 2015 Win64" -DFSDK_ROOT=<absolute_path_to_fsdk_root_dir> -DTSDK_ROOT=<absolute_path_to_fsdk_root_dir> -DWITH_BESTSHOT_EXAMPLE=ON -DOpenCV_DIR=<abs_path_to_opencv> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=<absolute_path_to_fsdk_root_dir>/examples -DCMAKE_MODULE_PATH=<absolute_path_to_fsdk_root_dir>/examples/cmake ../example_bestshot_trackengine
$ cmake --build . --config Release --target install

Running on Linux#

There is prebuilt demo, see FSDK_ROOT/examples/bin/possible_output_prefix/ . To run it change your working directory to FSDK_ROOT and type:

$ ./examples/bin/*possible_output_prefix*/./example_bestshot_trackengine

Running on Windows#

For Windows you will have to to run bat script that is in the same directory as ./example_bestshot_trackengine.exe. It's win32_copy_script.bat for win32 and win64_copy_script.bat for win64. So for Windows, to run demo you will have to type:

$ .\examples\bin\*possible_output_prefix*\win32_copy_script.bat
$ .\examples\bin\*possible_output_prefix*\example_bestshot_trackengine.exe

or:

$ .\examples\bin\*possible_output_prefix*\win64_copy_script.bat
$ .\examples\bin\*possible_output_prefix*\example_bestshot_trackengine.exe
Back to top