Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section


Column
width50%


Panel
borderColor#CCCCCC
bgColor#FFFFFF
titleBGColor#F0F0F0
borderStylesolid
titleOn the page:
Table of Contents



Column


General information about scripts

User Custom scripts are designed used for partial automation of processes while configuring while configuring Face PSIM. In the Programming Guide document there is the description of programming objects and methods which are in use for scripts creation in Axxon PSIM.

Script for

...

faces verification

The verification mode enables comparison of compares the face captured in the frame with the user photo stored on the disk at < Axxon <Axxon PSIM installation folder>\Bmp\<Person>. It also determines the face parameters: emotions, temperature, face concealment (mask), gender, facial hair.

To perform photo face verification, do the following:

  1. Create the script:

    Code Block
    if(Event.SourceType == "MACRO" && Event.Action == "RUN" && Event.SourceID == "1")
    {
       DoReactStr("FIRSERVER","1","VERIFY_START","cam_id<1>,p_id<15>,wait<10>");
    //1 - id firserver, p_id<15> - name of the file with photo in the Axxon PSIM\Bmp\Person folder without resolution(e.g., 15 for 15.bmp file), wait<10> - time in seconds
    }}


    Info
    titleNote
    • 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 <Axxon PSIM 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.


  2. Run Perform 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 appearance 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 photo face verification is completed.

Note
titleAttention!

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 do to the database from a file with photo using the ADD_PERSON_FROM_FILE reaction of the FIRSERVER object.

Info
titleNote

When the you add a reference face is added to the Face PSIM database, a new user is automatically created in Face PSIM with the and assigned a photo from the specified file assigned.

Parameters:

  • filename — full — full name of the file containing with the photo. It can be in jpg, bmp, gif or png formatFiles 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 shall will be added;
  • comment — any text commentary.

...

Code Block
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 has been added successfully, the was successfully added to the reference faces database, the ADD_PERSON_FROM_FILE_OK event is will be displayed in the Debug window. If there are any errors while when adding the reference face, the ADD_PERSON_FROM_FILE_ERROR event is will be displayed (see FIRSERVER events).