Documentation for Face Intellect 8.0-8.1. Documentation for other versions of Intellect is available too.
Previous page Next page
General information about scripts
Custom scripts are used for partial automation of processes when configuring Face Intellect. In the Programming Guide document there is the description of programming objects and methods which are used for scripts creation in Intellect.
Script for faces verification
The verification mode compares the face captured in the frame with the user photo stored on the disk at <Intellect installation folder>\Bmp\<Person>. It also determines the face parameters: emotions, temperature, face concealment (mask), gender, facial hair.
To perform face verification, do the following:
Create the script:
if(Event.SourceType == "MACRO" && Event.Action == "RUN" && Event.SourceID == "1") { DoReactStr("FIRSERVER","1","VERIFY_START","cam_id<1>,p_id<15>,wait<10>"); }
Note
- 1 — the identifier of the Face Recognition Server object;
- VERIFY_START — user verification command;
- cam_id<1> — camera identifier. If you use the VisionLabs face recognition module, instead of camera identifier, specify the identifier of the Face detection object;
- p_id<15> — the name of the file with photo in the <Intellect installation folder>\Bmp\<Person> folder without resolution (for example, 15 for the 15.bmp file);
- wait<10> — the waiting time in seconds for the face to appear.
- Run the first macro. If the user from the photo does not appear in front of the camera in 10 seconds, the Verification declined event will be displayed. In case the user appears, the Successful verification event will be displayed immediately showing the similarity percentage of the captured face with the user photo stored on the disk.
The face verification is completed.
Attention!
File with photo must have the .bmp extension. But the file format can be one from the list: JPG, BMP, or PNG.
Script for adding a reference face to the database from a file
A reference face can be added to the database from a file with photo using the ADD_PERSON_FROM_FILE reaction of the FIRSERVER object.
Note
When you add a reference face to the Face Intellect database, a new user is automatically created and assigned a photo from the specified file.
Parameters:
- filename — full name of the file with the photo. Files with the JPG, BMP, GIF, PNG extension are acceptable;
- name — the name of the added user;
- surname — the surname of the added user;
- department — the department to which the user will be added;
- comment — any text commentary.
Example of the script usage:
if(Event.SourceType == "MACRO" && Event.Action == "RUN" && Event.SourceID == "1") { DoReactStr("FIRSERVER","1","ADD_PERSON_FROM_FILE","filename<c:\\iso_small.jpg>,name<Jane>,surname<Kramer>,department<Department 1>,comment<>"); }
If the face was successfully added to the reference faces database, the ADD_PERSON_FROM_FILE_OK event will be displayed in the Debug window. If there are any errors when adding the reference face, the ADD_PERSON_FROM_FILE_ERROR event will be displayed (see FIRSERVER events).