0% found this document useful (0 votes)
273 views150 pages

Refman.net

pio

Uploaded by

Robert Garcia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
273 views150 pages

Refman.net

pio

Uploaded by

Robert Garcia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 150

FaceVACS-SDK .

NET Reference Manual


Version 8.1.0
Copyright by Cognitec GmbH

Generated 17 Feb 2010

Contents
1

Face Recognition SDK Overview

FaceVACS-SDK .NET Manual

User guide - .NET user guide

User Guide - Creating Applications with FaceVACS-SDK .NET

4.1

Build Environment . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.2

Run-Time Environment for FaceVACS-SDK .NET Applications . . .

4.3

Redistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.4

Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.5

Differences to the C++ SDK . . . . . . . . . . . . . . . . . . . . . .

10

Tutorial - Overview

11

.Net Tutorial - Finding faces

13

Tutorial - Locating eyes and Analyze

17

Tutorial - Making set enrollments

23

Namespace Index

27

9.1

27

Package List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10 Class Index
10.1 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11 Class Index
11.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29
29
31
31

ii

CONTENTS
12 Namespace Documentation

33

12.1 Package Cognitec.FRsdk . . . . . . . . . . . . . . . . . . . . . . . .

33

12.2 Package Cognitec.FRsdk.Enrollment . . . . . . . . . . . . . . . . . .

37

12.3 Package Cognitec.FRsdk.Eyes . . . . . . . . . . . . . . . . . . . . .

38

12.4 Package Cognitec.FRsdk.Face . . . . . . . . . . . . . . . . . . . . .

39

12.5 Package Cognitec.FRsdk.Identification . . . . . . . . . . . . . . . . .

40

12.6 Package Cognitec.FRsdk.ImageIO . . . . . . . . . . . . . . . . . . .

41

12.7 Package Cognitec.FRsdk.ISO 19794 5 . . . . . . . . . . . . . . . . .

42

12.8 Package Cognitec.FRsdk.ISO 19794 5.FullFrontal . . . . . . . . . .

43

12.9 Package Cognitec.FRsdk.ISO 19794 5.TokenFace . . . . . . . . . .

44

12.10Package Cognitec.FRsdk.Portrait . . . . . . . . . . . . . . . . . . . .

45

12.11Package Cognitec.FRsdk.Portrait.Feature . . . . . . . . . . . . . . .

46

12.12Package Cognitec.FRsdk.Verification . . . . . . . . . . . . . . . . .

47

13 Class Documentation

49

13.1 Analyzer Class Reference . . . . . . . . . . . . . . . . . . . . . . . .

49

13.2 AnnotatedImage Struct Reference . . . . . . . . . . . . . . . . . . .

50

13.3 Bmp Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

51

13.4 CaptureDevice Interface Reference . . . . . . . . . . . . . . . . . . .

53

13.5 Characteristics Class Reference . . . . . . . . . . . . . . . . . . . . .

54

13.6 Compliance Class Reference . . . . . . . . . . . . . . . . . . . . . .

62

13.7 Configuration Class Reference . . . . . . . . . . . . . . . . . . . . .

68

13.8 Configuration.ProtectedItem Struct Reference . . . . . . . . . . . . .

70

13.9 Creator Class Reference . . . . . . . . . . . . . . . . . . . . . . . .

71

13.10Exception Struct Reference . . . . . . . . . . . . . . . . . . . . . . .

72

13.11FacialMatchingEngine Class Reference . . . . . . . . . . . . . . . .

73

13.12FeatureDisabled Struct Reference . . . . . . . . . . . . . . . . . . .

75

13.13Feedback Interface Reference . . . . . . . . . . . . . . . . . . . . . .

76

13.14Feedback Interface Reference . . . . . . . . . . . . . . . . . . . . . .

79

13.15Feedback Interface Reference . . . . . . . . . . . . . . . . . . . . . .

81

13.16Finder Class Reference . . . . . . . . . . . . . . . . . . . . . . . . .

84

13.17Finder Class Reference . . . . . . . . . . . . . . . . . . . . . . . . .

86

13.18FIR Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

87

13.19FIRBuilder Class Reference . . . . . . . . . . . . . . . . . . . . . .

89

c 2009 by Cognitec Systems GmbH


Copyright

CONTENTS

iii

13.20Image Interface Reference . . . . . . . . . . . . . . . . . . . . . . .

91

13.21ImageManipulation Struct Reference . . . . . . . . . . . . . . . . . .

93

13.22ImagePropertiesFeedback Class Reference . . . . . . . . . . . . . . .

94

13.23Jpeg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

95

13.24Jpeg2000 Struct Reference . . . . . . . . . . . . . . . . . . . . . . .

97

13.25Jpeg.Properties Struct Reference . . . . . . . . . . . . . . . . . . . .

98

13.26LenseDistortionCorrector Class Reference . . . . . . . . . . . . . . .

99

13.27LicenseSignatureMismatch Struct Reference . . . . . . . . . . . . . .

100

13.28LimitExceeded Struct Reference . . . . . . . . . . . . . . . . . . . .

101

13.29Location Struct Reference . . . . . . . . . . . . . . . . . . . . . . .

102

13.30Location Struct Reference . . . . . . . . . . . . . . . . . . . . . . .

104

13.31Match Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . .

106

13.32Pgm Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

107

13.33Png Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

108

13.34Population Class Reference . . . . . . . . . . . . . . . . . . . . . . .

109

13.35Position Struct Reference . . . . . . . . . . . . . . . . . . . . . . . .

110

13.36Processor Class Reference . . . . . . . . . . . . . . . . . . . . . . .

111

13.37Processor Class Reference . . . . . . . . . . . . . . . . . . . . . . .

113

13.38Processor Class Reference . . . . . . . . . . . . . . . . . . . . . . .

115

13.39Rgb Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

117

13.40Sample Struct Reference . . . . . . . . . . . . . . . . . . . . . . . .

118

13.41SampleEvaluator Class Reference . . . . . . . . . . . . . . . . . . .

120

13.42SampleQuality Struct Reference . . . . . . . . . . . . . . . . . . . .

121

13.43Score Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . .

123

13.44ScoreMappings Class Reference . . . . . . . . . . . . . . . . . . . .

124

13.45Set Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . .

126

13.46Shape Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . .

128

13.47ShapeImage Interface Reference . . . . . . . . . . . . . . . . . . . .

129

13.48Test Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

131

13.49Test Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . .

132

13.50Tracker Class Reference . . . . . . . . . . . . . . . . . . . . . . . .

133

13.51TrackerLocation Struct Reference . . . . . . . . . . . . . . . . . . .

135

13.52WinCaptureDevice Class Reference . . . . . . . . . . . . . . . . . .

136

13.53WinCaptureDevice.VideoFormat Class Reference . . . . . . . . . . .

138

c 2009 by Cognitec Systems GmbH


Copyright

iv

CONTENTS
14 Example Documentation

139

14.1 acquisition.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

139

14.2 enroll.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

145

14.3 eyesfind.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

147

14.4 facefind.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

150

14.5 identify.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

152

14.6 tracklife.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

154

14.7 trackrec.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

156

14.8 verify.cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

158

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 1

Face Recognition SDK


Overview

Face Recognition SDK Overview

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 2

FaceVACS-SDK .NET Manual


This is the documentation for the .NET FaceVACS-SDK.This documentation does only
cover .NET specific issues. For an understanding of how to use the FaceVACS-SDK
the more complete FaceVACS-SDK C++ documentation should be used.
The FaceVACS-SDK Manual consists of the following main parts which are accessible
over the header of each page:
FaceVACS-SDK .NET Userguide
describes .NET specific concepts and redistribution,
FaceVACS-SDK .NET Tutorial
explains step by step the use cases covered by FaceVACS-SDK.
FaceVACS-SDK .NET Examples
However the .NET API Reference and some examples are provided in the
C# programming language.

FaceVACS-SDK .NET Manual

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 3

User guide - .NET user guide

User guide - .NET user guide


This user guide gives information which are specific for the developing .NET applications.
For an overall introduction to the FaceVACS-SDK please consult the C++
Userguide which covers all topics in depth.
The user guide is divided into the following chapter with sections:
Creating Applications with FaceVACS-SDK
Build environment
Run-Time requirements for FaceVACS-SDK applications
Redistribution
Exception Handling
Differences to the C++ API

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 4

User Guide - Creating


Applications with
FaceVACS-SDK .NET

User Guide - Creating Applications with FaceVACS-SDK .NET

4.1

Build Environment

For the developing of .NET applications the following parts of the directory tree of the
installed FaceVACS-SDK distribution are relevant:

- <install root>
... the root directory of the FaceVACS-SDK installation
|
|
+- examples
... location for the examples
|
|
|
+- cs
... C# sources, solution and project files
|
|
|
+- x86_32 ... 32 bit binaries, together with noipp runtime lib
|
+- lib
... the location of FaceVACS-SDK libraries
|
libfrsdk-<version>.{lib|dll} and libfrsdknet-<version>.dll
|
+- x86_32
... for 32 bit platforms
| |
| +- msc_7.1_crtdll
and Visual C++ 7.1 (Visual C++ .NET 2003, .Net Framework 1.
| |
| +- msc_8.0_crtdll
and Visual C++ 8.0 (Visual C++ .NET 2005, .Net Framework 2.
|
+- x86_64
... for 64 bit platforms
|
+- msc_8.0_crtdll
and Visual C++ 8.0 (Visual C++ .NET 2005, .Net Framework 2.

To compile applications referencing the FaceVACS-SDK.NET assembly one have to


give the location for e.g.:

cd <install root>\examples\cs
csc /reference:..\..\lib\x86_32\msc_8.0_crtdll\libfrsdknet-<version>.dll /out:enroll.exe enro

Additionally one can use the provided solution/project files together with the Microsoft
Visual Studio .NET environment. The bin directory contains the precompiled example
binaries together with a FaceVACS-SDK runtime lib (noipp). To run the example application call them simple from the bin directory. If no command line parameters are
given a short help description explains the usage.

4.2

Run-Time Environment for FaceVACS-SDK .NET


Applications

Applications build with an assembly reference have to resolve this reference at runtime. The .NET framework offers two different solutions: either Private Assembly or
Shared Assembly. Independent which form will be used, the delivered FaceVACSSDK.NET assembly libfrsdknet-<version>.dll references a FaceVACS-SDK library
build for Visual C++ 7.1 and .Net Framework version 1.1 or Visual C++ 8.0 and .Net
Framework 2.0. This referenced library has to be available in the search path or in the
same directory where the FaceVACS-SDK.NET assembly was installed. See the C++
Userguide for the available types of this library (debug/nodebug/ipp/noipp..).
c 2009 by Cognitec Systems GmbH
Copyright

4.3 Redistribution

4.2.1

Private Assembly

An private assembly has to be located in the same directory or an subdirectory of the


application. You may copy the FaceVACS-SDK.NET assembly in your application
directory to get the reference resolved.

4.2.2

Shared Assembly

To make the assembly globally available they have to be placed into the global assembly cache. Example using gacutil:
cd <install root>\lib\dotnet\msc_8.0_crtdll
gacutil /i libfrsdknet.dll

4.3

Redistribution

For a complete description what to deploy see the Redistribution/Run-Time Environment section of the C++ Userguide.
- <application install root> ... the root directory of the application
|
installation
+- frsdk.cfg (can reside anywhere, or compiled in)
|
+- bin
|
+-<your application>
|
+-<runtime FaceVACS-SDK DLLs/shared libraries>
|
+-<.NET runtime library (libfrsdknet.dll)>
|
+- etc
+- portrait
|
+- *.dat
|
+- cara
|
+- *.dat
|
+- cmp
|
+- *.dat
|
+- ojo
+- *.dat

Additional the libfrsdknet-<version>.dll assembly has to be copied to the bin location of the distributed application directory tree. This directory must contain also the
dependent runtime libraries.

4.4

Exception Handling

Potentially on all operations on library objects ( creation, member function calls)


Cognitec.FRsdk.Exception objects might be thrown. This object is of type System.Exception and thus provides the properties Message and StackTrace. The message
string may give an hint about the reason of the exception.
c 2009 by Cognitec Systems GmbH
Copyright

10

User Guide - Creating Applications with FaceVACS-SDK .NET


If the cause of the exception was related to an licensing issue then an Cognitec.FRsdk.LicenseSignatureMismatch exception will be thrown which itselfs is an
Cognitec.FRsdk.Exception. In case of accessing a disabled FaceVACS-SDK feature
a Cognitec.FRsdk.FeatureDisabled exception may be thrown. If some set limit of
FaceVACS-SDK was exceeded a Cognitec.FRsdk.LimitExceeded exception may be
thrown.

4.5

Differences to the C++ SDK

Here is a brief listing of the main differences between the .NET and the C++ API.

4.5.1

standard template library types

std.string is mapped to string


std.list<T> is mapped to arrys of T[].
std.pair<T1,T2> is replaced by struct { T1 t1; T2 t2};
all std.exception C++ exceptions are converted to Cognitec.FRsdk.Exception
.NET exceptions

4.5.2

Refrence counting and Body/Handle idiom

The Reference counting used by the C++ SDK is not necessary in the .NET library
because .NET manages the lifetime of its objects themselfs.

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 5

Tutorial - Overview

12

Tutorial - Overview
Currently there is no dedicated tutorial available for .NET.
Due to the fact, that the interfaces are completely similar to the C++ ones just refer to
the C++ tutorial .

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 6

Namespace Index
6.1

Package List

Here are the packages with brief descriptions (if available):


Cognitec.FRsdk (FaceVACS-SDK.NET ) . . . . . . . . . . . . . . . . . .
Cognitec.FRsdk.Enrollment (Namespace for the enrollment facility ) . . . .
Cognitec.FRsdk.Eyes (The eyes finding facility ) . . . . . . . . . . . . . .
Cognitec.FRsdk.Face (The face finding facility ) . . . . . . . . . . . . . . .
Cognitec.FRsdk.Identification (Namespace for the identification facility ) .
Cognitec.FRsdk.ImageIO (Additinal image properties, Image I/O support ) .
Cognitec.FRsdk.ISO 19794 5 (Support for image formats defined by
ISO/IEC 19794-5:2005 ) . . . . . . . . . . . . . . . . . . . . . .
Cognitec.FRsdk.ISO 19794 5.FullFrontal (Compliance with ISO 19794 5
Full Frontal Image type ) . . . . . . . . . . . . . . . . . . . . . .
Cognitec.FRsdk.ISO 19794 5.TokenFace (Support for Token Face Image
type as defined in ISO 19794 5 9.2 ) . . . . . . . . . . . . . . . .
Cognitec.FRsdk.Portrait (Portrait characteristics and feature tests ) . . . . .
Cognitec.FRsdk.Portrait.Feature (Test for features in the portrait ) . . . . .
Cognitec.FRsdk.Verification (Namespace for the verification facility ) . . .

.
.
.
.
.
.

33
37
38
39
40
41

. 42
. 43
.
.
.
.

44
45
46
47

14

Namespace Index

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 7

Class Index
7.1

Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:


Analyzer . . . . . . . . . . . .
AnnotatedImage . . . . . . . .
Bmp . . . . . . . . . . . . . .
CaptureDevice . . . . . . . . .
WinCaptureDevice . . . .
Characteristics . . . . . . . . .
Compliance . . . . . . . . . .
Configuration . . . . . . . . .
Configuration.ProtectedItem .
Creator . . . . . . . . . . . . .
Exception . . . . . . . . . . .
FeatureDisabled . . . . . .
LicenseSignatureMismatch
LimitExceeded . . . . . .
FacialMatchingEngine . . . .
Feedback . . . . . . . . . . .
Feedback . . . . . . . . . . .
Feedback . . . . . . . . . . .
Finder . . . . . . . . . . . . .
Finder . . . . . . . . . . . . .
FIR . . . . . . . . . . . . . .
FIRBuilder . . . . . . . . . .
Image . . . . . . . . . . . . .
ImageManipulation . . . . . .
ImagePropertiesFeedback . . .
Jpeg . . . . . . . . . . . . . .
Jpeg2000 . . . . . . . . . . .
Jpeg.Properties . . . . . . . .
LenseDistortionCorrector . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

49
50
51
53
136
54
62
68
70
71
72
75
100
101
73
76
79
81
84
86
87
89
91
93
94
95
97
98
99

16

Class Index
Location . . . . . . . . . . . . .
Location . . . . . . . . . . . . .
Match . . . . . . . . . . . . . .
Pgm . . . . . . . . . . . . . . .
Png . . . . . . . . . . . . . . .
Population . . . . . . . . . . . .
Position . . . . . . . . . . . . .
Processor . . . . . . . . . . . .
Processor . . . . . . . . . . . .
Processor . . . . . . . . . . . .
Rgb . . . . . . . . . . . . . . .
Sample . . . . . . . . . . . . .
SampleEvaluator . . . . . . . .
SampleQuality . . . . . . . . .
Score . . . . . . . . . . . . . .
ScoreMappings . . . . . . . . .
Set . . . . . . . . . . . . . . . .
Shape . . . . . . . . . . . . . .
ShapeImage . . . . . . . . . . .
Test . . . . . . . . . . . . . . .
Test . . . . . . . . . . . . . . .
Tracker . . . . . . . . . . . . .
TrackerLocation . . . . . . . . .
WinCaptureDevice.VideoFormat

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

102
104
106
107
108
109
110
111
113
115
117
118
120
121
123
124
126
128
129
131
132
133
135
138

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 8

Class Index
8.1

Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
Analyzer (Portrait Characteristics Analyzer, create Portrait characteristics
from annotated images ) . . . . . . . . . . . . . . . . . . . . . . .
AnnotatedImage (Annotated image ) . . . . . . . . . . . . . . . . . . . . . .
Bmp (Bitmap (BMP) image implementation ) . . . . . . . . . . . . . . . . .
CaptureDevice (Abstract image capturing device ) . . . . . . . . . . . . . . .
Characteristics (Portrait Characteristics ) . . . . . . . . . . . . . . . . . . . .
Compliance (Compliance assessment results ) . . . . . . . . . . . . . . . . .
Configuration (Opaque configuration object of the FaceVACS SDK library ) .
Configuration.ProtectedItem (Key value pair of a protected key ) . . . . . . .
Creator (Extract a Full Frontal Image from the source image ) . . . . . . . . .
Exception (An object of this type is thrown if exceptions in the library occure )
FacialMatchingEngine (Low level match facilities ) . . . . . . . . . . . . . .
FeatureDisabled (An object of this type is thrown at any time if requesting or
accessing a disabled FaceVACS-SDK feature ) . . . . . . . . . . . .
Feedback (The feedback from the verification process ) . . . . . . . . . . . .
Feedback (The feedback for the identification process ) . . . . . . . . . . . .
Feedback (The feedback for the enrollment procedure ) . . . . . . . . . . . .
Finder (Face finder ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Finder (Eyes finder ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FIR (FIR - Facial Identification Record ) . . . . . . . . . . . . . . . . . . . .
FIRBuilder (Building FIRs from serialized representations Use Enrollment.Processor to build FIRs from primary biometric data (face
images) ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Image (Abstract image ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ImageManipulation (Vignetting ) . . . . . . . . . . . . . . . . . . . . . . . .
ImagePropertiesFeedback (Feedback for getting image properties on image
loading ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Jpeg (JPEG image support ) . . . . . . . . . . . . . . . . . . . . . . . . . . .
Jpeg2000 (JPEG 2000 image support ) . . . . . . . . . . . . . . . . . . . . .

49
50
51
53
54
62
68
70
71
72
73
75
76
79
81
84
86
87

89
91
93
94
95
97

18

Class Index
Jpeg.Properties (Properties of a JPEG image ) . . . . . . . . . . . . . . . .
LenseDistortionCorrector (Lens distorsion correction ) . . . . . . . . . . .
LicenseSignatureMismatch (License signature mismatch ) . . . . . . . . .
LimitExceeded (An object of this type is thrown at any time if a configured
limit of FaceVACS-SDK is exceeded ) . . . . . . . . . . . . . . .
Location (The Face.Location describes a image location where a face was
found ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Location (The Eyes.Location describes a location in the image where eyes
within a face have been found ) . . . . . . . . . . . . . . . . . . .
Match (Named score for a match of two FIRs ) . . . . . . . . . . . . . . .
Pgm (PGM/PPM image format support ) . . . . . . . . . . . . . . . . . . .
Png (PNG (Portable Network Graphics) image format support ) . . . . . . .
Population (An ordered (in the order of additions by add() ) set of named
FIRs which represents the population used for identifications ) . .
Position (Continuous two-dimensional coordinates ) . . . . . . . . . . . . .
Processor (This class represents the interface to the enrollment process ) . .
Processor (This class represents the interface to the verification process ) . .
Processor (This class represents the interface to the identification process ) .
Rgb (Rgb color model ) . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sample (Sample A compound input data type containing an image and, optionally, eyes annotation and/or shape data ) . . . . . . . . . . . .
SampleEvaluator (Evaluate the quality of a sample (image) ) . . . . . . . .
SampleQuality (A description of the biometric quality of a sample (image) )
Score (This class represents a score for representing the comparison result
between a FIR and the biometric evidence ) . . . . . . . . . . . .
ScoreMappings (FAR - FRR Score mappings ) . . . . . . . . . . . . . . . .
Set (Feature assessment results ) . . . . . . . . . . . . . . . . . . . . . . .
Shape (Shape Image I/O support ) . . . . . . . . . . . . . . . . . . . . . .
ShapeImage (Abstract image ) . . . . . . . . . . . . . . . . . . . . . . . .
Test (Test for features in a portrait ) . . . . . . . . . . . . . . . . . . . . . .
Test (Compliance assessment ) . . . . . . . . . . . . . . . . . . . . . . . .
Tracker (The Face Tracker locates and tracks faces across a sequence of images in an efficient way by analyzing the spatial and temporal dependencies between faces in subsequent images ) . . . . . . . . .
TrackerLocation (The location of a face being tracked by the face tracker ) .
WinCaptureDevice (Win32 DirectShow video capture device ) . . . . . . .
WinCaptureDevice.VideoFormat (Opaque type representing a video format
(resolution, bits per pixel, etc) ) . . . . . . . . . . . . . . . . . . .

. 98
. 99
. 100
. 101
. 102
.
.
.
.

104
106
107
108

.
.
.
.
.
.

109
110
111
113
115
117

. 118
. 120
. 121
.
.
.
.
.
.
.

123
124
126
128
129
131
132

. 133
. 135
. 136
. 138

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 9

Namespace Documentation
9.1

Package Cognitec.FRsdk

FaceVACS-SDK.NET.

Classes
struct Exception
An object of this type is thrown if exceptions in the library occure.

struct LicenseSignatureMismatch
License signature mismatch.

struct FeatureDisabled
An object of this type is thrown at any time if requesting or accessing a disabled
FaceVACS-SDK feature.

struct LimitExceeded
An object of this type is thrown at any time if a configured limit of FaceVACS-SDK is
exceeded.

class Configuration
Opaque configuration object of the FaceVACS SDK library.

struct Rgb
rgb color model

struct Position
continuous two-dimensional coordinates

interface Image

20

Namespace Documentation
Abstract image.

interface ShapeImage
Abstract image.

struct Jpeg
JPEG image support.

struct Jpeg2000
JPEG 2000 image support.

struct Pgm
PGM/PPM image format support.

struct Png
PNG (Portable Network Graphics) image format support.

struct Bmp
Bitmap (BMP) image implementation.

struct Shape
Shape Image I/O support.

struct ImageManipulation
Vignetting.

class LenseDistortionCorrector
Lens distorsion correction.

interface CaptureDevice
Abstract image capturing device.

class WinCaptureDevice
Win32 DirectShow video capture device.

struct AnnotatedImage
annotated image

struct Sample
Sample A compound input data type containing an image and, optionally, eyes annotation and/or shape data.

struct Score
This class represents a score for representing the comparison result between a FIR
and the biometric evidence.

class ScoreMappings
c 2009 by Cognitec Systems GmbH
Copyright

9.1 Package Cognitec.FRsdk


FAR - FRR Score mappings.

struct SampleQuality
A description of the biometric quality of a sample (image).

class SampleEvaluator
Evaluate the quality of a sample (image).

class FIR
FIR - Facial Identification Record.

class FIRBuilder
Building FIRs from serialized representations Use Enrollment.Processor to build
FIRs from primary biometric data (face images).

class Population
An ordered (in the order of additions by add() ) set of named FIRs which represents
the population used for identifications.

struct Match
a named score for a match of two FIRs

class FacialMatchingEngine
Low level match facilities.

Packages
package ImageIO
additinal image properties, Image I/O support

package Face
The face finding facility.

package Eyes
The eyes finding facility.

package Portrait
Portrait characteristics and feature tests.

package ISO 19794 5


Support for image formats defined by ISO/IEC 19794-5:2005.

package Enrollment
the namespace for the enrollment facility

c 2009 by Cognitec Systems GmbH


Copyright

21

22

Namespace Documentation
package Verification
the namespace for the verification facility

package Identification
the namespace for the identification facility

9.1.1

Detailed Description

FaceVACS-SDK.NET.
Namespace for the .NET FaceVACS-SDK.

c 2009 by Cognitec Systems GmbH


Copyright

9.2 Package Cognitec.FRsdk.Enrollment

9.2

Package Cognitec.FRsdk.Enrollment

the namespace for the enrollment facility

Classes
interface Feedback
The feedback for the enrollment procedure.

class Processor
this class represents the interface to the enrollment process

9.2.1

Detailed Description

the namespace for the enrollment facility


Enrollment is the use case of constructing a FIR from a number of images of a human
face. One or more samples (face images) of the same person are captured and processed
into a FIR. The results of the enrollment are returned by a callback mechanism via the
Feedback object.
The constraint to use images of one and the same person only is essentially. Due to the
limited capacity of a FIR and the properties of the clustering algorithm used, poor
biometric performance may be the result if combining images or merging FIRs from
different persons is attempted.

c 2009 by Cognitec Systems GmbH


Copyright

23

24

Namespace Documentation

9.3

Package Cognitec.FRsdk.Eyes

The eyes finding facility.

Classes
struct Location
The Eyes.Location describes a location in the image where eyes within a face have
been found.

class Finder
eyes finder

9.3.1

Detailed Description

The eyes finding facility.

c 2009 by Cognitec Systems GmbH


Copyright

9.4 Package Cognitec.FRsdk.Face

9.4

Package Cognitec.FRsdk.Face

The face finding facility.

Classes
struct Location
The Face.Location describes a image location where a face was found.

class Finder
face finder

struct TrackerLocation
The location of a face being tracked by the face tracker.

class Tracker
The Face Tracker locates and tracks faces across a sequence of images in an efficient
way by analyzing the spatial and temporal dependencies between faces in subsequent
images.

9.4.1

Detailed Description

The face finding facility.

c 2009 by Cognitec Systems GmbH


Copyright

25

26

Namespace Documentation

9.5

Package Cognitec.FRsdk.Identification

the namespace for the identification facility

Classes
interface Feedback
The feedback for the identification process.

class Processor
this class represents the interface to the identification process

9.5.1

Detailed Description

the namespace for the identification facility


Identification is the use case of identification of human faces. One or more samples
(face images) are captured and processed into a FIR and matched against a set of FIRs.
The result of the identification is a match set containing the matches ordered by score.
This set is returned by callback mechanism using the Feedback object.

c 2009 by Cognitec Systems GmbH


Copyright

9.6 Package Cognitec.FRsdk.ImageIO

9.6

Package Cognitec.FRsdk.ImageIO

additinal image properties, Image I/O support

Classes
class ImagePropertiesFeedback
feedback for getting image properties on image loading

Enumerations
enum ImageColorMode
image color modes

9.6.1

Detailed Description

additinal image properties, Image I/O support

9.6.2

Enumeration Type Documentation

9.6.2.1

enum ImageColorMode

image color modes

c 2009 by Cognitec Systems GmbH


Copyright

27

28

Namespace Documentation

9.7

Package Cognitec.FRsdk.ISO 19794 5

Support for image formats defined by ISO/IEC 19794-5:2005.

Packages
package FullFrontal
Compliance with ISO 19794 5 Full Frontal Image type.

package TokenFace
Support for Token Face Image type as defined in ISO 19794 5 9.2.

9.7.1

Detailed Description

Support for image formats defined by ISO/IEC 19794-5:2005.


This namespace provides support for the face image formats defined by ISO/IEC
19794-5:2005, Biometric Data Interchange Formats - Part 5: Face Image Data. In
the documentation of the namespace members the term ISO 19794 5 refers to the
standard document ISO/IEC 19794-5:2005 final draft.
Use ISO 19794 5.FullFrontal.Test to determine compliance of a portrait with the ISO 19794 5 requirements for Full Frontal Images.
Use
ISO 19794 5.TokenFace.Creator.extract
or
ISO 19794 5.TokenFace.Creator.extractMinimal to produce images meeting the requirements of
the ISO 19794 5 TokenFace Image type.
Use ISO 19794 5.TokenFace.IO.read and ISO 19794 5.TokenFace.IO.write for reading and writing Token Face Images from and to files.

c 2009 by Cognitec Systems GmbH


Copyright

9.8 Package Cognitec.FRsdk.ISO 19794 5.FullFrontal

9.8

Package Cognitec.FRsdk.ISO 19794 5.FullFrontal

Compliance with ISO 19794 5 Full Frontal Image type.

Classes
class Creator
Extract a Full Frontal Image from the source image.

class Compliance
Compliance assessment results.

class Test
Compliance assessment.

9.8.1

Detailed Description

Compliance with ISO 19794 5 Full Frontal Image type.


This namespace provides a framework for testing compliance with the ISO 19794 5
Full Frontal Image requirements including the Best Practice recommendations for Full
Frontal Images.

c 2009 by Cognitec Systems GmbH


Copyright

29

30

Namespace Documentation

9.9

Package Cognitec.FRsdk.ISO 19794 5.TokenFace

Support for Token Face Image type as defined in ISO 19794 5 9.2.

9.9.1

Detailed Description

Support for Token Face Image type as defined in ISO 19794 5 9.2.
According to ISO 19794 5 the Token Face Image is used to store the extracted face
information from any other image source.

c 2009 by Cognitec Systems GmbH


Copyright

9.10 Package Cognitec.FRsdk.Portrait

9.10

Package Cognitec.FRsdk.Portrait

Portrait characteristics and feature tests.

Classes
class Characteristics
Portrait Characteristics.

class Analyzer
Portrait Characteristics Analyzer, create Portrait characteristics from annotated images.

Packages
package Feature
Test for features in the portrait.

9.10.1

Detailed Description

Portrait characteristics and feature tests.


This namespace provides support for measuring various face portrait characteristics
and testing for certain features in the portrait.
Use Portrait.Analyzer to produce Portrait.Characteristics of a portrait. The result of the
analysis can be used to determine compliance of a portrait with ISO 19794 5.
Use Portrait.Feature.Test to test for portrait features.

c 2009 by Cognitec Systems GmbH


Copyright

31

32

Namespace Documentation

9.11

Package Cognitec.FRsdk.Portrait.Feature

Test for features in the portrait.

Classes
class Set
Feature assessment results.

class Test
Test for features in a portrait.

Enumerations
enum Gender
Gender.

enum Ethnicity
Ethnicity.

9.11.1

Detailed Description

Test for features in the portrait.


This namespace provides tests for features in a portrait. These features are not required
by ISO 19794 5, although they might be of interest for other reasons.

9.11.2

Enumeration Type Documentation

9.11.2.1

enum Gender

Gender.
9.11.2.2

enum Ethnicity

Ethnicity.

c 2009 by Cognitec Systems GmbH


Copyright

9.12 Package Cognitec.FRsdk.Verification

9.12

Package Cognitec.FRsdk.Verification

the namespace for the verification facility

Classes
interface Feedback
The feedback from the verification process.

class Processor
this class represents the interface to the verification process

9.12.1

Detailed Description

the namespace for the verification facility


Verification is the use case of authenticating human faces. One or more samples (face
images) are captured, processed into a FIR and then matched against an input (reference) FIR. The results of the verification are returned via the Feedback object.

c 2009 by Cognitec Systems GmbH


Copyright

33

34

Namespace Documentation

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 10

Class Documentation
10.1

Analyzer Class Reference

Portrait Characteristics Analyzer, create Portrait characteristics from annotated images.

Public Member Functions


Characteristics analyze (AnnotatedImage a)
Create portrait characteristics from the annotated image a.

10.1.1

Detailed Description

Portrait Characteristics Analyzer, create Portrait characteristics from annotated images.


MT-safe It is safe to call the member functions concurrently
from different threads.

10.1.2

Member Function Documentation

10.1.2.1

Characteristics analyze (AnnotatedImage a)

Create portrait characteristics from the annotated image a.

36

Class Documentation

10.2

AnnotatedImage Struct Reference

annotated image

Public Member Functions


AnnotatedImage (Image image , Eyes.Location annotation )
Construct an annotated image from given Image and Eyes.Location.

Public Attributes
Image image
the image

Eyes.Location annotation
the annotation

10.2.1

Detailed Description

annotated image
An image with annotated eye positions

10.2.2

Constructor & Destructor Documentation

10.2.2.1

AnnotatedImage (Image image , Eyes.Location annotation )

Construct an annotated image from given Image and Eyes.Location.

10.2.3

Member Data Documentation

10.2.3.1

Image image

the image
10.2.3.2

Eyes.Location annotation

the annotation

c 2009 by Cognitec Systems GmbH


Copyright

10.3 Bmp Struct Reference

10.3

Bmp Struct Reference

Bitmap (BMP) image implementation.

Static Public Member Functions


static Image load (IntPtr bi, IntPtr img, string name)
constructs a image representation from the specified bitmap image in memory.

static Image load (string filename)


load the Bmp image from file; the image will get the name of the file

static Image load (System.IO.Stream s)


load the Bmp image from a stream

static void save (Image i, string filename)


saves the image as bmp to filename.

static uint getBitmapInfoSize (Image i)


get the total size of bitmap info; returns sizeof( BITMAPINFOHEADER) +
sizeof(color map)

static void writeBitmapInfo (Image i, IntPtr info)


write bitmap info to buffer; buffer size has to be at least the size returned by getBitmapInfoSize().

10.3.1

Detailed Description

Bitmap (BMP) image implementation.


FaceVACS-SDK supports the following bitmap formats:
loading:
8, 16, 24, 32 bit pixel size,
BI BITFIELD and BI RGB compression mode
saving:
8 and 24 bit pixel size
BI RGB compression mode
MT-safe It is safe to call the functions concurrently
from different threads.
c 2009 by Cognitec Systems GmbH
Copyright

37

38

Class Documentation

10.3.2

Member Function Documentation

10.3.2.1

static Image load (IntPtr bi, IntPtr img, string name) [static]

constructs a image representation from the specified bitmap image in memory.


The bi pointer points to a BITMAPINFOHEARER followed by an optional color table.
The existence of a colortable depends on the image type. The Byte pointer has to point
to bitmap data as described by the bitmap information. During construction of the
BmpImage, BITMAPINFO and bitmap data is copied, so they can be safely discarded
afterwards without corrupting the BmpImage.
10.3.2.2

static Image load (string filename) [static]

load the Bmp image from file; the image will get the name of the file
10.3.2.3

static Image load (System.IO.Stream s) [static]

load the Bmp image from a stream


10.3.2.4

static void save (Image i, string filename) [static]

saves the image as bmp to filename.


Note that the bitmap format of the file stored can differ from that used upon construction.
10.3.2.5

static uint getBitmapInfoSize (Image i) [static]

get the total size of bitmap info; returns sizeof( BITMAPINFOHEADER) +


sizeof(color map)
10.3.2.6

static void writeBitmapInfo (Image i, IntPtr info) [static]

write bitmap info to buffer; buffer size has to be at least the size returned by getBitmapInfoSize().
Note that the bitmap format stored in info is the format of the FRsdk.Image color
representation that can differ from that used when constructing an image from bitmap
data. To access bitmap data use img.colorRepresentation()

c 2009 by Cognitec Systems GmbH


Copyright

10.4 CaptureDevice Interface Reference

10.4

CaptureDevice Interface Reference

Abstract image capturing device.


Inheritance diagram for CaptureDevice::

CaptureDevice
WinCaptureDevice

Public Member Functions


Image capture ()
returns the image to capture

10.4.1

Detailed Description

Abstract image capturing device.

10.4.2

Member Function Documentation

10.4.2.1

Image capture ()

returns the image to capture


Implemented in WinCaptureDevice.

c 2009 by Cognitec Systems GmbH


Copyright

39

40

Class Documentation

10.5

Characteristics Class Reference

Portrait Characteristics.

Public Member Functions


uint width ()
the width of the portrait image

uint height ()
the height of the portrait image

Position eye0 ()
Coordinate of Feature Point 12.2 (Right eye center).

Position eye1 ()
Coordinate of Feature Point 12.1 (Left eye center).

float eyeDistance ()
Get the eye distance in pixels.

Position faceCenter ()
Coordinate of the center of the line connecting Feature Points 12.1 and 12.2 (Center
of left and right eye) See ISO standard 5.6.4.

uint numberOfFaces ()
Try to detect all faces within the given image, ignores given position.

float eye0Open ()
Returns the confidence for the persons eye0 beeing open.

float eye1Open ()
Returns the confidence for the persons eye1 beeing open.

float eye0GazeFrontal ()
Returns the confidence for the persons eye0 looking frontal to the camera.

float eye1GazeFrontal ()
Returns the confidence for the persons eye1 looking frontal to the camera.

float eye0Tinted ()
Returns a value how tinted the left eye and the environment is.

float eye1Tinted ()
Returns a value how tinted the right eye and the environment is.

c 2009 by Cognitec Systems GmbH


Copyright

10.5 Characteristics Class Reference


float eye0Red ()
Returns the redness of eyes pupils.

float eye1Red ()
Returns the redness of eyes pupils.

float glasses ()
Returns a measure for the probability of the person in the portrait to wear glasses See
ISO standard A.3.2.4.

float exposure ()
Returns average gray value within facial region.

uint grayScaleDensity ()
Gray scale density (number of different gray values) within facial region.

float naturalSkinColour ()
Returns the natural colours ratio ( 0.0 - 1.0) within face region.

float hotSpots ()
Returns the percentage of hot spot pixels ( 0.0 - 1.0) within face region.

float backgroundUniformity ()
Background ist not nromativ according to ISO standard section 7.2.6, but according
to A 2.4.3 the background uniformity is tested by this function.

float widthOfHead ()
Horizontal distance between the points where the external ear connects the head in
pixels.

float lengthOfHead ()
Vertical distance between base of the chin and the crown in pixels.

float chin ()
Returns the estimated distance (in pixel) of chin plane from the eyes plan.

float crown ()
Returns the estimated distance (in pixel) of crown plane from the eyes plan.

float ear0 ()
Returns the estimated distance (in pixel) between the center of the face and the left
bounding plane of the face reagion marked by the coordinate point 10.10 (left ear to
head connection, see ISO standard 5.6.3.

float ear1 ()
Returns the estimated distance (in pixel) between the center of the face and the left
bounding plane of the face reagion marked by the coordinate point 10.10 (left ear to
head connection, see ISO standard 5.6.3.
c 2009 by Cognitec Systems GmbH
Copyright

41

42

Class Documentation

float poseAngleRoll ()
Returns the tangent of the Pose Angle - Roll.

float deviationFromFrontalPose ()
Returns a measure for the deviation from frontal pose.

float isMale ()
Returns a measure for the probability that the image contains a portrait of a male
person.

float isChild ()
Returns a measure for the probability that the image contains a portrait of a child
(person in the age of 0 - 7 years).

float isToddler ()
Returns a measure for the probability that the image of an child contains a portrait of
an toddler (person in the age of 0 - 4 years).

float isInfant ()
Returns a measure for the probability that the image of an toddler contains a portrait
of an infant (person in the age of 0 - 1 year).

float isBelow26 ()
returns measurement for the probability that the given image is below 26 age

float isBelow36 ()
returns measurement for the probability that the given image is below 36 age

float mouthClosed ()
Returns a measure how open a mouth is.

float deviationFromUniformLighting ()
Returns a measure for the deviation from uniform lighting in the face area.

10.5.1

Detailed Description

Portrait Characteristics.
An instance of this class is produced by analyzing a face portrait using Portrait.Analyzer. It provides various measures important for determining compliance
with ISO 19794 5.
c 2009 by Cognitec Systems GmbH
Copyright

10.5 Characteristics Class Reference

10.5.2

Member Function Documentation

10.5.2.1

uint width ()

the width of the portrait image


10.5.2.2

uint height ()

the height of the portrait image


10.5.2.3

Position eye0 ()

Coordinate of Feature Point 12.2 (Right eye center).


See ISO 19794 5 5.6.4.
10.5.2.4

Position eye1 ()

Coordinate of Feature Point 12.1 (Left eye center).


See ISO 19794 5 5.6.4.
10.5.2.5

float eyeDistance ()

Get the eye distance in pixels.


10.5.2.6

Position faceCenter ()

Coordinate of the center of the line connecting Feature Points 12.1 and 12.2 (Center of
left and right eye) See ISO standard 5.6.4.
10.5.2.7

uint numberOfFaces ()

Try to detect all faces within the given image, ignores given position.
10.5.2.8

float eye0Open ()

Returns the confidence for the persons eye0 beeing open.


Higher values mean a higer confidence. See ISO standard 7.2.3.
10.5.2.9

float eye1Open ()

Returns the confidence for the persons eye1 beeing open.


Higher values mean a higer confidence. See ISO standard 7.2.3.
c 2009 by Cognitec Systems GmbH
Copyright

43

44

Class Documentation
10.5.2.10

float eye0GazeFrontal ()

Returns the confidence for the persons eye0 looking frontal to the camera.
The higher the returned value is, the more frontal the gaze is. See ISO standard 7.2.3.

10.5.2.11

float eye1GazeFrontal ()

Returns the confidence for the persons eye1 looking frontal to the camera.
The higher the returned value is, the more frontal the gaze is. See ISO standard 7.2.3.

10.5.2.12

float eye0Tinted ()

Returns a value how tinted the left eye and the environment is.
Higher Value means mor tinted. See ISO standard 7.2.11.

10.5.2.13

float eye1Tinted ()

Returns a value how tinted the right eye and the environment is.
Higher Value means mor tinted. See ISO standard 7.2.11.

10.5.2.14

float eye0Red ()

Returns the redness of eyes pupils.


See ISO standard 7.3.4.

10.5.2.15

float eye1Red ()

Returns the redness of eyes pupils.


See ISO standard 7.3.4.

10.5.2.16

float glasses ()

Returns a measure for the probability of the person in the portrait to wear glasses See
ISO standard A.3.2.4.

10.5.2.17

float exposure ()

Returns average gray value within facial region.


c 2009 by Cognitec Systems GmbH
Copyright

10.5 Characteristics Class Reference


10.5.2.18

uint grayScaleDensity ()

Gray scale density (number of different gray values) within facial region.
The facial region used is the area enclosed by the 2 semiellipses uniquely defined by
crown(), ear0(), ear1() and chin(), ear0(), ear1(), respectively. See ISO standard 7.4.2.1

10.5.2.19

float naturalSkinColour ()

Returns the natural colours ratio ( 0.0 - 1.0) within face region.
For details refer to ISO standard section 7.3.4.

10.5.2.20

float hotSpots ()

Returns the percentage of hot spot pixels ( 0.0 - 1.0) within face region.
For details refer to ISO standard section 7.2.10 and 7.2.11.

10.5.2.21

float backgroundUniformity ()

Background ist not nromativ according to ISO standard section 7.2.6, but according to
A 2.4.3 the background uniformity is tested by this function.

10.5.2.22

float widthOfHead ()

Horizontal distance between the points where the external ear connects the head in
pixels.
See ISO 19794 5 8.3.4.

10.5.2.23

float lengthOfHead ()

Vertical distance between base of the chin and the crown in pixels.
See ISO 19794 5 8.3.5.

10.5.2.24

float chin ()

Returns the estimated distance (in pixel) of chin plane from the eyes plan.
Chin is definded as the central forward portion of the lower jaw (see ISO standard 4.1.)
In context of face recognition it is a part to determine the face region. So, chin can be
seen as a lower limit plane of the face region. The eyes plane is defined by the eyes
position and the chin plane is parallel to the eyes plane.
c 2009 by Cognitec Systems GmbH
Copyright

45

46

Class Documentation
10.5.2.25

float crown ()

Returns the estimated distance (in pixel) of crown plane from the eyes plan.
Crown is definded as the top head if it could be seen (see ISO standard 4.6.) In context
of face recognition it is a part to determine the face region. So, crown can be seen as a
upper limit plane of the face region. The eyes plane is defined by the eyes position and
the crown plane is parallel to the eyes plane.

10.5.2.26

float ear0 ()

Returns the estimated distance (in pixel) between the center of the face and the left
bounding plane of the face reagion marked by the coordinate point 10.10 (left ear to
head connection, see ISO standard 5.6.3.
).

10.5.2.27

float ear1 ()

Returns the estimated distance (in pixel) between the center of the face and the left
bounding plane of the face reagion marked by the coordinate point 10.10 (left ear to
head connection, see ISO standard 5.6.3.
).

10.5.2.28

float poseAngleRoll ()

Returns the tangent of the Pose Angle - Roll.


This is the rotation about the horizontal axis from front to back. See ISO 19794 5
5.5.8.3 and 7.2.2.

10.5.2.29

float deviationFromFrontalPose ()

Returns a measure for the deviation from frontal pose.


Higher values mean larger deviation from frontal pose. See ISO standard 7.2.2.

10.5.2.30

float isMale ()

Returns a measure for the probability that the image contains a portrait of a male person.

10.5.2.31

float isChild ()

Returns a measure for the probability that the image contains a portrait of a child (person in the age of 0 - 7 years).
c 2009 by Cognitec Systems GmbH
Copyright

10.5 Characteristics Class Reference


10.5.2.32

float isToddler ()

Returns a measure for the probability that the image of an child contains a portrait of
an toddler (person in the age of 0 - 4 years).
10.5.2.33

float isInfant ()

Returns a measure for the probability that the image of an toddler contains a portrait of
an infant (person in the age of 0 - 1 year).
10.5.2.34

float isBelow26 ()

returns measurement for the probability that the given image is below 26 age
10.5.2.35

float isBelow36 ()

returns measurement for the probability that the given image is below 36 age
10.5.2.36

float mouthClosed ()

Returns a measure how open a mouth is.


10.5.2.37

float deviationFromUniformLighting ()

Returns a measure for the deviation from uniform lighting in the face area.
Higher absolute values mean higher deviation. The implementation returns a value
within the range of [-1..1]. Negative values mean an darker left side and a brighter
right side, positive values the opposite. See ISO standard 7.2.7

c 2009 by Cognitec Systems GmbH


Copyright

47

48

Class Documentation

10.6

Compliance Class Reference

Compliance assessment results.

Public Member Functions


bool onlyOneFaceVisible ()
Only one face has to be visible in the image according to ISO 19794 5 7.2.4.

bool goodVerticalFacePosition ()
Test the vertical position of the face.

bool horizontallyCenteredFace ()
Test whether the face is centered in the image.

bool widthOfHead ()
Width of the head compared to image width.

bool widthOfHeadBestPractice ()
According to section A 3.2.2 best practice is a range of image width to face width
ratio betwee 1.4 and 2.0.

bool lengthOfHead ()
Length of head is limited to the range of 60% to 90% of the image height.

bool lengthOfHeadBestPractice ()
Best practice reduces the range of face length to 70% to 80% of the image hieght.

bool resolution ()
Resolution of the full images shall be at least 18x0 pixels for the width of the head or
90 pixels from eye center to eye center (see ISO standard 8.4.1).

bool resolutionBestPractice ()
Best Practice recommendation are more strict.

bool imageWidthToHeightBestPractice ()
Paragraph A3.2.1 of ISO standard describes a best practice of ratio between image
height and width.

bool goodGrayScaleProfile ()
Grayscale density 7 bit or 128 intensity values.

bool hasNaturalSkinColour ()
Natural colours in face region Returns true if the face region has natural colors,
otherwise false.

c 2009 by Cognitec Systems GmbH


Copyright

10.6 Compliance Class Reference


bool noHotSpots ()
Hot Spots (bright areas of light reflected from the face).

bool isBackgroundUniformBestPractice ()
background uniformity.

bool goodExposure ()
See ISO 19794 5 7.3.2.

bool isFrontal ()
The face is considered frontal if the rotation of the head is less than +/-5 degrees from
frontal for yaw and pitch and if roll angle of head is less then +/-8 degrees.

bool isFrontalBestPractice ()
The face is considered frontal if the rotation of the head is less than +/-5 degrees from
frontal in every direction (roll, pitch and yaw).

bool isLightingUniform ()
Returns true if lighting is equally distributed in the face area.

bool eyesOpenBestPractice ()
Returns true if the persons eyes are open.

bool eyesGazeFrontalBestPractice ()
Returns true if the persons eyes are looking frontal to the camera.

bool eyesNotRedBestPractice ()
returns true if both eyes pupils are not detected as red.

bool noTintedGlasses ()
according to 7.2.11 and best recommendations glasses should not be tinted.

bool isSharp ()
returns true if the face area (from chin to crown and from left to right ear) fits the
focus and depth in field characteristics (see ISO 19794 5 section 7.3.3).

bool mouthClosedBestPractice ()
returns true if mouth is closed according to ISO 19794 5 section 7.2.3

bool isCompliant ()
Returns true if the images is compliant with the ISO 19794 5 requirements only.

bool isBestPractice ()
The test contains is Compliant and additionally all checks according to best practice
represented by function names of this class with BestPractice in name.

c 2009 by Cognitec Systems GmbH


Copyright

49

50

Class Documentation

10.6.1

Detailed Description

Compliance assessment results.


Instances of this class represent the compliance of portraits with the Full Frontal Image
requirements. They can be produced using instances of FullFrontal.Test.

10.6.2

Member Function Documentation

10.6.2.1

bool onlyOneFaceVisible ()

Only one face has to be visible in the image according to ISO 19794 5 7.2.4.
10.6.2.2

bool goodVerticalFacePosition ()

Test the vertical position of the face.


0.5 image height < eyes line < 0.7 image height. For children under 11 years: 0.4
image height See ISO 19794 5 8.3.3.
10.6.2.3

bool horizontallyCenteredFace ()

Test whether the face is centered in the image.


See ISO 19794 5 8.3.2
10.6.2.4

bool widthOfHead ()

Width of the head compared to image width.


It should be between 50% and 75% of the image width. See ISO 19794 5 8.3.4.
10.6.2.5

bool widthOfHeadBestPractice ()

According to section A 3.2.2 best practice is a range of image width to face width ratio
betwee 1.4 and 2.0.
10.6.2.6

bool lengthOfHead ()

Length of head is limited to the range of 60% to 90% of the image height.
See ISO 19794 5 8.3.5.
10.6.2.7

bool lengthOfHeadBestPractice ()

Best practice reduces the range of face length to 70% to 80% of the image hieght.
See ISO 19794 5 A 3.2.3.
c 2009 by Cognitec Systems GmbH
Copyright

10.6 Compliance Class Reference


10.6.2.8

bool resolution ()

Resolution of the full images shall be at least 18x0 pixels for the width of the head or
90 pixels from eye center to eye center (see ISO standard 8.4.1).
10.6.2.9

bool resolutionBestPractice ()

Best Practice recommendation are more strict.


A face should be 240 pixel in width (roughly 120 Pixel eye to eye distance, see ISO
standard A3.1.1).
10.6.2.10

bool imageWidthToHeightBestPractice ()

Paragraph A3.2.1 of ISO standard describes a best practice of ratio between image
height and width.
It should be between 1.25 and 1.34.
10.6.2.11

bool goodGrayScaleProfile ()

Grayscale density 7 bit or 128 intensity values.


Color saturation See ISO standard 7.4.2.1 and 7.4.2.2.
10.6.2.12

bool hasNaturalSkinColour ()

Natural colours in face region Returns true if the face region has natural colors, otherwise false.
See ISO 19794 5 standard 7.3.4
10.6.2.13

bool noHotSpots ()

Hot Spots (bright areas of light reflected from the face).


Refer to ISO standard section 7.2.10 and 7.2.11.
10.6.2.14

bool isBackgroundUniformBestPractice ()

background uniformity.
returns true if the background is uniform. See ISO Standard A 2.4.3
10.6.2.15

bool goodExposure ()

See ISO 19794 5 7.3.2.


c 2009 by Cognitec Systems GmbH
Copyright

51

52

Class Documentation
10.6.2.16

bool isFrontal ()

The face is considered frontal if the rotation of the head is less than +/-5 degrees from
frontal for yaw and pitch and if roll angle of head is less then +/-8 degrees.
See ISO 19794 5 7.2.2.

10.6.2.17

bool isFrontalBestPractice ()

The face is considered frontal if the rotation of the head is less than +/-5 degrees from
frontal in every direction (roll, pitch and yaw).
See ISO 19794 5 7.2.2 and A 2.2.

10.6.2.18

bool isLightingUniform ()

Returns true if lighting is equally distributed in the face area.


That means that there is no significant direction of the light from the point of view of
the photographer. See ISO standard 7.2.7

10.6.2.19

bool eyesOpenBestPractice ()

Returns true if the persons eyes are open.


See ISO standard 7.2.3.

10.6.2.20

bool eyesGazeFrontalBestPractice ()

Returns true if the persons eyes are looking frontal to the camera.
See ISO standard 7.2.3.

10.6.2.21

bool eyesNotRedBestPractice ()

returns true if both eyes pupils are not detected as red.


Eyes are checkend independendly and the result is a logical AND of both single checks.
See ISO standard 7.3.4.

10.6.2.22

bool noTintedGlasses ()

according to 7.2.11 and best recommendations glasses should not be tinted.


tintedGlasses() returns true if face wears glasses and glasses are tinted.
c 2009 by Cognitec Systems GmbH
Copyright

10.6 Compliance Class Reference


10.6.2.23

bool isSharp ()

returns true if the face area (from chin to crown and from left to right ear) fits the focus
and depth in field characteristics (see ISO 19794 5 section 7.3.3).
10.6.2.24

bool mouthClosedBestPractice ()

returns true if mouth is closed according to ISO 19794 5 section 7.2.3


10.6.2.25

bool isCompliant ()

Returns true if the images is compliant with the ISO 19794 5 requirements only.
If it failes only member function without BestPractice in name must be checked in
order to get the reason why the test failes.
10.6.2.26

bool isBestPractice ()

The test contains is Compliant and additionally all checks according to best practice
represented by function names of this class with BestPractice in name.
True is return incase of all checks are passed, else false is returned.

c 2009 by Cognitec Systems GmbH


Copyright

53

54

Class Documentation

10.7

Configuration Class Reference

Opaque configuration object of the FaceVACS SDK library.

Public Member Functions


Configuration (string s)
Construct Configuration object from given configuration file.

Configuration (System.IO.Stream s)
Constructor for creating from given stream.

string licenseInformation ()
returns a string which contains the license information

string getValue (string key)


Configuration item value access, returns the string representation of the configuration
items value, the key has to be a valid configuration item name in dotted notation, e.g.

void setValue (string key, string value)


Set configuration item to given value, the key has to be a valid configuration item
name, the value has to the string representation of the items value, e.g.

void resetToDefault (string key)


Reset the configuration item to the default value.

ProtectedItem[ ] protectedItems ()
returns a list of configuration items (key/value pairs) which are protected by the license key.

Classes
struct ProtectedItem
key value pair of a protected key

10.7.1

Detailed Description

Opaque configuration object of the FaceVACS SDK library.

10.7.2

Constructor & Destructor Documentation

10.7.2.1

Configuration (string s)

Construct Configuration object from given configuration file.


c 2009 by Cognitec Systems GmbH
Copyright

10.7 Configuration Class Reference


10.7.2.2

Configuration (System.IO.Stream s)

Constructor for creating from given stream.

10.7.3

Member Function Documentation

10.7.3.1

string licenseInformation ()

returns a string which contains the license information


10.7.3.2

string getValue (string key)

Configuration item value access, returns the string representation of the configuration
items value, the key has to be a valid configuration item name in dotted notation, e.g.
FRSDK.ComparisonAlgorithm
10.7.3.3

void setValue (string key, string value)

Set configuration item to given value, the key has to be a valid configuration item name,
the value has to the string representation of the items value, e.g.
B2ComparisonAlgorithm, 0.5 or 42. The changes will become persistent if the
Configuration object was created from a configFilename. Otherwise the changes will
apply to the current object only. Note that most classes use the configuration at object
construction time only. In these cases later changes might have no effect.
10.7.3.4

void resetToDefault (string key)

Reset the configuration item to the default value.


The key has to be a valid configuration item name. The default values can be inspected
using the configuration editor
10.7.3.5

ProtectedItem [ ] protectedItems ()

returns a list of configuration items (key/value pairs) which are protected by the license
key.
Changing keys or values from that list in the FaceVACS-SDK configuration file will
cause LicenseSignatureMismatch exceptions.

c 2009 by Cognitec Systems GmbH


Copyright

55

56

Class Documentation

10.8

Configuration.ProtectedItem Struct Reference

key value pair of a protected key

Public Attributes
string key
key

string value
value

10.8.1

Detailed Description

key value pair of a protected key

10.8.2

Member Data Documentation

10.8.2.1

string key

key
10.8.2.2

string value

value

c 2009 by Cognitec Systems GmbH


Copyright

10.9 Creator Class Reference

10.9

Creator Class Reference

Extract a Full Frontal Image from the source image.

Public Member Functions


AnnotatedImage extract (AnnotatedImage source)
extract the Full frontal Image from an annotated image

AnnotatedImage extract (AnnotatedImage source, float headLengthToImageHeightRatio, float verticalHeadToImagePositionRatio)


extract the Full frontal Image from an annotated image, headLengthToImageHeightRatio and verticalHeadToImagePositionRatio can be given at runtime.

10.9.1

Detailed Description

Extract a Full Frontal Image from the source image.


meeting the geometric requirements ISO 19794 5 8.3 and with respect to geometrical
recommendation of section A.3.2.3 Table 17. Resolution of the image (see section
8.4.1) is not modified by the function. It means the input image should always fit the
requirement of a full frontal image for resolution ( minimal resolution: 180 pixel head
width or 90 pixel from eye center to eye center) tobe standard compliant.
There is a configuration key influencing the image height to width reatio of the target
image. The default value is 45/35.

10.9.2

Member Function Documentation

10.9.2.1

AnnotatedImage extract (AnnotatedImage source)

extract the Full frontal Image from an annotated image


10.9.2.2

AnnotatedImage extract (AnnotatedImage source,


float headLengthToImageHeightRatio, float
verticalHeadToImagePositionRatio)

extract the Full frontal Image from an annotated image, headLengthToImageHeightRatio and verticalHeadToImagePositionRatio can be given at runtime.
It describes ratio of head to image dimension of the cropped area.

c 2009 by Cognitec Systems GmbH


Copyright

57

58

Class Documentation

10.10

Exception Struct Reference

An object of this type is thrown if exceptions in the library occure.


Inheritance diagram for Exception::

Exception
FeatureDisabled

10.10.1

LicenseSignatureMismatch

LimitExceeded

Detailed Description

An object of this type is thrown if exceptions in the library occure.


The Exception is of type System.Exception and thus provides all members of this base
class.

c 2009 by Cognitec Systems GmbH


Copyright

10.11 FacialMatchingEngine Class Reference

10.11

FacialMatchingEngine Class Reference

Low level match facilities.

Public Member Functions


FacialMatchingEngine (Configuration c)
Build FacialMatchingEngine from given Configuration.

Score compare (FIR firA, FIR firB)


Calculate the score between firA and firB.

Score[ ] compare (FIR fir, Population population)


Calculate the scores between fir and the FIRs in population (One-To-Many Matching).

Match[ ] bestMatches (FIR fir, Population population, Score threshold, uint maxMatches)
Calculates best matches of the comparison between fir and the FIRs in the population.

10.11.1

Detailed Description

Low level match facilities.


This class contains interfaces to calculate low level comparisions between FIRs and
FIRs or Populations.

10.11.2

Constructor & Destructor Documentation

10.11.2.1

FacialMatchingEngine (Configuration c)

Build FacialMatchingEngine from given Configuration.

10.11.3

Member Function Documentation

10.11.3.1

Score compare (FIR firA, FIR firB)

Calculate the score between firA and firB.


MT-safe
It is safe to call this function concurrently from different threads.

c 2009 by Cognitec Systems GmbH


Copyright

59

60

Class Documentation
10.11.3.2

Score [ ] compare (FIR fir, Population population)

Calculate the scores between fir and the FIRs in population (One-To-Many Matching).
Scores in the list returned have the same order as the FIRs within the Population.
MT-safe
It is safe to call this function concurrently from different threads. The population
has to be kept unchanged during function execution.

10.11.3.3

Match [ ] bestMatches (FIR fir, Population population, Score


threshold, uint maxMatches)

Calculates best matches of the comparison between fir and the FIRs in the population.
Matches returned are sorted by score value in descending order. Size of the match list
returned is controlled by both a score threshold and a maximum size.
MT-safe
It is safe to call this function concurrently from different threads. The population
has to be kept unchanged during function execution.
Parameters:
threshold threshold for match decision
maxMatches the maximum size of the FRsdk.Matches to be returned in the feedback

c 2009 by Cognitec Systems GmbH


Copyright

10.12 FeatureDisabled Struct Reference

10.12

FeatureDisabled Struct Reference

An object of this type is thrown at any time if requesting or accessing a disabled


FaceVACS-SDK feature.
Inheritance diagram for FeatureDisabled::

Exception
FeatureDisabled

10.12.1

Detailed Description

An object of this type is thrown at any time if requesting or accessing a disabled


FaceVACS-SDK feature.

c 2009 by Cognitec Systems GmbH


Copyright

61

62

Class Documentation

10.13

Feedback Interface Reference

The feedback from the verification process.

Public Member Functions


void start ()
Called at start of verification processing.

void processingImage (Image img)


Called for each image when processed by the processor.

void eyesFound (Eyes.Location eyeLoc)


Called if eyes have been found in the current image; the location l indicates the position they have been found at.

void eyesNotFound ()
Called if no eyes have been found in the current image, may happen if the image does
not contain a face.

void sampleQuality (float f)


Informs about sample quality of the current image; will only be called if eyes could
be found in the image.

void sampleQualityTooLow ()
Called if the sample quality of the current image is too low for verification processing.

void match (Score s)


Called if the current image could be compared with the given FIR.

void success ()
Called if the verification was successful, i.e.

void failure ()
Called if verification failed, i.e.

void end ()
Called at the end of the verification procedure; this function will be called in any case.

10.13.1

Detailed Description

The feedback from the verification process.


Abstract Verification feedback is used to transfer information from the verification process to the client.
c 2009 by Cognitec Systems GmbH
Copyright

10.13 Feedback Interface Reference

10.13.2

Member Function Documentation

10.13.2.1

void start ()

Called at start of verification processing.

10.13.2.2

void processingImage (Image img)

Called for each image when processed by the processor.

10.13.2.3

void eyesFound (Eyes.Location eyeLoc)

Called if eyes have been found in the current image; the location l indicates the position
they have been found at.

10.13.2.4

void eyesNotFound ()

Called if no eyes have been found in the current image, may happen if the image does
not contain a face.

10.13.2.5

void sampleQuality (float f)

Informs about sample quality of the current image; will only be called if eyes could be
found in the image.

10.13.2.6

void sampleQualityTooLow ()

Called if the sample quality of the current image is too low for verification processing.

10.13.2.7

void match (Score s)

Called if the current image could be compared with the given FIR.
Parameters:
s the score obtained.

10.13.2.8

void success ()

Called if the verification was successful, i.e.


at least one of the input images has got a match result above the given threshold.
c 2009 by Cognitec Systems GmbH
Copyright

63

64

Class Documentation
10.13.2.9

void failure ()

Called if verification failed, i.e.


no input image got a score above the given threshold.
10.13.2.10

void end ()

Called at the end of the verification procedure; this function will be called in any case.

c 2009 by Cognitec Systems GmbH


Copyright

10.14 Feedback Interface Reference

10.14

Feedback Interface Reference

The feedback for the identification process.

Public Member Functions


void start ()
Called at the start of identification processing.

void processingImage (Image img)


Called for each image when processed by the processor.

void eyesFound (Eyes.Location eyeLoc)


Called if eyes have been found in the current image; the location l indicates the position they have been found at.

void eyesNotFound ()
Called if no eyes have been found in the current image; this may happen if the image
does not contain a face.

void sampleQuality (float f)


Informs about sample quality of the current image; will only be called if eyes could
be found in the image.

void sampleQualityTooLow ()
Called if the sample quality of the current image is too low for identification processing.

void matches (Match[ ] matches)


Called if at least one of the input images matches with the given FIR population.

void end ()
Called at the end of identification procedure.

10.14.1

Detailed Description

The feedback for the identification process.

10.14.2

Member Function Documentation

10.14.2.1

void start ()

Called at the start of identification processing.


c 2009 by Cognitec Systems GmbH
Copyright

65

66

Class Documentation
10.14.2.2

void processingImage (Image img)

Called for each image when processed by the processor.


10.14.2.3

void eyesFound (Eyes.Location eyeLoc)

Called if eyes have been found in the current image; the location l indicates the position
they have been found at.
10.14.2.4

void eyesNotFound ()

Called if no eyes have been found in the current image; this may happen if the image
does not contain a face.
10.14.2.5

void sampleQuality (float f)

Informs about sample quality of the current image; will only be called if eyes could be
found in the image.
10.14.2.6

void sampleQualityTooLow ()

Called if the sample quality of the current image is too low for identification processing.
10.14.2.7

void matches (Match[ ] matches)

Called if at least one of the input images matches with the given FIR population.
The best match is the first one and the worst the last one. The FIRs are referenced by
names.
10.14.2.8

void end ()

Called at the end of identification procedure.


This function will be called in any case.

c 2009 by Cognitec Systems GmbH


Copyright

10.15 Feedback Interface Reference

10.15

Feedback Interface Reference

The feedback for the enrollment procedure.

Public Member Functions


void start ()
Called at start of enrollment processing.

void processingImage (Image img)


Called for each image when processed by the processor.

void eyesFound (Eyes.Location eyeLoc)


Called if eyes have been found in the current image; the Eyes.Location indicates the
position they have been found at.

void eyesNotFound ()
Called if no eyes have been found in the current image.

void sampleQuality (float f)


Informs about sample quality of the current processing image.

void sampleQualityTooLow ()
Called during stream enrollment if the sample quality of the current image is too low
for enrollment processing.

void success (FIR)


Called if the enrollment was successful; passes the FIR created.

void failure ()
Called if the enrollment was not successful (due to failure conditions).

void end ()
Called at the end of the enrollment procedure.

10.15.1

Detailed Description

The feedback for the enrollment procedure.


The Feedback interface is used for interaction with the environment during the processing of the enrollment. The member functions of the feedback will be called during
the enrollment as the processing proceeds. This make it possible to watch the status of
the enrollment for instance for gui feedback.
c 2009 by Cognitec Systems GmbH
Copyright

67

68

Class Documentation

10.15.2

Member Function Documentation

10.15.2.1

void start ()

Called at start of enrollment processing.


10.15.2.2

void processingImage (Image img)

Called for each image when processed by the processor.


10.15.2.3

void eyesFound (Eyes.Location eyeLoc)

Called if eyes have been found in the current image; the Eyes.Location indicates the
position they have been found at.
10.15.2.4

void eyesNotFound ()

Called if no eyes have been found in the current image.


This may happen if the image does not contain a face.
10.15.2.5

void sampleQuality (float f)

Informs about sample quality of the current processing image.


Will only be called during stream enrollment and only if eyes could be found in the
image.
10.15.2.6

void sampleQualityTooLow ()

Called during stream enrollment if the sample quality of the current image is too low
for enrollment processing.
10.15.2.7

void success (FIR)

Called if the enrollment was successful; passes the FIR created.


10.15.2.8

void failure ()

Called if the enrollment was not successful (due to failure conditions).


Possible failure conditions are:
the enrollment time exceeds the maximum configured (Stream enrollment only;
default: 60 s)
c 2009 by Cognitec Systems GmbH
Copyright

10.15 Feedback Interface Reference


there are less enrollable images than configured (default: 1)
some error in final intensity image preprocessing or shape image processing, if
configured.

10.15.2.9

void end ()

Called at the end of the enrollment procedure.


This function will be called in any case.

c 2009 by Cognitec Systems GmbH


Copyright

69

70

Class Documentation

10.16

Finder Class Reference

face finder

Public Member Functions


Finder (Configuration c)
create an instance of class Finder

Location[ ] find (Image i)


Location[ ] find (Image i, float minRelativeEyeDistance, float maxRelativeEyeDistance, int x1, int y1, int x2, int y2)

10.16.1

Detailed Description

face finder
This class represents a interface to the face finding procedure.

10.16.2

Constructor & Destructor Documentation

10.16.2.1

Finder (Configuration c)

create an instance of class Finder

10.16.3

Member Function Documentation

10.16.3.1

Location [ ] find (Image i)

Returns:
array of Face.Location for the faces found.
Searching is focused to faces in the eye distance range
minRelativeEyeDistance = 0.1,
maxRelativeEyeDistance = 0.4 (relative to the image width) and within the given
search box
x1 = INT MIN / 2,
y1 = INT MIN / 2,
x2 = INT MAX / 2 - 1,
y2 = INT MAX / 2 - 1, spanned by (x1, y1, x2, y2).
The search process can result in faces that are slightly smaller or bigger than suggested
by these numbers.
c 2009 by Cognitec Systems GmbH
Copyright

10.16 Finder Class Reference


10.16.3.2

Location [ ] find (Image i, float minRelativeEyeDistance, float


maxRelativeEyeDistance, int x1, int y1, int x2, int y2)

Returns:
array of Face.Location for the faces found.
Searching is focused to faces in the given eye distance range (relative to the image
width) and within the given search box spanned by (x1, y1, x2, y2). The given
search box is clipped by the boundaries of the image, so the default settings for the
search box denote that the entire image has to be used as search area. (See your compilers <limits.h> for INT MIN and INT MAX definitions.). Also note that minRelativeEyeDistance and maxRelativeEyeDistance are hints for the finding engine. The
search process can result in faces that are slightly smaller or bigger than suggested by
these numbers.

c 2009 by Cognitec Systems GmbH


Copyright

71

72

Class Documentation

10.17

Finder Class Reference

eyes finder

Public Member Functions


Finder (Configuration c)
create an instance of class Finder

Location[ ] find (Image i, Face.Location l)


returns an array of Eyes.Location found within a face at the given Face.Location.

10.17.1

Detailed Description

eyes finder
This class represents a interface to the eye finding procedure.
MT-safe
It is safe to call the find method concurrently from different threads.

10.17.2

Constructor & Destructor Documentation

10.17.2.1

Finder (Configuration c)

create an instance of class Finder

10.17.3

Member Function Documentation

10.17.3.1

Location [ ] find (Image i, Face.Location l)

returns an array of Eyes.Location found within a face at the given Face.Location.

c 2009 by Cognitec Systems GmbH


Copyright

10.18 FIR Class Reference

10.18

FIR Class Reference

FIR - Facial Identification Record.

Public Member Functions


uint size ()
returns the size of the FIR memory representation

string version ()
returns the version id string

void serialize (IntPtr buf)


write a serialized platform independent representation to a buffer which must be able
to hold at least FIR.size() bytes.

void serialize (System.IO.Stream o)


Write a serialized platform independent representation to an ostream; the format of
this representation is equal to that of the memory representation obtained with serialize( Byte).

void writeTo (ref IntPtr p)


write a platform dependent representation to a buffer which must be able to hold at
least FIR.size() bytes.

10.18.1

Detailed Description

FIR - Facial Identification Record.


The FIR is a serializable byte stream which encapsulates the transformed representation
of a face which is often called feature set. Use Enrollment.Processor to create FIRs
from primary facial data (images) or FIRBuilder to (re)create FIRs from serialized
representations.

10.18.2

Member Function Documentation

10.18.2.1

uint size ()

returns the size of the FIR memory representation

10.18.2.2

string version ()

returns the version id string


c 2009 by Cognitec Systems GmbH
Copyright

73

74

Class Documentation
10.18.2.3

void serialize (IntPtr buf)

write a serialized platform independent representation to a buffer which must be able


to hold at least FIR.size() bytes.
10.18.2.4

void serialize (System.IO.Stream o)

Write a serialized platform independent representation to an ostream; the format of this


representation is equal to that of the memory representation obtained with serialize(
Byte).
10.18.2.5

void writeTo (ref IntPtr p)

write a platform dependent representation to a buffer which must be able to hold at


least FIR.size() bytes.
After execution p points to the first byte after the FIRs data.

c 2009 by Cognitec Systems GmbH


Copyright

10.19 FIRBuilder Class Reference

10.19

FIRBuilder Class Reference

Building FIRs from serialized representations Use Enrollment.Processor to build FIRs


from primary biometric data (face images).

Public Member Functions


FIRBuilder (Configuration c)
Build a FIRBuilder from given Configuration.

FIR build (IntPtr buf, uint len)


create a FIR from platform independent representation created with FIR.serialize()

FIR build (System.IO.Stream is)


create a FIR from stream containing a platform independent representation created
with FIR.serialize()

FIR build (ref IntPtr p)


create a FIR from platform dependent representation created using FIR.writeTo, starting from p, the memory must be valid during the lifetime of the FIR object, after the
construction p points to the first byte after the FIRs data.

10.19.1

Detailed Description

Building FIRs from serialized representations Use Enrollment.Processor to build FIRs


from primary biometric data (face images).

10.19.2

Constructor & Destructor Documentation

10.19.2.1

FIRBuilder (Configuration c)

Build a FIRBuilder from given Configuration.

10.19.3

Member Function Documentation

10.19.3.1

FIR build (IntPtr buf, uint len)

create a FIR from platform independent representation created with FIR.serialize()


10.19.3.2

FIR build (System.IO.Stream is)

create a FIR from stream containing a platform independent representation created with
FIR.serialize()
c 2009 by Cognitec Systems GmbH
Copyright

75

76

Class Documentation
10.19.3.3

FIR build (ref IntPtr p)

create a FIR from platform dependent representation created using FIR.writeTo, starting from p, the memory must be valid during the lifetime of the FIR object, after the
construction p points to the first byte after the FIRs data.

c 2009 by Cognitec Systems GmbH


Copyright

10.20 Image Interface Reference

10.20

Image Interface Reference

Abstract image.
Inherited by NetImage.

Public Member Functions


bool isColor ()
returns true if image is based on color data.

uint width ()
returns the width of the image in pixels

uint height ()
returns the height of the image in pixels

IntPtr grayScaleRepresentation ()
Returns a pointer to an array of size width() x height() x sizeof( byte) containing the
gray scale representation of the image.

IntPtr colorRepresentation ()
Returns a pointer to an array of size width() x height() x sizeof( uint) containing the
color representation of the image.

string name ()
returns the name of the image, or an empty string

10.20.1

Detailed Description

Abstract image.

10.20.2

Member Function Documentation

10.20.2.1

bool isColor ()

returns true if image is based on color data.


false will be returend if the images contains only intensity information

10.20.2.2

uint width ()

returns the width of the image in pixels


c 2009 by Cognitec Systems GmbH
Copyright

77

78

Class Documentation
10.20.2.3

uint height ()

returns the height of the image in pixels


10.20.2.4

IntPtr grayScaleRepresentation ()

Returns a pointer to an array of size width() x height() x sizeof( byte) containing the
gray scale representation of the image.
The pointer has to remain valid during the whole lifetime of the Image object.
10.20.2.5

IntPtr colorRepresentation ()

Returns a pointer to an array of size width() x height() x sizeof( uint) containing the
color representation of the image.
The pointer has to remain valid during the whole lifetime of the Image object. Note
that the order of colors per pixel is BGRA (blue green red alpha) instead of RGB.
10.20.2.6

string name ()

returns the name of the image, or an empty string

c 2009 by Cognitec Systems GmbH


Copyright

10.21 ImageManipulation Struct Reference

10.21

ImageManipulation Struct Reference

Vignetting.

Public Types
enum SmoothingFunction
There are threee ways to blend the margin to the target color: Gaussian blends intensisty of each color channel with a half gaussian function, Linear blend is propotional
to the border distance and Fixed sets all pixel of margin to the border color.

Static Public Member Functions


static Image vignetting (Image img, Rgb rgb, int margin, int radius, SmoothingFunction sf )
In photographic areas vignetting is a intensity blending of round or eliptical margin
regions.

10.21.1

Detailed Description

Vignetting.

10.21.2

Member Enumeration Documentation

10.21.2.1

enum SmoothingFunction

There are threee ways to blend the margin to the target color: Gaussian blends intensisty of each color channel with a half gaussian function, Linear blend is propotional
to the border distance and Fixed sets all pixel of margin to the border color.

10.21.3

Member Function Documentation

10.21.3.1

static Image vignetting (Image img, Rgb rgb, int margin, int radius,
SmoothingFunction sf ) [static]

In photographic areas vignetting is a intensity blending of round or eliptical margin


regions.
In context of FRsdk it is a way to over blend margin to a defined color. Optionally
round edges might be created

c 2009 by Cognitec Systems GmbH


Copyright

79

80

Class Documentation

10.22

ImagePropertiesFeedback Class Reference

feedback for getting image properties on image loading

Public Member Functions


ImagePropertiesFeedback ()
body/handle supporting ctor.

void compressionMode (const .FRsdk.ImageIO.ref ColorMode cm)


the given Parameter tells about the original coding/compression of the image data.

void pixelDepth (uint pd)


get the pixel depth in bit per pixel.

10.22.1

Detailed Description

feedback for getting image properties on image loading

10.22.2

Constructor & Destructor Documentation

10.22.2.1

ImagePropertiesFeedback ()

body/handle supporting ctor.

10.22.3

Member Function Documentation

10.22.3.1

void compressionMode (const .FRsdk.ImageIO.ref ColorMode cm)

the given Parameter tells about the original coding/compression of the image data.
10.22.3.2

void pixelDepth (uint pd)

get the pixel depth in bit per pixel.


In color mode the different channels precisions will be accumulated.

c 2009 by Cognitec Systems GmbH


Copyright

10.23 Jpeg Struct Reference

10.23

Jpeg Struct Reference

JPEG image support.

Static Public Member Functions


static Image load (string filename)
Constructs an image representation from the given file which must be in jpeg format.

static Image load (System.IO.Stream s)


Constructs an image representation from the given stream which is in jpeg format.

static Image load (IntPtr buf, uint size)


Constructs an image representation from memory which is in jpeg format.

static int save (Image i, System.IO.Stream s, int quality)


saves image to ostream with given jpeg quality (1 .

static int save (Image i, string filename, int quality)


saves the image to a file given by name with given jpeg quality (1 .

static Properties saveWithSizeConstraint (Image i, System.IO.Stream s, int maxSize)


saves the image to the ostream which has a size constraint given by maxSize (Byte).

Classes
struct Properties
contains properties of a JPEG image

10.23.1

Detailed Description

JPEG image support.


JPEG (pronounced jay-peg) is a standardized compression method for full-color and
gray scale images. The FaceVACS-SDK jpeg supporting software is based in part on
the work of the Independent JPEG Group.
FaceVACS-SDK supports the following jpeg formats:
loading:
color and gray scale images of any compression quality
saving:
c 2009 by Cognitec Systems GmbH
Copyright

81

82

Class Documentation
color and gray scale images, with quality parameter.
MT-safe It is safe to call the member functions
concurrently from different threads.

10.23.2

Member Function Documentation

10.23.2.1

static Image load (string filename) [static]

Constructs an image representation from the given file which must be in jpeg format.
10.23.2.2

static Image load (System.IO.Stream s) [static]

Constructs an image representation from the given stream which is in jpeg format.
10.23.2.3

static Image load (IntPtr buf, uint size) [static]

Constructs an image representation from memory which is in jpeg format.


10.23.2.4

static int save (Image i, System.IO.Stream s, int quality) [static]

saves image to ostream with given jpeg quality (1 .


. 100). Note that the decreasing jpeg quality has an impact on the biometric equal error
rate.
The increase of the equal error rate measured on some representative face databases is:
quality = 100: no increase of equal error rate quality = 80: increases the equal error
rate by 3.5% quality = 50: increases the equal error rate by 10.5%
Returns the number of bytes written to the stream.
10.23.2.5

static int save (Image i, string filename, int quality) [static]

saves the image to a file given by name with given jpeg quality (1 .
. 100) Note that jpeg quality influences the For a details see the ostream based save()
function description above.
Returns the number of bytes written to the file.
10.23.2.6

static Properties saveWithSizeConstraint (Image i, System.IO.Stream


s, int maxSize) [static]

saves the image to the ostream which has a size constraint given by maxSize (Byte).
Returns the achieved JPEG image Properties.

c 2009 by Cognitec Systems GmbH


Copyright

10.24 Jpeg2000 Struct Reference

10.24

Jpeg2000 Struct Reference

JPEG 2000 image support.

Static Public Member Functions


static Image load (string filename)
Loads an image representation from the given file which must be in jpeg 2000 format.

static Image load (IntPtr buf, uint size)


Loads an image representation from memory which is expected to contain jpeg 2000
format.

10.24.1

Detailed Description

JPEG 2000 image support.


JPEG 2000 (pronounced jay-peg) is a standardized compression method for fullcolor and gray scale images. The FaceVACS-SDK jpeg 2000 supporting software is
based on JASPER.
FaceVACS-SDK supports the following jpeg formats:
loading:
color and gray scale images of any compression quality
saving:
sorry, nothing.
MT-safe It is safe to call functions concurrently
from different threads.

10.24.2

Member Function Documentation

10.24.2.1

static Image load (string filename) [static]

Loads an image representation from the given file which must be in jpeg 2000 format.
10.24.2.2

static Image load (IntPtr buf, uint size) [static]

Loads an image representation from memory which is expected to contain jpeg 2000
format.

c 2009 by Cognitec Systems GmbH


Copyright

83

84

Class Documentation

10.25

Jpeg.Properties Struct Reference

contains properties of a JPEG image

Public Attributes
int fileSize
the file size

int quality
the JPEG quality

10.25.1

Detailed Description

contains properties of a JPEG image

10.25.2

Member Data Documentation

10.25.2.1

int fileSize

the file size


10.25.2.2

int quality

the JPEG quality

c 2009 by Cognitec Systems GmbH


Copyright

10.26 LenseDistortionCorrector Class Reference

10.26

LenseDistortionCorrector Class Reference

Lens distorsion correction.

Public Member Functions


LenseDistortionCorrector (Configuration c, float k, uint img w, uint img h, int
dcx, int dcy)
Image undistort (Image img)

10.26.1

Detailed Description

Lens distorsion correction.


Instantiate a LenseDistortionCorrector. The distortion parameter k can be positive or
negative, where positive values correct barrel distortions, while negative values correct pillow distortions. The minimum and maximum admissible values for k depend
on the instantiation image size. Inappropriate values will cause an exception upon
instantiation. With larger images the maximum appropriate (absolute) value of k decreases. Values outside of [-1,1] are always inappropriate.
The appropriate value for k is best determined visually by examining an image (e.g.
displaying a rectangular grid) distorted by the lense and gradually changing k until
the distortion is minimized. For this purpose FaceVACS SDK provides the ldcview
utility in the bin subdir. Note that due to performance reasons the distortion model is
an approximate one and will work properly with small values of k only.

10.26.2

Constructor & Destructor Documentation

10.26.2.1

LenseDistortionCorrector (Configuration c, float k, uint img w, uint


img h, int dcx, int dcy)

Parameters:
k Parameter controlling undistortion.
img w width of images to be processed
img h height of images to be processed
dcx (optical axis) relative to image center, should be 0 in most cases
dcy (optical axis) relative to image center, should be 0 in most cases

10.26.3

Member Function Documentation

10.26.3.1

Image undistort (Image img)

Parameters:
img The Image to be undistorted. Dimensions (w,h) of the image must match
those used to instantiate this LenseDistortionCorrector

c 2009 by Cognitec Systems GmbH


Copyright

85

86

Class Documentation

10.27

LicenseSignatureMismatch Struct Reference

License signature mismatch.


Inheritance diagram for LicenseSignatureMismatch::

Exception
LicenseSignatureMismatch

10.27.1

Detailed Description

License signature mismatch.


An object of this type is thrown at any time if the license signature is corrupt or missing.

c 2009 by Cognitec Systems GmbH


Copyright

10.28 LimitExceeded Struct Reference

10.28

LimitExceeded Struct Reference

An object of this type is thrown at any time if a configured limit of FaceVACS-SDK is


exceeded.
Inheritance diagram for LimitExceeded::

Exception
LimitExceeded

10.28.1

Detailed Description

An object of this type is thrown at any time if a configured limit of FaceVACS-SDK is


exceeded.

c 2009 by Cognitec Systems GmbH


Copyright

87

88

Class Documentation

10.29

Location Struct Reference

The Face.Location describes a image location where a face was found.

Public Attributes
Position pos
the face position

float width
the width of the found face

float confidence
confidence for the face

float rotationAngle
rotation angle for the face

10.29.1

Detailed Description

The Face.Location describes a image location where a face was found.


The Position pos is the middle point of a line crossing the eyes of that face. The width
is the length of the line which connects centers of the two eyes. The usual range of
the confidence is [0...5] - high values are good confidences, values near to 0 are bad
confidences. Values in the range 2 ... 4 are common. The rotation angle of the face
is in radians. To get an horizontally aligned face (eyes) patch, rotate the patch by the
rotationAngle in mathematically positive sense (with respect to the patch center).

10.29.2

Member Data Documentation

10.29.2.1

Position pos

the face position

10.29.2.2

float width

the width of the found face

10.29.2.3

float confidence

confidence for the face


c 2009 by Cognitec Systems GmbH
Copyright

10.29 Location Struct Reference


10.29.2.4

float rotationAngle

rotation angle for the face

c 2009 by Cognitec Systems GmbH


Copyright

89

90

Class Documentation

10.30

Location Struct Reference

The Eyes.Location describes a location in the image where eyes within a face have
been found.

Public Attributes
Position first
position of first eye

Position second
position of second eye

float firstConfidence
confidence for first eye

float secondConfidence
confidence for second eye

10.30.1

Detailed Description

The Eyes.Location describes a location in the image where eyes within a face have
been found.
The positions represent the center (located at half the distance between left and right
eye corner) of the first and the second eye, respectively. First and second eye positions
are defined relative to the images coordinate system (and corresponds to the usual
way images are displayed). The first eye is by definition the one with the lowest xcoodinate and the second the other. Whether the first eye (following this definition)
is at the same time the persons actual left eye will depend on how the image is acquired and/or transformed. For common devices (cameras, scanners, image processing
libraries, displays etc), the first eye definition in our context will correspond to the persons right eye. On the contrary, if one of these devices mirrors the image, then the first
eye in this context will correspond to the persons left eye.
(WARNING: The definition in this context has nothing to do with the ISO/IEC 19794-5
Token Frontal face image type).
The usual range of the confidence is [0...6] - high values are good confidences, values
near to 0 are bad confidences. Values in the range 2 ... 4 are usual.

10.30.2

Member Data Documentation

10.30.2.1

Position first

position of first eye


c 2009 by Cognitec Systems GmbH
Copyright

10.30 Location Struct Reference


10.30.2.2

Position second

position of second eye


10.30.2.3

float firstConfidence

confidence for first eye


10.30.2.4

float secondConfidence

confidence for second eye

c 2009 by Cognitec Systems GmbH


Copyright

91

92

Class Documentation

10.31

Match Struct Reference

a named score for a match of two FIRs

Public Attributes
string name
name

Score score
score

10.31.1

Detailed Description

a named score for a match of two FIRs

10.31.2

Member Data Documentation

10.31.2.1

string name

name
10.31.2.2

Score score

score

c 2009 by Cognitec Systems GmbH


Copyright

10.32 Pgm Struct Reference

10.32

Pgm Struct Reference

PGM/PPM image format support.

Static Public Member Functions


static Image load (string filename)
constructs an image representation from the specified pgm format file

static void save (Image i, string filename)


Saves the image to filename; gray scale images will be stored in pgm-format, color
images in ppm-format.

10.32.1

Detailed Description

PGM/PPM image format support.


The functions in this class provide support for PGM ( portable graymap file format)
and PPM (portable pixmap file format).
MT-safe It is safe to call the functions concurrently
from different threads.

10.32.2

Member Function Documentation

10.32.2.1

static Image load (string filename) [static]

constructs an image representation from the specified pgm format file


10.32.2.2

static void save (Image i, string filename) [static]

Saves the image to filename; gray scale images will be stored in pgm-format, color
images in ppm-format.

c 2009 by Cognitec Systems GmbH


Copyright

93

94

Class Documentation

10.33

Png Struct Reference

PNG (Portable Network Graphics) image format support.

Static Public Member Functions


static Image load (System.IO.Stream s)
constructs an image representation from the given PNG formated stream

static void save (Image i, System.IO.Stream s, int compressionLevel)


Write image as PNG image to the given stream, the stream will not be closed.

10.33.1

Detailed Description

PNG (Portable Network Graphics) image format support.


This functions provide support for PNG (portable networks graphics) image format.
MT-safe It is safe to call the functions concurrently
from different threads.

10.33.2

Member Function Documentation

10.33.2.1

static Image load (System.IO.Stream s) [static]

constructs an image representation from the given PNG formated stream


10.33.2.2

static void save (Image i, System.IO.Stream s, int compressionLevel)


[static]

Write image as PNG image to the given stream, the stream will not be closed.
The intention of the PNG image format is to be lossless. Compression is in the range
from 0-9, 0 means no compression and fast reading/writing 9 means high compression
and slower reading/writing. The default level is 6 which is a compromise in speed and
compression.

c 2009 by Cognitec Systems GmbH


Copyright

10.34 Population Class Reference

10.34

Population Class Reference

An ordered (in the order of additions by add() ) set of named FIRs which represents
the population used for identifications.

Public Member Functions


Population (Configuration c)
create a Population object using the given Configuration

void append (FIR fir, string name)


append a named FIR to the population

void remove (string name)


remove a FIR by name from the population

FIR get (string name)


get the mapped FIR by name

10.34.1

Detailed Description

An ordered (in the order of additions by add() ) set of named FIRs which represents
the population used for identifications.

10.34.2

Constructor & Destructor Documentation

10.34.2.1

Population (Configuration c)

create a Population object using the given Configuration

10.34.3

Member Function Documentation

10.34.3.1

void append (FIR fir, string name)

append a named FIR to the population


10.34.3.2

void remove (string name)

remove a FIR by name from the population


10.34.3.3

FIR get (string name)

get the mapped FIR by name


c 2009 by Cognitec Systems GmbH
Copyright

95

96

Class Documentation

10.35

Position Struct Reference

continuous two-dimensional coordinates

Public Attributes
float x
the x coordinate

float y
the y coordinate

10.35.1

Detailed Description

continuous two-dimensional coordinates


A Position describes continuous two-dimensional coordinates. The conversions between discrete (x) and continuous (x) coordinates are:
x = int( floor( x))
x = x + 0.5f

10.35.2

Member Data Documentation

10.35.2.1

float x

the x coordinate
10.35.2.2

float y

the y coordinate

c 2009 by Cognitec Systems GmbH


Copyright

10.36 Processor Class Reference

10.36

Processor Class Reference

this class represents the interface to the enrollment process

Public Member Functions


Processor (Configuration c)
create an instance of Enrollment.Processor using given Configuration

void process (CaptureDevice capDev, Feedback fb)


Stream enrollment.

void process (Sample[ ] a, Feedback fb)


Set enrollment from Samples.

FIR merge (FIR a, FIR b)


Merging of 2 FIRs to create a new one, which combines biometric features of both.

10.36.1

Detailed Description

this class represents the interface to the enrollment process


MT-safe It is safe to call the member functions
concurrently from different threads.

10.36.2

Constructor & Destructor Documentation

10.36.2.1

Processor (Configuration c)

create an instance of Enrollment.Processor using given Configuration

10.36.3

Member Function Documentation

10.36.3.1

void process (CaptureDevice capDev, Feedback fb)

Stream enrollment.
The processor sequentially captures an intensity image, runs face finding, eye finding
and preprocessing. To locate the face in each image the Face.Finder is used. The minimum number of enrollable images, the maximum number of images to be processed
as well as the maximum time to be used are configurable. Enrollable are faces where
face and eyes could have been found
where the image quality check confirms Good for Enrollment
c 2009 by Cognitec Systems GmbH
Copyright

97

98

Class Documentation
where the final preprocessing step succeeds.
If either the maximum time configured is exceeded or the maximum number of images
to be processed is reached, the enrollment fails. Otherwise,a single FIR is generated
out of the images. Note that this function will fail anyway if Shape image usage has
been configured to be mandatory.
10.36.3.2

void process (Sample[ ] a, Feedback fb)

Set enrollment from Samples.


The processor sequentially processes the Samples provided. To locate the face within
the intensity image part of each Sample not containing annotations, the Face.Finder is
used. The minimum number of enrollable Samples required is configurable. Enrollable are Samples where
face and eyes could have been found
where the final intensity image preprocessing step succeeds.
where shape image preprocessing step succeeds (in case shape image processing
has been configured)
There is no quality check applied. If all images have been processed, but less than
the minimum number of enrollable Samples have been found, the enrollment fails.
Otherwise, a single FIR is created.
10.36.3.3

FIR merge (FIR a, FIR b)

Merging of 2 FIRs to create a new one, which combines biometric features of both.
When using this function, take into account that the capacity of an FIR is limited and
that using an FIR merged from a set of FIRs can result in lower biometric performance
than would result from combining results obtained from the single FIRs.

c 2009 by Cognitec Systems GmbH


Copyright

10.37 Processor Class Reference

10.37

Processor Class Reference

this class represents the interface to the verification process

Public Member Functions


Processor (Configuration c)
create an instance of class Verification.Processor with given Configuration

void process (CaptureDevice capDev, FIR fir, Score threshold, Feedback fb)
Stream verification.

void process (Sample[ ] a, FIR fir, Score threshold, Feedback fb)


Verification from Sample array.

10.37.1

Detailed Description

this class represents the interface to the verification process


MT-safe It is safe to call the member functions
concurrently from different threads.

10.37.2

Constructor & Destructor Documentation

10.37.2.1

Processor (Configuration c)

create an instance of class Verification.Processor with given Configuration

10.37.3

Member Function Documentation

10.37.3.1

void process (CaptureDevice capDev, FIR fir, Score threshold,


Feedback fb)

Stream verification.
The processor continuously fetches images from the CaptureDevice and tries to verify
the face in the image against the FIR passed upon Processor construction. Processing
terminates
once a sample could have been verified
after a configurable timeout if none of the samples was successfully verified so
far
after a configurable number of samples has been processed
c 2009 by Cognitec Systems GmbH
Copyright

99

100

Class Documentation
whatever happens first.
To locate the faces in the captured samples the Face.Finder is used.
Parameters:
fir FIR to be used for verification
threshold the threshold for verification success decision
fb the feedback for observing processing and returning results to the application

10.37.3.2

void process (Sample[ ] a, FIR fir, Score threshold, Feedback fb)

Verification from Sample array.


The processor sequentially tries to verify each sample against the FIR passed upon
Processor construction. Processing terminates either with the first sample which could
successfully be verified or after the last sample has been processed. For samples not
providing eye positions the Face.Finder is used to locate the eyes.

c 2009 by Cognitec Systems GmbH


Copyright

10.38 Processor Class Reference

10.38

Processor Class Reference

this class represents the interface to the identification process

Public Member Functions


Processor (Configuration c, Population p)
Create an instance of class Processor.

void process (CaptureDevice capDev, Score threshold, Feedback fb, uint maxMatches)
Stream identification.

void process (Sample[ ] a, Score threshold, Feedback fb, uint maxMatches)


Identification from a Sample array.

10.38.1

Detailed Description

this class represents the interface to the identification process


MT-safe It is safe to call the member functions
concurrently from different threads.

10.38.2

Constructor & Destructor Documentation

10.38.2.1

Processor (Configuration c, Population p)

Create an instance of class Processor.


Multiple instances can be created with different populations.

10.38.3

Member Function Documentation

10.38.3.1

void process (CaptureDevice capDev, Score threshold, Feedback fb,


uint maxMatches)

Stream identification.
The processor grabs continously images from the capture device and tries to identify
the face in the image if one. The process cancels after a configurable timeout if no face
was found or no person could be identified. To locate the faces in the captured sample
images the Face.Finder is used.
Parameters:
threshold threshold for match decision
c 2009 by Cognitec Systems GmbH
Copyright

101

102

Class Documentation
fb the feedback to observe processing and returning results to the application
maxMatches the maximum size of the FRsdk.Matches to be returned in the feedback

10.38.3.2

void process (Sample[ ] a, Score threshold, Feedback fb, uint


maxMatches)

Identification from a Sample array.


The processor sequentially tries to identify each sample. Once a sample could successfully be identified processing will be finished and the match list is returned via the
feedback object. For samples not containing annotations the Face.Finder is used to
locate faces in the intensity image part of the sample.

c 2009 by Cognitec Systems GmbH


Copyright

10.39 Rgb Struct Reference

10.39

Rgb Struct Reference

rgb color model

Public Attributes
unsigned char b
blue color part

unsigned char g
green color part

unsigned char r
red color part

unsigned char a
alpha channel part

10.39.1

Detailed Description

rgb color model


A Rgb type is used to represent a color as an composition of red, green and blue partitions.

10.39.2

Member Data Documentation

10.39.2.1

unsigned char b

blue color part


10.39.2.2

unsigned char g

green color part


10.39.2.3

unsigned char r

red color part


10.39.2.4

unsigned char a

alpha channel part

c 2009 by Cognitec Systems GmbH


Copyright

103

104

Class Documentation

10.40

Sample Struct Reference

Sample A compound input data type containing an image and, optionally, eyes annotation and/or shape data.

Public Member Functions


Sample (Image image )
Construct a sample from given Image.

Sample (AnnotatedImage a)
Construct a sample from annotated Image.

Sample (Image image , ShapeImage si)


Construct a sample from given Image and ShapeImage.

Public Attributes
Image image
the Image

ShapeImage shapeimage
the optional ShapeImage

Eyes.Location annotation
the annotation

10.40.1

Detailed Description

Sample A compound input data type containing an image and, optionally, eyes annotation and/or shape data.

10.40.2

Constructor & Destructor Documentation

10.40.2.1

Sample (Image image )

Construct a sample from given Image.


10.40.2.2

Sample (AnnotatedImage a)

Construct a sample from annotated Image.


c 2009 by Cognitec Systems GmbH
Copyright

10.40 Sample Struct Reference


10.40.2.3

Sample (Image image , ShapeImage si)

Construct a sample from given Image and ShapeImage.

10.40.3

Member Data Documentation

10.40.3.1

Image image

the Image
10.40.3.2

ShapeImage shapeimage

the optional ShapeImage


10.40.3.3

Eyes.Location annotation

the annotation

c 2009 by Cognitec Systems GmbH


Copyright

105

106

Class Documentation

10.41

SampleEvaluator Class Reference

Evaluate the quality of a sample (image).

Public Member Functions


SampleQuality evaluate (Image img, Eyes.Location eloc)

10.41.1

Detailed Description

Evaluate the quality of a sample (image).


The image must contain a human face whose position is passed by the 2nd argument.
The quality is based on the factors below, which are computed within face region:
number of gray values
uniformity of intensity histogram (similarity to ideal)
sharpness
noise
SampleQualities are used implicitely by the streaming versions of the enrollment, verification and identification processors. Using evaluateSample() explicitely allows for
tuning of lighting conditions and capture device configuration in respect to the quality
requirements of the FaceVACS-SDK.
If at least one of these factors is below specific limits (which may be different for
verification and enrollment), the function will set the corresponding goodFor... value
of the SampleQuality to false.
MT-safe
It is safe to call this function concurrently from different threads.

10.41.2

Member Function Documentation

10.41.2.1

SampleQuality evaluate (Image img, Eyes.Location eloc)

Parameters:
img the Image to evaluate
eloc location of the eyes

c 2009 by Cognitec Systems GmbH


Copyright

10.42 SampleQuality Struct Reference

10.42

SampleQuality Struct Reference

A description of the biometric quality of a sample (image).

Public Member Functions


SampleQuality (const .FRsdk.ref SampleQuality sq)
construct from quality description elements

Public Attributes
bool goodForEnrollment
the sample is good for Enrollment

bool goodForVerification
the sample is good for Verification ( 1-to-1 match) and Identification ( 1-to-n match)

float quality
the quality in the range of [0,1], higher values meaning better quality

string hint
a textual description of what was wrong in case of a bad quality, otherwise empty.

10.42.1

Detailed Description

A description of the biometric quality of a sample (image).


See SampleEvaluator for a description on how sample quality values are computed

10.42.2

Constructor & Destructor Documentation

10.42.2.1

SampleQuality (const .FRsdk.ref SampleQuality sq)

construct from quality description elements

10.42.3

Member Data Documentation

10.42.3.1

bool goodForEnrollment

the sample is good for Enrollment


c 2009 by Cognitec Systems GmbH
Copyright

107

108

Class Documentation
10.42.3.2

bool goodForVerification

the sample is good for Verification ( 1-to-1 match) and Identification ( 1-to-n match)
10.42.3.3

float quality

the quality in the range of [0,1], higher values meaning better quality
10.42.3.4

string hint

a textual description of what was wrong in case of a bad quality, otherwise empty.
The string is a comma separated composition of one or more of the following substrings:
Eye distance too small for Verification or
Eye distance too small for Enrollment (only one of these 2 will occur in the
hint string)
dynamic range too low
histogram shape too far from ideal
noise level too high
sharpness too low

c 2009 by Cognitec Systems GmbH


Copyright

10.43 Score Struct Reference

10.43

Score Struct Reference

This class represents a score for representing the comparison result between a FIR and
the biometric evidence.

Public Attributes
float value
the float representation of the score

10.43.1

Detailed Description

This class represents a score for representing the comparison result between a FIR and
the biometric evidence.
The range is between 0.0f and 1.0f. Applications may use requestFAR() or
requestFRR() to obtain score values corresponding to requested values of FAR
or FRR. Score values can be used as thresholds for verifications and identifications and
will be communicated as results of these operations.

10.43.2

Member Data Documentation

10.43.2.1

float value

the float representation of the score

c 2009 by Cognitec Systems GmbH


Copyright

109

110

Class Documentation

10.44

ScoreMappings Class Reference

FAR - FRR Score mappings.

Public Member Functions


ScoreMappings (Configuration c)
Build ScoreMappings from given Configuration.

Score requestFAR (float requestedFAR)


Get a score value corresponding to the requested value of FAR.

Score requestFRR (float requestedFRR)


Get a score value corresponding to the requested value of FRR.

float expectedFAR (Score threshold)


Get a value for the False Acceptance Rate that would be achieved if a given score was
used as the threshold.

float expectedFRR (Score threshold)


Get a value for the False Rejection Rate that would be achieved if a given score was
used as the threshold.

10.44.1

Detailed Description

FAR - FRR Score mappings.

10.44.2

Constructor & Destructor Documentation

10.44.2.1

ScoreMappings (Configuration c)

Build ScoreMappings from given Configuration.

10.44.3

Member Function Documentation

10.44.3.1

Score requestFAR (float requestedFAR)

Get a score value corresponding to the requested value of FAR.


This value may be used as a threshold for verification and identification operations.
Parameters:
requestedFAR The maximum value for the rate of false acceptances the application wishes to allow.

c 2009 by Cognitec Systems GmbH


Copyright

10.44 ScoreMappings Class Reference


10.44.3.2

Score requestFRR (float requestedFRR)

Get a score value corresponding to the requested value of FRR.


This value may be used as a threshold for verification and identification operations.
Parameters:
requestedFRR The maximum value for the rate of false rejections the application
wishes to allow.

10.44.3.3

float expectedFAR (Score threshold)

Get a value for the False Acceptance Rate that would be achieved if a given score was
used as the threshold.
Parameters:
threshold score used as threshold

10.44.3.4

float expectedFRR (Score threshold)

Get a value for the False Rejection Rate that would be achieved if a given score was
used as the threshold.
Parameters:
threshold score used as threshold

c 2009 by Cognitec Systems GmbH


Copyright

111

112

Class Documentation

10.45

Set Class Reference

Feature assessment results.

Public Member Functions


bool wearsGlasses ()
Returns true if the person wears eyeglasses.

Gender gender ()
Returns the gender of the person.

Ethnicity ethnicity ()
return the ethnicity of person

bool isChild ()
Returns true if the image contains a portrait of a child (person in the age of 0 - 7
years).

bool isToddler ()
Returns true if the image of an child contains a portrait of an toddler (person in the
age of 0 - 4 years).

bool isInfant ()
Returns true if the image of an toddler contains a portrait of an infant (person in the
age of 0 - 1 year).

bool isBelow26 ()
Returns true if the given image of an adult is below 26 years old.

bool isBelow36 ()
Returns true if the given image of an adult is below 36 years old.

10.45.1

Detailed Description

Feature assessment results.


An instance of this class represents portrait features detected by Portrait.Feature.Test.

10.45.2

Member Function Documentation

10.45.2.1

bool wearsGlasses ()

Returns true if the person wears eyeglasses.


c 2009 by Cognitec Systems GmbH
Copyright

10.45 Set Class Reference


10.45.2.2

Gender gender ()

Returns the gender of the person.


10.45.2.3

Ethnicity ethnicity ()

return the ethnicity of person


10.45.2.4

bool isChild ()

Returns true if the image contains a portrait of a child (person in the age of 0 - 7 years).
10.45.2.5

bool isToddler ()

Returns true if the image of an child contains a portrait of an toddler (person in the age
of 0 - 4 years).
10.45.2.6

bool isInfant ()

Returns true if the image of an toddler contains a portrait of an infant (person in the
age of 0 - 1 year).
10.45.2.7

bool isBelow26 ()

Returns true if the given image of an adult is below 26 years old.


10.45.2.8

bool isBelow36 ()

Returns true if the given image of an adult is below 36 years old.

c 2009 by Cognitec Systems GmbH


Copyright

113

114

Class Documentation

10.46

Shape Struct Reference

Shape Image I/O support.

Static Public Member Functions


static ShapeImage load (string filename)
Loads a shape image representation from the given file.

10.46.1

Detailed Description

Shape Image I/O support.

10.46.2

Member Function Documentation

10.46.2.1

static ShapeImage load (string filename) [static]

Loads a shape image representation from the given file.

c 2009 by Cognitec Systems GmbH


Copyright

10.47 ShapeImage Interface Reference

10.47

ShapeImage Interface Reference

Abstract image.
Inherited by NetShapeImage.

Public Member Functions


uint width ()
returns the width of the image in pixels

uint height ()
returns the height of the image in pixels

IntPtr vertices ()
Returns a pointer to an array of size width() x height() x sizeof( Vertex) containing the
vertices of the shape.

IntPtr mask ()
Returns a pointer to an array of size width() x height() x sizeof( bool) containing the
validity mask of the ShapeImage.

10.47.1

Detailed Description

Abstract image.

10.47.2

Member Function Documentation

10.47.2.1

uint width ()

returns the width of the image in pixels

10.47.2.2

uint height ()

returns the height of the image in pixels

10.47.2.3

IntPtr vertices ()

Returns a pointer to an array of size width() x height() x sizeof( Vertex) containing the
vertices of the shape.
The pointer has to remain valid during the whole lifetime of the ShapeImage object.
c 2009 by Cognitec Systems GmbH
Copyright

115

116

Class Documentation
10.47.2.4

IntPtr mask ()

Returns a pointer to an array of size width() x height() x sizeof( bool) containing the
validity mask of the ShapeImage.
Only vertices with a corresponding mask value of true are considered for processing.
The pointer has to remain valid during the whole lifetime of the ShapeImage object.

c 2009 by Cognitec Systems GmbH


Copyright

10.48 Test Class Reference

10.48

Test Class Reference

Test for features in a portrait.

Public Member Functions


Set assess (Portrait.Characteristics c)
Assess Portrait.Characteristics of a portrait to determine features.

10.48.1

Detailed Description

Test for features in a portrait.


Use an instance of this class to test Portrait.Characteristics for existence of portrait
features.
Hint: Use Portrait.Analyzer to get Portrait.Characteristics.
MT-safe It is safe to call the class member functions
concurrently from different threads.

10.48.2

Member Function Documentation

10.48.2.1

Set assess (Portrait.Characteristics c)

Assess Portrait.Characteristics of a portrait to determine features.

c 2009 by Cognitec Systems GmbH


Copyright

117

118

Class Documentation

10.49

Test Class Reference

Compliance assessment.

Public Member Functions


Compliance assess (Portrait.Characteristics c)
Assess Portrait.Characteristics of a portrait according to the ISO 19794 5 requiremenents.

Boundaries boundaries ()
Get struct containing the boundaries used to assess portrait charateristics.

10.49.1

Detailed Description

Compliance assessment.
An instance of this class can be used to assess Portrait.Characteristics of a portrait to
determine the compliance with the ISO 19794 5 Full Frontal Image requirements.
MT-safe It is safe to call the class member functions
concurrently from different threads.

10.49.2

Member Function Documentation

10.49.2.1

Compliance assess (Portrait.Characteristics c)

Assess Portrait.Characteristics of a portrait according to the ISO 19794 5 requiremenents.


10.49.2.2

Boundaries boundaries ()

Get struct containing the boundaries used to assess portrait charateristics.

c 2009 by Cognitec Systems GmbH


Copyright

10.50 Tracker Class Reference

10.50

Tracker Class Reference

The Face Tracker locates and tracks faces across a sequence of images in an efficient
way by analyzing the spatial and temporal dependencies between faces in subsequent
images.

Public Member Functions


Tracker (Configuration c)
create an instance of class Finder

TrackerLocation[ ] processImage (Image i, uint t)


Processes an image (usually a frame from a video stream) and returns the tracked
faces with their eyes positions in this image.

TrackerLocation[ ] processFrame (Image i)


Processes an image from a stream captured with a constant frame rate.

10.50.1

Detailed Description

The Face Tracker locates and tracks faces across a sequence of images in an efficient
way by analyzing the spatial and temporal dependencies between faces in subsequent
images.

10.50.2

Constructor & Destructor Documentation

10.50.2.1

Tracker (Configuration c)

create an instance of class Finder

10.50.3

Member Function Documentation

10.50.3.1

TrackerLocation [ ] processImage (Image i, uint t)

Processes an image (usually a frame from a video stream) and returns the tracked faces
with their eyes positions in this image.
captureTime is the capture time of the given frame img in milliseconds relative to a
user defined reference point in the past (e.g. capture time of the first frame). If the
capture time of an image passed to processImage() is equal to or lower than the capture
time of a image passed earlier the behavior is undefined.
c 2009 by Cognitec Systems GmbH
Copyright

119

120

Class Documentation
10.50.3.2

TrackerLocation [ ] processFrame (Image i)

Processes an image from a stream captured with a constant frame rate.


The frame rate can be configured.

c 2009 by Cognitec Systems GmbH


Copyright

10.51 TrackerLocation Struct Reference

10.51

TrackerLocation Struct Reference

The location of a face being tracked by the face tracker.

Public Attributes
string id
a unique ID that corresponds to the face being tracked

Eyes.Location eyesLocation
an Eyes.Location that corresponds to the face being tracked

10.51.1

Detailed Description

The location of a face being tracked by the face tracker.


Location.id denotes the identier assigned to a tracked face. A persons face tracked
across multiple frames gets the same identifier. Location.eyesLocation denotes the
positions of a tracked faces eyes in a frame.

10.51.2

Member Data Documentation

10.51.2.1

string id

a unique ID that corresponds to the face being tracked


10.51.2.2

Eyes.Location eyesLocation

an Eyes.Location that corresponds to the face being tracked

c 2009 by Cognitec Systems GmbH


Copyright

121

122

Class Documentation

10.52

WinCaptureDevice Class Reference

Win32 DirectShow video capture device.


Inheritance diagram for WinCaptureDevice::

CaptureDevice
WinCaptureDevice

Public Member Functions


WinCaptureDevice (Configuration c, string instanceName)
ctor to create from a configuration device name.

virtual Image capture ()


capture an image

bool configure ()
call up device configuration dialog provided by the device driver

bool videoFormatDialog ()
call up video format dialog provided by the device driver

VideoFormat getVideoFormat ()
retrieve current video format

bool setVideoFormat (VideoFormat v)


apply a video format.

Classes
class VideoFormat
Opaque type representing a video format (resolution, bits per pixel, etc).

10.52.1

Detailed Description

Win32 DirectShow video capture device.


This class implements a CaptureDevice which uses a Win32 DirectShow video capture
device to capture images. If the capture device does not exist or if it is already in use,
the ctor will throw a exception.
c 2009 by Cognitec Systems GmbH
Copyright

10.52 WinCaptureDevice Class Reference


MT-safe It is safe to call the class member functions
concurrently from different threads.

10.52.2

Constructor & Destructor Documentation

10.52.2.1

WinCaptureDevice (Configuration c, string instanceName)

ctor to create from a configuration device name.


Parameters:
instanceName Symbolic device name as used in the configuration.

10.52.3

Member Function Documentation

10.52.3.1

virtual Image capture () [virtual]

capture an image
Implements CaptureDevice.
10.52.3.2

bool configure ()

call up device configuration dialog provided by the device driver


10.52.3.3

bool videoFormatDialog ()

call up video format dialog provided by the device driver


10.52.3.4

VideoFormat getVideoFormat ()

retrieve current video format


10.52.3.5

bool setVideoFormat (VideoFormat v)

apply a video format.


Even if true is returned, the device still might fail to switch to this format, keeping
the current one instead.

c 2009 by Cognitec Systems GmbH


Copyright

123

124

Class Documentation

10.53

WinCaptureDevice.VideoFormat Class Reference

Opaque type representing a video format (resolution, bits per pixel, etc).

Public Member Functions


VideoFormat (System.IO.Stream i)
create from istream

void write (System.IO.Stream o)


write to ostream

10.53.1

Detailed Description

Opaque type representing a video format (resolution, bits per pixel, etc).
Since video format settings are highly device dependent, a video format created from
one video device might be inappropriate for a different one. Even a video format
created from a given device might be inappropriate to the same device under certain
conditions (e.g. a changed frame rate).

10.53.2

Constructor & Destructor Documentation

10.53.2.1

VideoFormat (System.IO.Stream i)

create from istream

10.53.3

Member Function Documentation

10.53.3.1

void write (System.IO.Stream o)

write to ostream

c 2009 by Cognitec Systems GmbH


Copyright

Chapter 11

Example Documentation
11.1

acquisition.cs

Example showing a simple image acquisition application.


// Copyright (c) 2007 Cognitec Systems GmbH
//
// $Revision: 1.11 $
//
using
using
using
using
using
using
using
using

System;
Cognitec.FRsdk;
Face = Cognitec.FRsdk.Face;
Eyes = Cognitec.FRsdk.Eyes;
Portrait = Cognitec.FRsdk.Portrait;
FullFrontal = Cognitec.FRsdk.ISO_19794_5.FullFrontal;
TokenFace = Cognitec.FRsdk.ISO_19794_5.TokenFace;
Feature = Cognitec.FRsdk.Portrait.Feature;

class EyesFinding
{
class AcquisitionError : System.Exception
{
public AcquisitionError (string msg_)
{
msg = msg_;
}
AcquisitionError () {}
public string what ()
{
return msg;
}
private string msg;
}
class ImgPropFeedback: Cognitec.FRsdk.ImageIO.Feedback
{
public ImgPropFeedback() {}

126

Example Documentation
ImgPropFeedback() {}
public void compressionMode( ref Cognitec.FRsdk.ImageIO.ImageColorMode cm)
{
Console.WriteLine( "ImageColorMode: ");
Console.WriteLine( cm);
}
public void pixelDepth( uint pd )
{
Console.WriteLine("pixelDepth: ");
Console.WriteLine(pd);
}
}

private static int usage ()


{
Console.WriteLine
("Usage: eyesfind <config file> <image file> [cbeff file [token file]] [<options>]");
Console.WriteLine
("\tconfig file
... frsdk configuration file");
Console.WriteLine
("\timage file
... an image source file name (BMP, JPEG, JPEG2000, PGM format)");
Console.WriteLine
("\tcbeff file
... a cbeff destination file name");
Console.WriteLine
("\ttoken file
... a token face image destination file name (BMP format)");
return 1;
}
public static int Main (string[] args)
{
if (args.Length < 2) return usage ();
if (args.Length > 4) return usage ();
try
{
// initialization of configuration
Configuration cfg = new Configuration (args[0]);
// face finder instantiation
Face.Finder faceFinder = new Face.Finder( cfg);
// eyes finder instantiation
Eyes.Finder eyesFinder = new Eyes.Finder (cfg);
// portrait analyzer instantiation
Portrait.Analyzer portraitAnalyzer = new Portrait.Analyzer (cfg);
// Feature assessment instantiation
Feature.Test featureTest = new Feature.Test (cfg);
// ISO 19794-5 Full Frontal image assessment instantiation
FullFrontal.Test fullFrontalTest = new FullFrontal.Test (cfg);
// ISO 19794-5 Token Face Creator instantiation
TokenFace.Creator tfcreator = new TokenFace.Creator (cfg);
Image img = null;
try // try loading jpeg image
{

c 2009 by Cognitec Systems GmbH


Copyright

11.1 acquisition.cs
img = Jpeg.load (args[1]);
}
catch {}
try // try loading jpeg2000 image
{
img = Jpeg2000.load (args[1]);
}
catch {}
try // try loading bmp image
{
img = Bmp.load (args[1]);
}
catch {}
try // try loading png image
{
System.IO.FileStream imageFile =
new System.IO.FileStream
(args[1], System.IO.FileMode.Open, System.IO.FileAccess.Read);
img = Png.load (imageFile);
}
catch {}
try // try loading pgm/ppm image
{
img = Pgm.load (args[1]);
}
catch {}
if (img == null) throw new AcquisitionError
("<image file> contains no recognized image file format");
// find faces
Face.Location[] faceLocations = faceFinder.find (img);
if (faceLocations.Length == 0) throw new AcquisitionError
("Unable to locate face!");
Face.Location faceLoc = faceLocations[0];
// print face location
Console.WriteLine
("Face location: [x={0} y={1} width={2}] (confidence={3})",
faceLoc.pos.x, faceLoc.pos.y, faceLoc.width, faceLoc.confidence);
// find eyes
Eyes.Location[] eyesLocations = eyesFinder.find (img, faceLoc);
if (eyesLocations.Length == 0) throw new AcquisitionError
("No Eyes found!");
Eyes.Location eyesLoc = eyesLocations[0];
// print eye locations
Console.WriteLine( "Eye locations: first [x={0} y={1}] (confidence={2})",
eyesLoc.first.x, eyesLoc.first.y, eyesLoc.firstConfidence);
Console.WriteLine( "
second [x={0} y={1}] (confidence={2})",
eyesLoc.second.x, eyesLoc.second.y, eyesLoc.secondConfidence);
// annotated image
AnnotatedImage annotatedImage = new AnnotatedImage (img, eyesLoc);
// analyze portrait
Portrait.Characteristics portraitCharacteristics =
portraitAnalyzer.analyze (annotatedImage);
Console.WriteLine( "Left Eye Open: (confidence={0})",

c 2009 by Cognitec Systems GmbH


Copyright

127

128

Example Documentation
portraitCharacteristics.eye0Open ());
Console.WriteLine( "Right Eye Open: (confidence={0})",
portraitCharacteristics.eye1Open ());
Console.WriteLine( "Left Eye Red: (confidence={0})",
portraitCharacteristics.eye0Red ());
Console.WriteLine ("Right Eye Red: (confidence={0})",
portraitCharacteristics.eye1Red ());
Console.WriteLine ("Left Eye Tinted: (confidence={0})",
portraitCharacteristics.eye0Tinted ());
Console.WriteLine ("Right Eye Tinted: (confidence={0})",
portraitCharacteristics.eye1Tinted ());
Console.WriteLine( "Left Eye Gaze Frontal: (confidence={0})",
portraitCharacteristics.eye0GazeFrontal());
Console.WriteLine( "Right Eye Gaze Frontal: (confidence={0})",
portraitCharacteristics.eye1GazeFrontal());
Console.WriteLine( "Exposure: {0}",
portraitCharacteristics.exposure());
Console.WriteLine( "Sharpness: {0}",
portraitCharacteristics.sharpness());
Console.WriteLine( "Natural skin color: {0}",
portraitCharacteristics.naturalSkinColour());
Console.WriteLine( "Hot spots: (confidence={0})",
portraitCharacteristics.hotSpots());
// test features
Feature.Set features = featureTest.assess (portraitCharacteristics);
if (features.wearsGlasses ())
Console.WriteLine
("Feature test: Person with glasses. (confidence={0})",
portraitCharacteristics.glasses());
else
Console.WriteLine
("Feature test: Person without glasses. (confidence={0})",
portraitCharacteristics.glasses ());

// test compliance with ISO 19794-5


FullFrontal.Compliance compliance =
fullFrontalTest.assess (portraitCharacteristics);
if( compliance.isCompliant ())
{
Console.WriteLine ("Image compliant with ISO 19794-5 requirements");
}
else
{
if( !compliance.onlyOneFaceVisible())
Console.WriteLine( "More than one face is visible!");
if( !compliance.eyesOpenBestPractice())
Console.WriteLine( "Eyes are not open!");
if( !compliance.eyesGazeFrontalBestPractice())
Console.WriteLine( "Eyes gaze not frontal!");
if( !compliance.eyesNotRedBestPractice())
Console.WriteLine("Eyes are Red!");
if( !compliance.noTintedGlasses())
Console.WriteLine("Tinted glasses!");
if( !compliance.goodVerticalFacePosition ())
Console.WriteLine ("Bad vertical face position!");
if( !compliance.horizontallyCenteredFace ())
Console.WriteLine ("Face not centered horizontally!");
if(!compliance.widthOfHeadBestPractice ())

c 2009 by Cognitec Systems GmbH


Copyright

11.1 acquisition.cs

129

Console.WriteLine ("Bad sizing (Width)!");


if( !compliance.lengthOfHeadBestPractice())
Console.WriteLine ("Bad sizing (Height)!");
if (!compliance.resolutionBestPractice())
Console.WriteLine
("Bad resolution (not enough pixels for head width)");
if (!compliance.imageWidthToHeightBestPractice())
Console.WriteLine ("Bad image width to height ratio!");
if (!compliance.goodExposure ())
Console.WriteLine ("Bad exposure!");
if (!compliance.isFrontalBestPractice())
{
Console.WriteLine( "Face not frontal!");
Console.WriteLine( "\tDeviation from frontal pose: {0}",
portraitCharacteristics.deviationFromFrontalPose());
Console.WriteLine ("\tPose angle roll: {0}",
portraitCharacteristics.poseAngleRoll ());
}
if (!compliance.goodGrayScaleProfile ())
{
Console.WriteLine( "Gray scale profile is not good!");
Console.WriteLine( "Gray scale density: {0}",
portraitCharacteristics.grayScaleDensity());
}
if (!compliance.isLightingUniform ())
{
Console.WriteLine( "Lighting is not uniform!");
Console.WriteLine( "Deviation from uniform lighting: {0}",
portraitCharacteristics.deviationFromUniformLighting ());
}
if( !compliance.hasNaturalSkinColour())
{
Console.WriteLine( "Has no natural skin colour!");
Console.WriteLine( "Natural skin color: {0}",
portraitCharacteristics.naturalSkinColour());
}
if( !compliance.noHotSpots())
{
Console.WriteLine( "Has hot spots!");
Console.WriteLine( "Hot spots: {0}",
portraitCharacteristics.hotSpots());
}
Console.WriteLine("Image not compliant with ISO 19794-5 requirements");

}
// create a Token Face Image according to ISO 19794-5
AnnotatedImage iso19794Img = tfcreator.extract (annotatedImage);
AnnotatedImage[] annotatedImages = new AnnotatedImage [1];
annotatedImages[0] = iso19794Img;
if (args.Length > 2)
{
// save tokenface in cbeff format
System.IO.FileStream tokenOut =
new System.IO.FileStream
(args[2], System.IO.FileMode.CreateNew, System.IO.FileAccess.Write);
TokenFace.IO.write (tokenOut, annotatedImages);
if (args.Length > 3)
{
Bmp.save (iso19794Img.image, args[3]); // save bmp file
// System.IO.FileStream imageOut = new System.IO.FileStream (args[3], System.IO.FileMode
// Jpeg.save (iso19794Img.image, imageOut, 100); // save jpeg file
}
}

c 2009 by Cognitec Systems GmbH


Copyright

130

Example Documentation
Console.WriteLine ("Acquisition process done.");
}
catch (AcquisitionError aE)
{
Console.WriteLine (aE.what ());
}
catch (System.Exception ex)
{
Console.WriteLine ("\n--- Exception ---\n{0}", ex.Message );
return 1;
}
return 0;
}
}

c 2009 by Cognitec Systems GmbH


Copyright

11.2 enroll.cs

11.2

enroll.cs

Example showing the usage of the enrollment processor.


// Copyright (c) 2004 Cognitec Systems GmbH
//
// $Revision: 1.3 $
//
using
using
using
using

System;
Cognitec.FRsdk;
Eyes = Cognitec.FRsdk.Eyes;
Enrollment = Cognitec.FRsdk.Enrollment;

// Implementation of Enrollment.Feedback
class EnrollmentFeedback: Enrollment.Feedback
{
public EnrollmentFeedback( string firFilename_)
{ firFilename = firFilename_; }
public void start() { Console.WriteLine("start"); }
public void processingImage( Image img)
{ Console.WriteLine( "processing image[{0}]", img.name()); }
public void eyesFound( Eyes.Location eyes)
{
Console.WriteLine
( "found eyes at [[first x={0} y={1}] [second x={2} y={3}]]",
eyes.first.x, eyes.first.y, eyes.second.x, eyes.second.y);
}
public void eyesNotFound()
{ Console.WriteLine( "eyes not found"); }
public void sampleQualityTooLow()
{ Console.WriteLine( "sample quality too low"); }
public void sampleQuality( float f )
{ Console.WriteLine( "sample quality: {0}", f); }
public void success( FIR fir)
{
Console.WriteLine
( "successful enrollment, FIR[ filename, id, size] = " +
"[\"{0}\", \"{1}\", {2}]", firFilename, fir.version(), fir.size());
// write the fir
fir.serialize
( new System.IO.FileStream( firFilename, System.IO.FileMode.Create));
}
public void failure() { Console.WriteLine( "failure"); }
public void end() { Console.WriteLine( "end"); }
private String firFilename;
};
class EnrollmentExample
c 2009 by Cognitec Systems GmbH
Copyright

131

132

Example Documentation
{
public static int Main( string[] args)
{
if( args.Length < 3) {
Console.WriteLine
( "usage:\n" +
"enroll {config file} {fir} {jpeg images}...\n" +
"\tconfig file ... the frsdk config file\n" +
"\tfir
... a filename for a FIR\n" +
"\tjpeg image ... one or more jpeg images for enrollment." );
return 1;
}
try {
// initialisation of configuration
Configuration cfg = new Configuration( args[0]);
// prepare array for enrollment images
Sample[] enrollmentSamples = new Sample[ args.Length - 2];
// collect image files for enrollment images
for( int i = 2; i < args.Length; i++) {
Sample s = new Sample(Jpeg.load( args[i]));
enrollmentSamples[ i-2] = s;
}
// create an enrollment processor
Enrollment.Processor proc = new Enrollment.Processor( cfg);
// create the needed interaction instances
Enrollment.Feedback feedback = new EnrollmentFeedback( args[1]);
Console.WriteLine( "start processing ...");
// do the enrollment
proc.process( enrollmentSamples, feedback);
} catch ( System.Exception ex) {
Console.WriteLine
( "\nException ---\n{0}\n{1}", ex.Message, ex.StackTrace );
return 1;
}
return 0;
}
}

c 2009 by Cognitec Systems GmbH


Copyright

11.3 eyesfind.cs

11.3

133

eyesfind.cs

Example showing the usage of face and eyes finders and portrait analyzer.
// Copyright (c) 2004 Cognitec Systems GmbH
//
// $Revision: 1.12 $
//
using
using
using
using
using
using
using

System;
Cognitec.FRsdk;
Face = Cognitec.FRsdk.Face;
Eyes = Cognitec.FRsdk.Eyes;
Portrait = Cognitec.FRsdk.Portrait;
FullFrontal = Cognitec.FRsdk.ISO_19794_5.FullFrontal;
Feature = Cognitec.FRsdk.Portrait.Feature;

class EyesFinding
{
private static int usage ()
{
Console.WriteLine
( "Usage: eyesfind <frsdk configuration file> <jpeg file>");
return 1;
}
public static int Main( string[] args)
{
if( args.Length != 2) return usage ();
try {
// initialisation of configuration
Configuration cfg = new Configuration( args[0]);
// initialization for single face finding (default)
float minrEyeDist = 0.1F;
// face finder instantiation
Face.Finder faceFinder = new Face.Finder( cfg);
// eyes finder instantiation
Eyes.Finder eyesFinder = new Eyes.Finder( cfg);
// portrait analyzer instantiation
Portrait.Analyzer portraitAnalyzer = new Portrait.Analyzer( cfg);
// Feature assessment instantiation
Feature.Test featureTest = new Feature.Test( cfg);
// ISO 19794-5 Full Frontal image assessment instantiation
FullFrontal.Test fullFrontalTest = new FullFrontal.Test( cfg);

// load jpeg image


Image img = Jpeg.load( args[1]);

// find faces
Face.Location[] faceLocations = faceFinder.find (img, minrEyeDist, 0.4F, int.MinValue / 2, int.Min
Console.WriteLine ("number of faces found: {0}", faceLocations.Length);
Console.WriteLine ("----------------------");

c 2009 by Cognitec Systems GmbH


Copyright

134

Example Documentation
// iterate over face locations
foreach( Face.Location faceLoc in faceLocations) {
// print face location
Console.WriteLine
( "Face location: [x={0} y={1} width={2} conf={3}]",
faceLoc.pos.x, faceLoc.pos.y, faceLoc.width, faceLoc.confidence);
// find eyes
Eyes.Location[] eyesLocations = eyesFinder.find( img, faceLoc);
// iterate over eyes locations
foreach( Eyes.Location eyesLoc in eyesLocations) {
// print eye locations
Console.WriteLine
( "Eye locations: [[first x={0} y={1} conf={2}]" +
" [second x={3} y={4} conf={5}]]",
eyesLoc.first.x, eyesLoc.first.y, eyesLoc.firstConfidence,
eyesLoc.second.x, eyesLoc.second.y, eyesLoc.secondConfidence);
}
// do we have eyes found
if( eyesLocations.Length > 0) {
// analyze portrait
Portrait.Characteristics portraitCharacteristics =
portraitAnalyzer.analyze
( new AnnotatedImage( img, eyesLocations[0]));
Console.WriteLine
( "Left Eye Open: {0}",
portraitCharacteristics.eye0Open());
Console.WriteLine
( "Right Eye Open {0}",
portraitCharacteristics.eye1Open());
Console.WriteLine
( "Exposure: {0}",
portraitCharacteristics.exposure());
Console.WriteLine
( "Sharpness: {0}",
portraitCharacteristics.sharpness());

// test features
Feature.Set features = featureTest.assess( portraitCharacteristics);
if( features.wearsGlasses())
Console.WriteLine
( "Feature test: Person with glasses. ({0}",
portraitCharacteristics.glasses());
else
Console.WriteLine
( "Feature test: Person without glasses. ({0})",
portraitCharacteristics.glasses());
// test compliance with ISO 19794-5
FullFrontal.Compliance compliance = fullFrontalTest.assess
( portraitCharacteristics);
if( compliance.isCompliant()) {
Console.WriteLine
( "Image compliant with ISO 19794-5 requirements");

c 2009 by Cognitec Systems GmbH


Copyright

11.3 eyesfind.cs
} else {
if( !compliance.goodVerticalFacePosition())
Console.WriteLine( "Bad vertical face position!");
if( !compliance.horizontallyCenteredFace())
Console.WriteLine( "Face not centered horizontally!");
if( !compliance.widthOfHead())
Console.WriteLine( "Bad sizing (Width)!");
if( !compliance.lengthOfHead())
Console.WriteLine( "Bad sizing (Height)!");
if( !compliance.goodExposure())
Console.WriteLine( "Bad exposure!");
if( !compliance.isFrontal())
Console.WriteLine( "Face not frontal!");
Console.WriteLine
( "Image not compliant with ISO 19794-5 requirements");
}
}
else Console.WriteLine ("--- no eyes found! ---");
Console.WriteLine ("----------------------");
}
} catch ( System.Exception ex) {
Console.WriteLine( "\nException ---\n{0}", ex.Message );
return 1;
}
return 0;
}
}

c 2009 by Cognitec Systems GmbH


Copyright

135

136

Example Documentation

11.4

facefind.cs

Example showing the usage of the face finder.


// Copyright (c) 2004 Cognitec Systems GmbH
//
// $Revision: 1.5 $
//
using System;
using Cognitec.FRsdk;
using Face = Cognitec.FRsdk.Face;
class FaceFinding
{
private static int usage ()
{
Console.WriteLine
( "Usage: facefind <frsdk configuration file> <jpeg file>");
return 1;
}
public static int Main( string[] args)
{
if( args.Length != 2) return usage ();
try {
// initialisation of configuration
Configuration cfg = new Configuration( args[0]);
// initialization for single face finding (default)
float minrEyeDist = 0.1F;
// face finder instantiation
Face.Finder faceFinder = new Face.Finder( cfg);
// load jpeg image
Image img = Jpeg.load( args[1]);

// find faces
Face.Location[] faceLocations = faceFinder.find (img, minrEyeDist, 0.4F, int.MinValue /
Console.WriteLine ("number of found faces: {0}", faceLocations.Length);
// print face locations
foreach( Face.Location faceLoc in faceLocations) {
Console.WriteLine
( "Face location: [x={0} y={1} width={2} conf={3}]",
faceLoc.pos.x, faceLoc.pos.y, faceLoc.width, faceLoc.confidence);
}
}
catch ( System.Exception ex) {
Console.WriteLine( "\nException ---\n{0}", ex.Message );
return 1;
}
return 0;
}
}

c 2009 by Cognitec Systems GmbH


Copyright

11.5 identify.cs

11.5

identify.cs

Example showing the usage of the identification processor.


// Copyright (c) 2004 Cognitec Systems GmbH
//
// $Revision: 1.3 $
//
using
using
using
using

System;
Cognitec.FRsdk;
Eyes = Cognitec.FRsdk.Eyes;
Identification = Cognitec.FRsdk.Identification;

// Implementation of Identification.Feedback
class IdentificationFeedback: Identification.Feedback
{
public void start() { Console.WriteLine("start"); }
public void processingImage( Image img)
{ Console.WriteLine( "processing image[{0}]", img.name()); }
public void eyesFound( Eyes.Location eyes)
{
Console.WriteLine
( "found eyes at [[first x={0} y={1}] [second x={2} y={3}]]",
eyes.first.x, eyes.first.y, eyes.second.x, eyes.second.y);
}
public void eyesNotFound()
{ Console.WriteLine( "eyes not found"); }
public void sampleQualityTooLow()
{ Console.WriteLine( "sample quality too low"); }
public void sampleQuality( float f )
{ Console.WriteLine( "sample quality: {0}", f); }
public void matches( Match[] matches)
{
foreach( Match match in matches) {
Console.WriteLine
( "match on fir[{0}] got Score[{1}]",
match.name, match.score.value);
}
}
public void failure() { Console.WriteLine( "failure"); }
public void end() { Console.WriteLine( "end"); }
};
class IdentificationExample
{
public static int Main( string[] args)
{
if( args.Length < 3) {
Console.WriteLine
( "usage:\n" +
"identify {config file} {jpeg image} {fir} ...\n" +
c 2009 by Cognitec Systems GmbH
Copyright

137

138

Example Documentation
"\tconfig file ... the frsdk config file\n" +
"\tjpeg image ... a jpeg image file for processing\n" +
"\tfir
... one or more FIR files for the identification" +
" population.");
return 1;
}
try {
// initialisation of configuration
Configuration cfg = new Configuration( args[0]);
// prepare array for identification images
Sample[] identificationSamples = new Sample[ 1];
Sample s = new Sample(Jpeg.load( args[1]));
identificationSamples[ 0] = s;
// build the fir population for identification
FIRBuilder firBuilder = new FIRBuilder( cfg);
Population population = new Population( cfg);
for( int j = 2; j < args.Length; j++) {
string filename = args[ j];
Console.WriteLine( "[{0}]", filename);
population.append
( firBuilder.build
( new System.IO.FileStream( filename, System.IO.FileMode.Open)),
filename);
}
// request Score
ScoreMappings sm = new ScoreMappings( cfg);
Score score = sm.requestFAR( 0.001f);
// create a identification processor
Identification.Processor proc =
new Identification.Processor( cfg, population);
// create the needed interaction instances
Identification.Feedback feedback = new IdentificationFeedback();
Console.WriteLine( "start processing ...");
// do the identification
proc.process( identificationSamples, score, feedback, 3);
} catch ( System.Exception ex) {
Console.WriteLine
( "\nException ---\n{0}\n{1}", ex.Message, ex.StackTrace );
return 1;
}
return 0;
}
}

c 2009 by Cognitec Systems GmbH


Copyright

11.6 tracklife.cs

11.6

tracklife.cs

Example showing the usage of the tracker if frames with an varying frame rate are
available.
// Copyright (c) 2008 Cognitec Systems GmbH
//
// $Revision: 1.1 $
//
using
using
using
using

System;
Cognitec.FRsdk;
Face = Cognitec.FRsdk.Face;
Eyes = Cognitec.FRsdk.Eyes;

class LifeFaceTracking
{
public static int Main( string[] args)
{
if( args.Length < 2) {
Console.WriteLine
( "Usage: tracklife <frsdk configuration file> <device name>");
return 1;
}
try {
// initialisation of configuration
Configuration cfg = new Configuration( args[0]);
// face tracker instantiation
Face.Tracker faceTracker = new Face.Tracker( cfg);
// capturing device instantiation
WinCaptureDevice capDev = new WinCaptureDevice( cfg, args[1]);
for(; true; ) {
// grab image
Image img = capDev.capture();
// get time
uint captureTime = (uint) DateTime.Now.Ticks;
// track objects in frame
Face.TrackerLocation[] l = faceTracker.processImage( img, captureTime);
// print time and locations
Console.Write( "{0} ", captureTime);
foreach( Face.TrackerLocation i in l) {
Eyes.Location e = i.eyesLocation;
Console.Write
( "{0} : [x={1} y={2}] ",
i.id, (e.first.x + e.second.x) /2, (e.first.y + e.second.y) /2);
}
Console.WriteLine();
}
} catch ( System.Exception ex) {
Console.WriteLine( "\nException ---\n{0}", ex.Message );
return 1;
}
return 0;
}
}

c 2009 by Cognitec Systems GmbH


Copyright

139

140

Example Documentation

c 2009 by Cognitec Systems GmbH


Copyright

11.7 trackrec.cs

11.7

trackrec.cs

Example showing the usage of the tracker if frames with an contant frame rate are
available.
// Copyright (c) 2008 Cognitec Systems GmbH
//
// $Revision: 1.1 $
//
using
using
using
using

System;
Cognitec.FRsdk;
Face = Cognitec.FRsdk.Face;
Eyes = Cognitec.FRsdk.Eyes;

class ImageLoadError : System.Exception


{
public ImageLoadError( string msg_) { msg = msg_; }
ImageLoadError() {}
public string what () { return msg; }
private string msg;
}
class RecordedFaceTracking
{
private static Image loadImage( string fn)
{
// try loading jpeg image
try { return Jpeg.load (fn); } catch {}
// try loading jpeg2000 image
try { return Jpeg2000.load (fn); } catch {}
// try loading bmp image
try { return Bmp.load (fn); } catch {}
// try loading png image
try {
System.IO.FileStream imageFile =
new System.IO.FileStream
(fn, System.IO.FileMode.Open, System.IO.FileAccess.Read);
return Png.load( imageFile);
} catch {}
// try loading pgm/ppm image
try { return Pgm.load (fn); } catch {}
throw new ImageLoadError
( fn + " contains no recognized image file format");
}
public static int Main( string[] args)
{
if( args.Length < 2) {
Console.WriteLine
( "Usage: trackrec <frsdk configuration file> <image1> <image2> ...");
return 1;
}
try {
// initialisation of configuration
Configuration cfg = new Configuration( args[0]);
// face tracker instantiation
Face.Tracker faceTracker = new Face.Tracker( cfg);
for(int a = 1; a < args.Length; ++a) {
c 2009 by Cognitec Systems GmbH
Copyright

141

142

Example Documentation
string fn = args[ a];
// load image
Image img = loadImage( fn);
// track objects of frame
Face.TrackerLocation[] l = faceTracker.processFrame( img);
// print filename and locations
Console.Write( "{0} ", fn);
foreach( Face.TrackerLocation i in l) {
Eyes.Location e = i.eyesLocation;
Console.Write
( "{0} : [x={1} y={2}] ",
i.id, (e.first.x + e.second.x) /2, (e.first.y + e.second.y) /2);
}
Console.WriteLine();
}
} catch ( System.Exception ex) {
Console.WriteLine( "\nException ---\n{0}", ex.Message );
return 1;
}
return 0;
}
}

c 2009 by Cognitec Systems GmbH


Copyright

11.8 verify.cs

11.8

verify.cs

Example showing the usage of the verification processor.


// Copyright (c) 2004 Cognitec Systems GmbH
//
// $Revision: 1.3 $
//
using
using
using
using

System;
Cognitec.FRsdk;
Eyes = Cognitec.FRsdk.Eyes;
Verification = Cognitec.FRsdk.Verification;

// Implementation of Verification.Feedback
class VerificationFeedback: Verification.Feedback
{
public void start() { Console.WriteLine("start"); }
public void processingImage( Image img)
{ Console.WriteLine( "processing image[{0}]", img.name()); }
public void eyesFound( Eyes.Location eyes)
{
Console.WriteLine
( "found eyes at [[first x={0} y={1}] [second x={2} y={3}]]",
eyes.first.x, eyes.first.y, eyes.second.x, eyes.second.y);
}
public void eyesNotFound()
{ Console.WriteLine( "eyes not found"); }
public void sampleQualityTooLow()
{ Console.WriteLine( "sample quality too low"); }
public void sampleQuality( float f )
{ Console.WriteLine( "sample quality: {0}", f); }
public void match( Score s)
{ Console.WriteLine( "match got score: {0}", s.value); }
public void success()
{ Console.WriteLine( "successful verification." ); }
public void failure() { Console.WriteLine( "failure"); }
public void end() { Console.WriteLine( "end"); }
};
class VerificationExample
{
public static int Main( string[] args)
{
if( args.Length < 3) {
Console.WriteLine
( "usage:\n" +
"verify {config file} {fir} {jpeg images}...\n" +
"\tconfig file ... the frsdk config file\n" +
"\tfir
... a filename for a FIR\n" +
"\tjpeg image ... one or more jpeg image files for verification." );
c 2009 by Cognitec Systems GmbH
Copyright

143

144

Example Documentation
return 1;
}
try {
// initialisation of configuration
Configuration cfg = new Configuration( args[0]);
// prepare array for verification images
Sample[] verificationSamples = new Sample[ args.Length - 2];
// collect image files for verification images
for( int i = 2; i < args.Length; i++) {
Sample s = new Sample(Jpeg.load( args[i]));
verificationSamples[ i-2] = s;
}
FIRBuilder firBuilder = new FIRBuilder( cfg);
// get the FIR to verify against
Console.WriteLine( "reading fir {0} ... ", args[1]);
FIR fir = firBuilder.build
( new System.IO.FileStream( args[1], System.IO.FileMode.Open));
Console.WriteLine( "done");
// request Score
ScoreMappings sm = new ScoreMappings( cfg);
Score score = sm.requestFAR( 0.001f);
Console.WriteLine( "required success score: {0}", score.value);
// create a verification processor
Verification.Processor proc = new Verification.Processor( cfg);
// create the needed interaction instances
Verification.Feedback feedback = new VerificationFeedback();
Console.WriteLine( "start processing ...");
// do the verification
proc.process( verificationSamples, fir, score, feedback);
} catch ( System.Exception ex) {
Console.WriteLine
( "\nException ---\n{0}\n{1}", ex.Message, ex.StackTrace );
return 1;
}
return 0;
}
}

c 2009 by Cognitec Systems GmbH


Copyright

You might also like