ShowcaseDemo
Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
ShowcaseDemo.MainWindow Class Reference

VisageSDK ShowcaseDemo application MainWindow class. More...

Inherits Window.

Public Member Functions

 MainWindow ()
 Main entry point of the application. More...
 

Private Member Functions

void ClearFaceRecognition ()
 Reset all the face recognition variables including gallery. More...
 
void InitializeFaceRecognition ()
 Initialize face recognition buffer variables. More...
 
void ResetFRInitialization (int index=-1)
 Reinitialize face recognition variables used during face recognition initialization phase. More...
 
void InitializeFaceAnalysis ()
 Reinitialize face analysis variables for storing data. More...
 
void ResetFaceAnalysis (int index)
 Clears face analysis data and smoothing data for the specific face. More...
 
void worker_DoWorkImage (object sender, DoWorkEventArgs e)
 Worker event for tracking/detection from an image source that runs in a separate thread. More...
 
void worker_DoWorkCam (object sender, DoWorkEventArgs e)
 Worker event for tracking from camera that runs in a separate thread. More...
 
void convertFromBGRToRGB (ref byte[] outputRGB, ref byte[] inputBGR)
 Converts BGR image obtained from camera to RGB image. More...
 
void worker_DoWorkVideo (object sender, DoWorkEventArgs e)
 Worker event for tracking from video that runs in a separate thread. More...
 
void worker_DoWorkMatchFace (object sender, DoWorkEventArgs e)
 Worker event for face recognition that runs in a separate thread. More...
 
void worker_DoAnalyzeFace (object sender, DoWorkEventArgs e)
 Worker event for face analysis that runs in a separate thread. More...
 
void AnalyzeFace (VSImage frame, FaceData faceData, int index=0)
 Performs face analysis on an image based on the input face data object. More...
 
void RecognizeFace (VSImage frame, FaceData faceDatas, int index=0)
 Performs face recognition on an image based on the input face data array. More...
 
void openGLControl_OpenGLDraw (object sender, OpenGLEventArgs args)
 Handles the OpenGLDraw event of the openGLControl control. More...
 
void trackerDisplay ()
 Calls the VisageRendering' DisplayResults function. More...
 
void detectorDisplay ()
 Calls the Calls the VisageRendering' DisplayResults function for every detected face. More...
 
void runTrackFromVideo (string file)
 Demonstrates running a new tracking thread for tracking from video. More...
 
void runTrackFromImage (string file, VISAGE_MODE activeMode)
 Demonstrates running a new tracking thread for tracking from image. More...
 
void runTrackFromCam ()
 Demonstrates running a new tracking thread for tracking from camera. More...
 
void runFaceRecognition (VSImage frame, FaceData[] faceDatas, int[] trackerStatus)
 Demonstrates running face recognition in a background thread. More...
 
void runFaceAnalysis (VSImage frame, FaceData[] faceData, int[] trackerStatus)
 Demonstrates running face analysis in a background thread. More...
 
void changeButtonStyle (INPUT_MODE mode)
 Change button style (camera, video or image buttons) depending on the chosen INPUT_MODE More...
 
void changeConfStyle (object sender)
 Change radio button style (configuration choice) depending on the chose configuration More...
 
void trackerDetectorButton_Click (object sender, RoutedEventArgs e)
 Toggles application mode from TRACKER to DETECTOR and vice versa. More...
 
void enableAgeEstimCheckbox ()
 Enable age estimation checkbox and change to appropriate color. More...
 
void disableAgeEstimCheckbox ()
 Disable age estimation checkbox and change color for the use case when one channel or four channel is loaded (age estimation is supported for 3 channel images only) or when in Detector mode More...
 
void enableEmotionEstimCheckbox ()
 Enable emotion estimation checkbox and change to appropriate color. More...
 
void disableEmotionEstimCheckbox ()
 Disable emotion estimation checkbox and change color for the use case when in Detector mode More...
 
void enableGenderEstimCheckbox ()
 Enable gender estimation checkbox and change to appropriate color. More...
 
void disableGenderEstimCheckbox ()
 Disable gender estimation checkbox and change color for the use case when in Detector mode More...
 
void enableEarsCheckbox ()
 Enable Ears checkbox and change color for the use case when not in Detector mode More...
 
void disableEarsCheckbox ()
 Disable Ears checkbox and change color for the use case when in Detector mode More...
 
void loadGalleryButton_Click (object sender, RoutedEventArgs e)
 Load face recognition gallery (.frg) from file. More...
 
void saveGalleryButton_Click (object sender, RoutedEventArgs e)
 Save face recognition gallery (.frg) to a file. More...
 
void clearGalleryButton_Click (object sender, RoutedEventArgs e)
 Clear face recognition GUI element representing the gallery. More...
 
void FillNames ()
 A helper function used for populating the GUI element representing face recognition gallery from a variable. More...
 
void OnNameTextChanged (object sender, TextChangedEventArgs e)
 A helper function for renaming a descriptor once it is added to the GUI element representing face recognition gallery. More...
 
void AdjustAspect (ref FaceData faceData, ref int width, ref int height)
 Adjust aspect of the rendered image on window resize. More...
 
VSImage LoadImage (string path)
 Helper functions for loading image from image path. More...
 

Static Private Member Functions

static byte[] BitmapToByteArray (Bitmap bitmap, ref int stride)
 Helper function for converting image data from Bitmap class to a raw byte array. More...
 

Detailed Description

VisageSDK ShowcaseDemo application MainWindow class.

Demonstrates multi-threaded implementation and usage of visage|SDK C# wrapper.

Definition at line 163 of file ShowcaseDemo.xaml.cs.

Constructor & Destructor Documentation

ShowcaseDemo.MainWindow.MainWindow ( )
inline

Main entry point of the application.

Creates instances of VisageTracker, VisageFeaturesDetector and VisageFaceAnalyser objects and demonstrates license initialization. Also initializes OpenGL rendering.

Starts tracking from camera, as a default mode.

Definition at line 273 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VisageFaceAnalyser.Init(), ShowcaseDemo.MainWindow.InitializeFaceAnalysis(), ShowcaseDemo.MainWindow.InitializeFaceRecognition(), and ShowcaseDemo.MainWindow.LoadImage().

Member Function Documentation

void ShowcaseDemo.MainWindow.AdjustAspect ( ref FaceData  faceData,
ref int  width,
ref int  height 
)
inlineprivate

Adjust aspect of the rendered image on window resize.

Parameters
faceDataInput FaceData object which contains the frame necessary for adjusting aspect.
widthWidth that will be adjusted.
heightHeight that will be adjusted.

Definition at line 2238 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VSImage.height, and VisageCSWrapper::VSImage.width.

Referenced by ShowcaseDemo.MainWindow.detectorDisplay(), and ShowcaseDemo.MainWindow.trackerDisplay().

void ShowcaseDemo.MainWindow.AnalyzeFace ( VSImage  frame,
FaceData  faceData,
int  index = 0 
)
inlineprivate

Performs face analysis on an image based on the input face data object.

Used in worker_DoAnalyzeFace() function.

Performs age, gender or emotion analysis depending on the check-boxes selected and which features of the VisageFaceAnalyser are available.

Parameters
frameInput frame on which the face analysis is performed.
faceDataInput FaceData object on which the face analysis is performed.
indexThe corresponding index of the FaceData object in the FaceData array matching the index of the age, gender array or emotion list.

Definition at line 998 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VisageFaceAnalyser.analyseImage(), and VisageCSWrapper::VisageFaceAnalyser.analyseStream().

Referenced by ShowcaseDemo.MainWindow.worker_DoAnalyzeFace(), and ShowcaseDemo.MainWindow.worker_DoWorkImage().

static byte [] ShowcaseDemo.MainWindow.BitmapToByteArray ( Bitmap  bitmap,
ref int  stride 
)
inlinestaticprivate

Helper function for converting image data from Bitmap class to a raw byte array.

Parameters
bitmapBitmap image.
strideImage stride.
Returns

Definition at line 461 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.changeButtonStyle ( INPUT_MODE  mode)
inlineprivate

Change button style (camera, video or image buttons) depending on the chosen INPUT_MODE

Parameters
modechosen INPUT_MODE

Definition at line 1557 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.changeConfStyle ( object  sender)
inlineprivate

Change radio button style (configuration choice) depending on the chose configuration

Parameters
sendersender object from the click event

Definition at line 1588 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.ClearFaceRecognition ( )
inlineprivate

Reset all the face recognition variables including gallery.

Called when gallery is cleared.

Definition at line 332 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VisageFaceRecognition.ResetGallery().

Referenced by ShowcaseDemo.MainWindow.clearGalleryButton_Click().

void ShowcaseDemo.MainWindow.clearGalleryButton_Click ( object  sender,
RoutedEventArgs  e 
)
inlineprivate

Clear face recognition GUI element representing the gallery.

It will also clear all the buffers for every face.

Parameters
sender
e

Definition at line 1914 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.ClearFaceRecognition().

void ShowcaseDemo.MainWindow.convertFromBGRToRGB ( ref byte[]  outputRGB,
ref byte[]  inputBGR 
)
inlineprivate

Converts BGR image obtained from camera to RGB image.

Image has to be converted to RGB format when VisageFaceAnalyser is used.

Definition at line 765 of file ShowcaseDemo.xaml.cs.

Referenced by ShowcaseDemo.MainWindow.worker_DoWorkCam(), ShowcaseDemo.MainWindow.worker_DoWorkImage(), and ShowcaseDemo.MainWindow.worker_DoWorkVideo().

void ShowcaseDemo.MainWindow.detectorDisplay ( )
inlineprivate

Calls the Calls the VisageRendering' DisplayResults function for every detected face.

Called in a separate thread controlled by openGLControl_OpenGLDraw() function when the active application mode is set to DETECTOR mode.

Definition at line 1301 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.AdjustAspect().

Referenced by ShowcaseDemo.MainWindow.openGLControl_OpenGLDraw().

void ShowcaseDemo.MainWindow.disableAgeEstimCheckbox ( )
inlineprivate

Disable age estimation checkbox and change color for the use case when one channel or four channel is loaded (age estimation is supported for 3 channel images only) or when in Detector mode

Definition at line 1748 of file ShowcaseDemo.xaml.cs.

Referenced by ShowcaseDemo.MainWindow.worker_DoWorkCam(), ShowcaseDemo.MainWindow.worker_DoWorkImage(), and ShowcaseDemo.MainWindow.worker_DoWorkVideo().

void ShowcaseDemo.MainWindow.disableEarsCheckbox ( )
inlineprivate

Disable Ears checkbox and change color for the use case when in Detector mode

Definition at line 1823 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.disableEmotionEstimCheckbox ( )
inlineprivate

Disable emotion estimation checkbox and change color for the use case when in Detector mode

Definition at line 1773 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.disableGenderEstimCheckbox ( )
inlineprivate

Disable gender estimation checkbox and change color for the use case when in Detector mode

Definition at line 1798 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.enableAgeEstimCheckbox ( )
inlineprivate

Enable age estimation checkbox and change to appropriate color.

Definition at line 1734 of file ShowcaseDemo.xaml.cs.

Referenced by ShowcaseDemo.MainWindow.worker_DoWorkCam(), and ShowcaseDemo.MainWindow.worker_DoWorkVideo().

void ShowcaseDemo.MainWindow.enableEarsCheckbox ( )
inlineprivate

Enable Ears checkbox and change color for the use case when not in Detector mode

Definition at line 1810 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.enableEmotionEstimCheckbox ( )
inlineprivate

Enable emotion estimation checkbox and change to appropriate color.

Definition at line 1760 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.enableGenderEstimCheckbox ( )
inlineprivate

Enable gender estimation checkbox and change to appropriate color.

Definition at line 1785 of file ShowcaseDemo.xaml.cs.

void ShowcaseDemo.MainWindow.FillNames ( )
inlineprivate

A helper function used for populating the GUI element representing face recognition gallery from a variable.

Definition at line 1922 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.OnNameTextChanged().

Referenced by ShowcaseDemo.MainWindow.loadGalleryButton_Click(), and ShowcaseDemo.MainWindow.RecognizeFace().

void ShowcaseDemo.MainWindow.InitializeFaceAnalysis ( )
inlineprivate
void ShowcaseDemo.MainWindow.InitializeFaceRecognition ( )
inlineprivate

Initialize face recognition buffer variables.

Called when the application starts.

Definition at line 355 of file ShowcaseDemo.xaml.cs.

Referenced by ShowcaseDemo.MainWindow.MainWindow().

void ShowcaseDemo.MainWindow.loadGalleryButton_Click ( object  sender,
RoutedEventArgs  e 
)
inlineprivate

Load face recognition gallery (.frg) from file.

Opens a dialog to load the gallery (.frg) file.

Parameters
sender
e

Definition at line 1843 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.FillNames(), VisageCSWrapper::VisageFaceRecognition.GetDescriptorCount(), VisageCSWrapper::VisageFaceRecognition.GetDescriptorName(), and VisageCSWrapper::VisageFaceRecognition.LoadGallery().

VSImage ShowcaseDemo.MainWindow.LoadImage ( string  path)
inlineprivate

Helper functions for loading image from image path.

Flips image.

Parameters
pathImage path
Returns

Definition at line 2279 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VSImage.imageData.

Referenced by ShowcaseDemo.MainWindow.MainWindow().

void ShowcaseDemo.MainWindow.OnNameTextChanged ( object  sender,
TextChangedEventArgs  e 
)
inlineprivate

A helper function for renaming a descriptor once it is added to the GUI element representing face recognition gallery.

Parameters
sender
e

Definition at line 1945 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VisageFaceRecognition.GetDescriptorCount(), VisageCSWrapper::VisageFaceRecognition.GetDescriptorName(), and VisageCSWrapper::VisageFaceRecognition.ReplaceDescriptorName().

Referenced by ShowcaseDemo.MainWindow.FillNames().

void ShowcaseDemo.MainWindow.openGLControl_OpenGLDraw ( object  sender,
OpenGLEventArgs  args 
)
inlineprivate

Handles the OpenGLDraw event of the openGLControl control.

Locking mechanism is used to synchronize frame and tracking results rendering (lockFaceData).

Parameters
senderThe source of the event.
argsThe SharpGL.SceneGraph.OpenGLEventArgs instance containing the event data.

Definition at line 1227 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.detectorDisplay(), and ShowcaseDemo.MainWindow.trackerDisplay().

void ShowcaseDemo.MainWindow.RecognizeFace ( VSImage  frame,
FaceData  faceDatas,
int  index = 0 
)
inlineprivate

Performs face recognition on an image based on the input face data array.

Used in worker_DoWorkMatchFace() function when INPUT_MODE is set to CAMERA or IMAGE or can be called separately.

Implements additional face recognition logic and descriptor clustering.

Parameters
frameInput frame on which the face recognition is performed.
faceDatasInput FaceData object on which the face recognition is performed.
indexThe corresponding index of the FaceData object in the FaceData array.

Definition at line 1069 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VisageFaceRecognition.AddDescriptor(), VisageCSWrapper::VisageFaceRecognition.ExtractDescriptor(), ShowcaseDemo.MainWindow.FillNames(), VisageCSWrapper::VisageFaceRecognition.GetDescriptorCount(), VisageCSWrapper::VisageFaceRecognition.GetDescriptorSize(), VisageCSWrapper::VisageFaceRecognition.IsInitialized, and VisageCSWrapper::VisageFaceRecognition.Recognize().

Referenced by ShowcaseDemo.MainWindow.worker_DoWorkImage(), and ShowcaseDemo.MainWindow.worker_DoWorkMatchFace().

void ShowcaseDemo.MainWindow.ResetFaceAnalysis ( int  index)
inlineprivate

Clears face analysis data and smoothing data for the specific face.

Parameters
indexIndex of the face corresponding to the index of the array where face analysis data is stored.

Definition at line 435 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VisageFaceAnalyser.resetStreamAnalysis().

Referenced by ShowcaseDemo.MainWindow.InitializeFaceAnalysis(), and ShowcaseDemo.MainWindow.worker_DoAnalyzeFace().

void ShowcaseDemo.MainWindow.ResetFRInitialization ( int  index = -1)
inlineprivate

Reinitialize face recognition variables used during face recognition initialization phase.

For example, when the face is lost in the middle of the initialization process.

Parameters
indexIndex of the face corresponding to the index of the array where face analysis data is stored.

Definition at line 375 of file ShowcaseDemo.xaml.cs.

Referenced by ShowcaseDemo.MainWindow.trackerDetectorButton_Click(), and ShowcaseDemo.MainWindow.worker_DoWorkMatchFace().

void ShowcaseDemo.MainWindow.runFaceAnalysis ( VSImage  frame,
FaceData[]  faceData,
int[]  trackerStatus 
)
inlineprivate

Demonstrates running face analysis in a background thread.

In case the worker is busy the function returns effectively skipping that frame.

Parameters
frameInput frame on which the analysis is made
faceDataInput face data array
trackerStatustracker status array

Definition at line 1521 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.worker_DoAnalyzeFace().

Referenced by ShowcaseDemo.MainWindow.worker_DoWorkCam(), ShowcaseDemo.MainWindow.worker_DoWorkImage(), and ShowcaseDemo.MainWindow.worker_DoWorkVideo().

void ShowcaseDemo.MainWindow.runFaceRecognition ( VSImage  frame,
FaceData[]  faceDatas,
int[]  trackerStatus 
)
inlineprivate

Demonstrates running face recognition in a background thread.

In case the worker is busy the function returns effectively skipping that frame.

Parameters
frameInput frame on which the recognition is made
faceDatasInput face data array
trackerStatustracker status array

Definition at line 1487 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.worker_DoWorkMatchFace().

Referenced by ShowcaseDemo.MainWindow.worker_DoWorkCam(), ShowcaseDemo.MainWindow.worker_DoWorkImage(), and ShowcaseDemo.MainWindow.worker_DoWorkVideo().

void ShowcaseDemo.MainWindow.runTrackFromCam ( )
inlineprivate

Demonstrates running a new tracking thread for tracking from camera.

The function is called by clicking on the Track from camera icon.

Definition at line 1450 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.worker_DoWorkCam().

Referenced by ShowcaseDemo.MainWindow.trackerDetectorButton_Click().

void ShowcaseDemo.MainWindow.runTrackFromImage ( string  file,
VISAGE_MODE  activeMode 
)
inlineprivate

Demonstrates running a new tracking thread for tracking from image.

The function is called by clicking on the Track from image icon.

Parameters
fileImage on which the tracking will be performed.
activeModeCurrent active mode. Can be DETECTOR or TRACKER.

Definition at line 1411 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.worker_DoWorkImage().

Referenced by ShowcaseDemo.MainWindow.trackerDetectorButton_Click().

void ShowcaseDemo.MainWindow.runTrackFromVideo ( string  file)
inlineprivate

Demonstrates running a new tracking thread for tracking from video.

The function is called by clicking on the Track from video button.

Parameters
fileVideo on which the tracking will be performed.

Definition at line 1372 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.worker_DoWorkVideo().

void ShowcaseDemo.MainWindow.saveGalleryButton_Click ( object  sender,
RoutedEventArgs  e 
)
inlineprivate

Save face recognition gallery (.frg) to a file.

Parameters
sender
e

Definition at line 1893 of file ShowcaseDemo.xaml.cs.

References VisageCSWrapper::VisageFaceRecognition.SaveGallery().

void ShowcaseDemo.MainWindow.trackerDetectorButton_Click ( object  sender,
RoutedEventArgs  e 
)
inlineprivate

Toggles application mode from TRACKER to DETECTOR and vice versa.

Parameters
sender
e

Definition at line 1667 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.ResetFRInitialization(), ShowcaseDemo.MainWindow.runTrackFromCam(), and ShowcaseDemo.MainWindow.runTrackFromImage().

void ShowcaseDemo.MainWindow.trackerDisplay ( )
inlineprivate

Calls the VisageRendering' DisplayResults function.

Called in a separate thread controlled by openGLControl_OpenGLDraw() function when the active application mode is set to TRACKER mode.

Definition at line 1258 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.AdjustAspect().

Referenced by ShowcaseDemo.MainWindow.openGLControl_OpenGLDraw().

void ShowcaseDemo.MainWindow.worker_DoAnalyzeFace ( object  sender,
DoWorkEventArgs  e 
)
inlineprivate

Worker event for face analysis that runs in a separate thread.

Used in runFaceAnalysis() function.

Expects three arguments sent via e parameter: frame (VsImage), face data array object (FaceData[]) and array of tracking statuses (int[]).

Calls AnalyzeFace function for each face in the frame and passes frame and corresponding FaceData object.

Parameters
sender
e

Definition at line 966 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.AnalyzeFace(), and ShowcaseDemo.MainWindow.ResetFaceAnalysis().

Referenced by ShowcaseDemo.MainWindow.runFaceAnalysis().

void ShowcaseDemo.MainWindow.worker_DoWorkCam ( object  sender,
DoWorkEventArgs  e 
)
inlineprivate

Worker event for tracking from camera that runs in a separate thread.

Used in runTrackFromCam() function.

Demonstrates handling of the camera and camera frame data retrieval (using OpenCV). Tracks and analyses face in the current camera frame. Depending on the tracker return status runs face analysis and face recognition in a separate thread.

Locking mechanism is used to synchronize frame and tracking results rendering. Due to face analysis and face recognition running in separate thread rendering of age, gender, emotion and identity is not synchronized with the rendering of the frame.

Implemented using BackgroundWorker.

Parameters
sender
e

Definition at line 658 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.convertFromBGRToRGB(), ShowcaseDemo.MainWindow.disableAgeEstimCheckbox(), ShowcaseDemo.MainWindow.enableAgeEstimCheckbox(), VisageCSWrapper::VSImage.imageData, ShowcaseDemo.MainWindow.InitializeFaceAnalysis(), ShowcaseDemo.MainWindow.runFaceAnalysis(), ShowcaseDemo.MainWindow.runFaceRecognition(), VisageCSWrapper::VisageTracker.Stop(), and VisageCSWrapper::VisageTracker.Track().

Referenced by ShowcaseDemo.MainWindow.runTrackFromCam().

void ShowcaseDemo.MainWindow.worker_DoWorkImage ( object  sender,
DoWorkEventArgs  e 
)
inlineprivate

Worker event for tracking/detection from an image source that runs in a separate thread.

Used in runTrackFromImage() function.

Expects two arguments sent via e parameter: path to the image and currently active VISAGE_MODE (TRACKER, DETECTOR). Based on the current mode initiates tracking or detection. Depending on the tracker return status runs face analysis and face recognition in a separate thread.

Locking mechanism is used to synchronize frame and tracking results rendering. Due to face analysis and face recognition running in separate thread rendering of age, gender, emotion and identity is not synchronized with the rendering of the frame.

Implemented using BackgroundWorker.

Parameters
sender
e

Definition at line 493 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.AnalyzeFace(), ShowcaseDemo.MainWindow.convertFromBGRToRGB(), VisageCSWrapper::VisageFeaturesDetector.DetectFacialFeatures(), ShowcaseDemo.MainWindow.disableAgeEstimCheckbox(), VisageCSWrapper::VSImage.imageData, ShowcaseDemo.MainWindow.InitializeFaceAnalysis(), ShowcaseDemo.MainWindow.RecognizeFace(), ShowcaseDemo.MainWindow.runFaceAnalysis(), ShowcaseDemo.MainWindow.runFaceRecognition(), VisageCSWrapper::VisageTracker.Stop(), and VisageCSWrapper::VisageTracker.Track().

Referenced by ShowcaseDemo.MainWindow.runTrackFromImage().

void ShowcaseDemo.MainWindow.worker_DoWorkMatchFace ( object  sender,
DoWorkEventArgs  e 
)
inlineprivate

Worker event for face recognition that runs in a separate thread.

Used in runFaceRecognition() function.

Expects three arguments sent via e parameter: frame (VsImage), array of face data objects (FaceData[]) and array of tracking statuses (int[].

Calls RecognizeFace function for each face in the frame and passes frame and corresponding FaceData object.

Parameters
sender
e

Definition at line 934 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.RecognizeFace(), and ShowcaseDemo.MainWindow.ResetFRInitialization().

Referenced by ShowcaseDemo.MainWindow.runFaceRecognition().

void ShowcaseDemo.MainWindow.worker_DoWorkVideo ( object  sender,
DoWorkEventArgs  e 
)
inlineprivate

Worker event for tracking from video that runs in a separate thread.

Used in runTrackFromVideo() function.

Expects one argument sent via e parameter: path to the video file. Demonstrates handling of video files and video frame data retrieval (using OpenCV) and implements synchronization to the video FPS. Tracks and analyses face in video frames. Depending on the tracker return status runs face analysis and face recognition in a separate thread.

Locking mechanism is used to synchronize frame and tracking results rendering. Due face analysis and face recognition are running in separate thread rendering of age, gender, emotion and identity is not synchronized with the rendering of the frame.

Implemented using BackgroundWorker.

Parameters
sender
e

Definition at line 792 of file ShowcaseDemo.xaml.cs.

References ShowcaseDemo.MainWindow.convertFromBGRToRGB(), ShowcaseDemo.MainWindow.disableAgeEstimCheckbox(), ShowcaseDemo.MainWindow.enableAgeEstimCheckbox(), VisageCSWrapper::VSImage.imageData, ShowcaseDemo.MainWindow.InitializeFaceAnalysis(), ShowcaseDemo.MainWindow.runFaceAnalysis(), ShowcaseDemo.MainWindow.runFaceRecognition(), VisageCSWrapper::VisageTracker.Stop(), and VisageCSWrapper::VisageTracker.Track().

Referenced by ShowcaseDemo.MainWindow.runTrackFromVideo().


The documentation for this class was generated from the following file: