Skip to content

Best shot example#

This example shows how to pick frame with the best quality face out of video sequence. This example is shipped as prebuilt library too, you can find its binary and headers in FSDK_ROOT/examples/possible_output_prefix/lib and FSDK_ROOT/examples/include, dll files are in FSDK_ROOT/examples/possible_output_prefix/bin folder. BestShot example can display the following results:

  • accepted - user blinked
  • denied - user did not blink
  • fraud - primary detection has changed, someone else is in the frame.

Please note, it is possible to have 'accepted' or 'denied' result display simultaneously with 'fraud' if there is someone else in front of the camera besides the user.

Requirements

OpenCV library installation containing next modules:

  • core
  • imgproc
  • imgcodecs

Building for linux#

Building command (from FSDK_ROOT/examples/build):

$ cmake -DFSDK_ROOT=<absolute_path_to_fsdk_root_dir> -DOpenCV_DIR=<abs_path_to_opencv> -DPM_WITH_DEMO=ON -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
$ make install

Building for windows x64#

Building command (from FSDK_ROOT/examples/build):

$ cmake -G "Visual Studio 15 2017 Win64" -DFSDK_ROOT=<absolute_path_to_fsdk_root_dir> -DOpenCV_DIR=<abs_path_to_opencv> -DPM_WITH_DEMO=ON -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
$ 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*/PhotoMakerDemo

Running on windows#

For windows you will have to to run bat script that is in the same directory as PhotoMakerDemo.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*\PhotoMakerDemo.exe

or:

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