visageSDK
Functions
VisageFeaturesDetectorWrapper.cpp File Reference

Implementation of simple interface around visage|SDK VisageFeaturesDetector functionality. More...

#include <jni.h>
#include <EGL/egl.h>
#include <GLES/gl.h>
#include <vector>
#include <stdio.h>
#include "VisageRendering.h"
#include "VisageFeaturesDetector.h"
#include "Common.h"
#include "VisageFaceRecognition.h"
#include "LicenseString.h"
#include "Utils.h"
#include <android/log.h>

Go to the source code of this file.

Functions

void Java_com_visagetechnologies_facedetectdemo_DetectorActivity_DetectorInit (JNIEnv *env, jobject obj, jstring appPath, jstring modelName)
 Method for initializing the detector. More...
 
void Java_com_visagetechnologies_facedetectdemo_ImageDetectorView_DetectFeatures (JNIEnv *env, jobject obj, jbyteArray frame, jint width, jint height)
 Method for passing raw image data to detector and initiating detection of features in it. More...
 
void Java_com_visagetechnologies_facedetectdemo_DetectorRenderer_displayResults (JNIEnv *env, jobject obj, jint width, jint height)
 Method for displaying detection results. More...
 
void Java_com_visagetechnologies_facedetectdemo_DetectorActivity_CleanUp (JNIEnv *env, jobject obj)
 Method for cleaning up resources used by application.
 

Detailed Description

Implementation of simple interface around visage|SDK VisageFeaturesDetector functionality.

In order for Android application, which uses Java as its primary programming language, to communicate with visage|SDK functionality, which uses C++ as its primary language it is necessary to use Java Native Interface as a framework between the two.

Key members of wrapper are:

Definition in file VisageFeaturesDetectorWrapper.cpp.

Function Documentation

◆ Java_com_visagetechnologies_facedetectdemo_DetectorActivity_DetectorInit()

void Java_com_visagetechnologies_facedetectdemo_DetectorActivity_DetectorInit ( JNIEnv *  env,
jobject  obj,
jstring  appPath,
jstring  modelName 
)

Method for initializing the detector.

This method creates a new VisageFeaturesDetector object and initializes it.

Parameters
appPathpath to root folder where Android application data is stored
modelNamename of generic Active Appearance Model file used for detection

Definition at line 62 of file VisageFeaturesDetectorWrapper.cpp.

◆ Java_com_visagetechnologies_facedetectdemo_DetectorRenderer_displayResults()

void Java_com_visagetechnologies_facedetectdemo_DetectorRenderer_displayResults ( JNIEnv *  env,
jobject  obj,
jint  width,
jint  height 
)

Method for displaying detection results.

Parameters
widthwidth of the viewport
heightheight of the viewport

Definition at line 125 of file VisageFeaturesDetectorWrapper.cpp.

References glHeight, glWidth, VsImage::height, VisageSDK::VisageRendering::SetFontTexture(), videoAspect, and VsImage::width.

◆ Java_com_visagetechnologies_facedetectdemo_ImageDetectorView_DetectFeatures()

void Java_com_visagetechnologies_facedetectdemo_ImageDetectorView_DetectFeatures ( JNIEnv *  env,
jobject  obj,
jbyteArray  frame,
jint  width,
jint  height 
)

Method for passing raw image data to detector and initiating detection of features in it.

Detection results are returned through FDP object. By calling static method DrawFDP of Common class detection results are drawn directly on top of image used for detection.

Parameters
frameraw image data of image used for detection.
widthwidth of image used for detection.
heightheight of image used for detection.

Definition at line 98 of file VisageFeaturesDetectorWrapper.cpp.

References VsImage::imageData, and VsImage::imageSize.