Versions Compared

Key

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


Section


Column
width35%50%


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



Column


General information about scripts

User scripts are designed You can use custom scripts for partial automation of processes while configuring when configuring Face PSIM software package. In the Programming Guide for creating scripts (programming) document there is the a description of programming objects and methods which are in use used for scripts creation in Intellect 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 <Intellect installation folder>\Bmp\<Person> <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 Intellect\Bmp\Person folder without resolution(e.g., 15 for 15.bmp file), wait<10> - time in seconds
    }}

    Parameters:

    • 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 the camera identifier, specify the identifier of the Face detection object; 
    • p_id<15>—the name of the file with a 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.

     


    Example of a successful verification with output of the similarity percentage of a captured face to the user's photo, as well as the user's gender, body temperature, facial hair, evasion, and emotions:

    Code Block
    Event : FIRSERVER|1|IDENTIFY_ACCEPT|temperature_alarm <37>, imageBase64.0<>, emotion<neutral>,fraction<285>,int_obj_id<1>,temperature<36,6>,evasion<normal>,owner<PC>,gender<male>,
    sim<99.60>,facialHair<gm>,date<11-10-21>,from_script<1>,guid_pk<{1CCF1800-772A-EC11-94B6-D8BBC1166DF4}>,core_global<1>,p_id<11176>,wait<10>,cam_id<13>,time<12:38:42>,param0<Timeout>,
    imageBase64Count<1>, liveness<not_liveness>

    Example of an event when a photo doesn't match the face being verified:

    Code Block
    Event : FIRSERVER|1|IDENTIFY_DECLINE|temperature_alarm<>,fraction<371>,int_obj_id<1>,owner<PC>,noImage<0>,date<10-02-22>,from_script<1>,
    guid_pk<{51A469CC-438A-EC11-94E5-D8BBC1166DF4}>,timeout<1>,core_global<1>,p_id<1>,quality<83.864>,wait<10>,cam_id<2>,time<10:34:01>,param0<Timeout>

    Example of an event when a user doesn't have a photo:

    Code Block
    Event : FIRSERVER|1|IDENTIFY_DECLINE|temperature_alarm<>,fraction<367>,int_obj_id<1>,owner<PC>,noImage<1>,date<10-02-22>,from_script<1>,
    guid_pk<{B314D117-458A-EC11-94E5-D8BBC1166DF4}>,timeout<1>,core_global<1>,p_id<4>,quality<0>,wait<10>,cam_id<2>,time<10:43:14>,param0<Timeout>


The face The photo verification is completed.

Note
titleAttention!

File with a photo must have the .bmp extension. But the file format can be one from the list: jpgJPG, BMP, bmp or pngPNG.

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 a photo using the 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 filename—full name of the file containing with the photo. It can be in jpg, bmp, gif or png format.Files with the JPG, BMP, GIF, PNG extension are acceptable;
  • namenamethe 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 comment – any text commentary.

Example of the script usage:

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 face 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).

Script for checking the quality of a saved user photo

You can check the quality of a saved user photo using the CHECK_QUALITY_START command:

  1. Create the script:

    Code Block
    if(Event.SourceType == "MACRO" && Event.Action == "RUN" && Event.SourceID == "1")
    {
    DoReactStr("FIRSERVER","1","CHECK_QUALITY_START","p_id<1>");
    }

    Parameters:

      • 1—the identifier of the Face recognition server object;
      • CHECK_QUALITY_START—the command for checking the quality of a saved user photo;
      • p_id<1>—the identifier of the user whose photo must be checked. 
  2. Run the first macro.

    If the quality of the photo is higher than the minimum quality of the face on the face recognition server, the following event is generated:

    Code Block
    Event : FIRSERVER|1|QUALITY_OK|fraction<413>,int_obj_id<1>,owner<PC>,date<08-02-22>,guid_pk<{11DB55C9-F188-EC11-94E4-D8BBC1166DF4}>,
    core_global<1>,p_id<3>,time<18:14:24>,param0<92.4644>

    If the quality of the photo is lower than the minimum quality of the face on the face recognition server, the following event is generated:

    Code Block
    Event : FIRSERVER|1|QUALITY_BAD|fraction<281>,int_obj_id<1>,owner<PC>,date<08-02-22>,guid_pk<{0742EBE0-F288-EC11-94E4-D8BBC1166DF4}>,
    core_global<1>,p_id<3>,time<18:22:12>,param0<92.4644>

    If there is no photo, the following event is generated:

    Code Block
    Event : FIRSERVER|1|QUALITY_BAD|fraction<517>,int_obj_id<1>,owner<PC>,date<24-02-22>,guid_pk<{1C9609E4-7795-EC11-A50D-74D435D0E19B}>,
    core_global<1>,p_id<3>,time<17:44:34>,param0<0>


  3. If the photo quality is successfully checked, the user can also be verified (see the script for user verification above). If a photo of a low quality is detected, the user will be marked to find them in the Access Manager and replace the photo.

    Info
    titleNote

    If the photo quality is higher than the quality of the face, set on the Face recognition server object, it doesn’t guarantee that the verification will be performed correctly 100% of the time. The verification result depends on the position and settings of the camera, on the lighting of the face, the camera angle and other derivatives. It is recommended to set the Similarity level on the Face recognition server settings panel to no higher than 50% and adjust it on a trial basis to get the required result.

Script for recognition upon request for a specific camera

You can recognize a face for a specific camera using the QUERY_RECOGNIZE_START command.

Face recognition upon request is only available for VA and VisioLabs modules.

Example of sending a request to recognize a face from one of several cameras is shown below.

Code Block
if (Event.SourceType == "CAM" && Event.SourceId == "3" && Event.Action == "MD_START")
{
DoReactStr("FIRSERVER","1","QUERY_RECOGNIZE_START","from_script<1>,cam_facecapture<3.1>");
}

Parameters:

  • 1—the identifier of the Face recognition server object;
  • QUERY_RECOGNIZE_START—command to recognize a face upon request;
  • from_script<1>, cam_facecapture<3,1>—the identifier of the script, Face Detection<identifier of the Face Detection object>.

If face was successfully recognized upon request, the Face detected event is displayed in the Debug window.