Park pedestrian gate management method and system based on face recognition authorization

By using the lighting current to distinguish the environment in the park gate management system, combined with face image processing, adjusting the equipment angle or using light compensation, the accuracy and efficiency problems of face recognition under the influence of sunlight are solved and more efficient is achieved. recognition effect.

CN117831187BActive Publication Date: 2024-08-23ZHEJIANG GUANGXIA INTELLIGENCE TECH DEV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410023320.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2024-08-23
Estimated Expiration
2044-01-08

AI Technical Summary

Technical Problem

When the existing park gate management system is affected by sunlight, the face recognition accuracy is low and the efficiency is not high. The existing technology cannot effectively solve the recognition problem caused by light reflection.

Method used

Distinguish between day and night environments by obtaining lighting current, adjust the angle of the face recognition device or use lighting compensation, determine the location of the subject based on real-time face images, and adjust the device to achieve accurate recognition.

Benefits of technology

It improves the accuracy and efficiency of face recognition, solves recognition problems caused by light interference, and facilitates the entry and exit of park managers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117831187B
    Figure CN117831187B
Patent Text Reader

Abstract

The present invention relates to the field of park management technology. The present invention discloses a park pedestrian gate management method and system based on face recognition authorization, including obtaining a lighting lamp current, if the lighting lamp current is zero, then entering S20, if the lighting lamp current is not zero, then entering S30, the lighting lamp is used to illuminate the gate, obtaining positioning information, generating a first adjustment angle based on the positioning information and a pre-built angle adjustment model and entering S40. The present invention distinguishes whether the outdoor environment is a daytime environment or a nighttime environment by obtaining the lighting lamp current, and after distinguishing whether the face recognition environment is a daytime environment or a nighttime environment, the influence of too strong light on face recognition is eliminated by adjusting the angle of the face recognition device, or eliminating the influence of too weak light on face recognition by light compensation, thereby making face recognition more accurate, improving the efficiency of face recognition, and facilitating the entry and exit of park management personnel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of park management technology, and more specifically, to a park pedestrian gate management method and system based on face recognition authorization. Background Art

[0002] Since the rise of artificial intelligence, AI face recognition technology has gradually become an important tool in many industries and is widely used in finance, transportation, banking, education and other fields. Given that the application of artificial intelligence in various industrial scenarios has become an irreversible trend, for the gate management system, the use of face recognition technology for identity authentication is particularly feasible and beneficial compared to other identification methods. The existing park gate management system is usually set up outdoors to manage employees entering and leaving the park. Due to the influence of outdoor factors, employees are easily affected by light and reflection during the process of face recognition through the equipment on the gate, resulting in inaccurate face recognition and employees being unable to enter the park. Although the existing technology can reduce the interference caused by reflection to a certain extent, there are still certain problems:

[0003] For example, the patent with the authorization announcement number CN214846879U discloses a face recognition access control gate, which can block the light to a certain extent through the shielding plate to avoid the reflection of the instrument during the face recognition process. The patent with the authorization announcement number CN108564540B discloses an image processing method for removing the reflection of the lens in the image. Although the above patents generate color images and depth images and extract the face area from the color image based on the face recognition algorithm, there are still the following problems:

[0004] Although the above-mentioned image processing method for removing lens reflections in images can extract the face area, the images need to be processed one by one during the rush hour in the park. The processing process is cumbersome and affects the recognition efficiency. It also cannot solve the fundamental problem that the sunlight causes reflections. Although a face recognition access control gate machine discloses a baffle, the angle of sunlight is changing, that is, the angle at which the light irradiates the equipment on the gate is different depending on the time. The role of the baffle is relatively limited. Current technology has not yet proposed an effective method to solve the problem of face recognition accuracy caused by sunlight, and the efficiency of face recognition also needs to be guaranteed.

[0005] In view of this, the present invention proposes a park pedestrian gate management method and system based on face recognition authorization to solve the above problems. Summary of the invention

[0006] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a campus pedestrian gate management method and system based on face recognition authorization.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] The park pedestrian gate management method based on face recognition authorization includes:

[0009] S10: Obtain the current of the lighting lamp. If the current of the lighting lamp is zero, proceed to S20. If the current of the lighting lamp is not zero, proceed to S30. The lighting lamp is used to illuminate the gate.

[0010] S20: Acquire positioning information, generate a first adjustment angle based on the positioning information and a pre-built angle adjustment model, adjust the face recognition device according to the first adjustment angle and proceed to S40, wherein the positioning information includes the gate position, the first time, and the ultraviolet intensity;

[0011] S30: Obtain the first posture and the second time of the current device, generate the number of compensation lamps based on the first posture of the current device, the lighting lamp current, and the pre-built light compensation model, and determine whether to return to S10 according to the second time;

[0012] S40: Obtain a real-time face image and a second posture, and determine whether the photographed object is in the standard position based on the real-time face image. If so, perform face recognition. If not, obtain a third angle based on the real-time face image and the second posture, adjust the face recognition device to perform face recognition based on the third angle, and determine whether to return to S10 based on the first time.

[0013] Furthermore, the first adjustment angle is an optimal adjustment angle, and the method for determining the optimal adjustment angle includes:

[0014] Acquire an experimental face image at a real-time angle, generate a real-time grayscale value based on the experimental face image, and determine whether the absolute value of the difference between the real-time grayscale value and the standard grayscale value is less than a preset grayscale difference threshold. If so, determine the real-time angle as the optimal adjustment angle, and the standard grayscale value is the grayscale value of the standard face image.

[0015] Furthermore, the method for constructing the angle adjustment model includes:

[0016] A sample data set is obtained, wherein the sample data set includes historical gate position information, historical first time, historical ultraviolet intensity and historical first adjustment angle, the sample data set is divided into a sample training set and a sample test set, a regression network is constructed, the historical gate position information, historical first time and historical ultraviolet intensity in the sample training set are used as input data of the regression network, the historical first adjustment angle in the sample training set is used as output data of the regression network, the regression network is trained to obtain an initial regression network for predicting the real-time first adjustment angle, the initial regression network is tested using the sample test set, and the regression network that meets the preset test accuracy is output as the angle adjustment model.

[0017] Further, the method of determining whether to return to S10 according to the second time includes:

[0018] Determine whether the second time is the first target time, and if so, return to S10.

[0019] Furthermore, the method for determining whether the photographed object is in a standard position includes:

[0020] Real-time feature points are obtained based on the real-time facial image, the real-time Euclidean distance between the real-time feature points and the standard feature points is calculated, and it is determined whether the real-time Euclidean distance is less than the distance threshold. If so, it is determined that the photographed object is in the standard position; if not, it is determined that the photographed object is not in the standard position, and the standard feature points are facial feature points of the standard facial image.

[0021] Furthermore, the method for obtaining the third angle according to the real-time face image and the second posture includes:

[0022] A real-time three-dimensional face model is established based on real-time feature points, a rotation matrix is ​​determined based on the real-time three-dimensional face model and a standard three-dimensional face model, a rotation angle is determined based on the rotation matrix, and a third angle is determined based on the second posture and the rotation angle. The standard three-dimensional face model is established by standard feature points, and the rotation angle includes adjusting the pitch angle, adjusting the yaw angle, and adjusting the roll angle.

[0023] Further, the method for determining whether to return to S10 based on the first time includes:

[0024] Determine whether the first time is the second target time, and if so, return to S10.

[0025] The park pedestrian gate management system based on face recognition authorization is used to implement the above-mentioned park pedestrian gate management method based on face recognition authorization, including:

[0026] The discrimination module is used to obtain the current of the lighting lamp. If the current of the lighting lamp is zero, it is transferred to the adjustment module. If the current of the lighting lamp is not zero, it is transferred to the compensation module. The lighting lamp is used to illuminate the gate machine.

[0027] Adjustment module: used to obtain positioning information, generate a first adjustment angle based on the positioning information and a pre-built angle adjustment model, adjust the face recognition device according to the first adjustment angle and transfer to the posture adjustment module, wherein the positioning information includes the gate position, the first time and the ultraviolet intensity;

[0028] Compensation module: used to obtain the first posture and second time of the current device, generate the number of compensation lights based on the first posture of the current device, the lighting current, and the pre-built light compensation model, and determine whether to return to the discrimination module according to the second time;

[0029] Posture adjustment module: used to obtain real-time face image and second posture, determine whether the photographed object is in the standard position based on the real-time face image, if so, perform face recognition, if not, obtain a third angle based on the real-time face image and the second posture, adjust the face recognition device according to the third angle to perform face recognition, and determine whether to return to the discrimination module based on the first time.

[0030] An electronic device comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, any one of the above-mentioned methods for managing campus pedestrian gates based on facial recognition authorization is implemented.

[0031] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements any of the above-mentioned methods for managing park pedestrian gates based on facial recognition authorization.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] (1) The present invention distinguishes whether the outdoor environment is a daytime environment or a nighttime environment by obtaining the current of the lighting lamp, and after distinguishing whether the face recognition environment is a daytime environment or a nighttime environment, the influence of too strong light on face recognition is eliminated by adjusting the angle of the face recognition device, or the influence of too weak light on face recognition is eliminated by light compensation, thereby making face recognition more accurate and improving the efficiency of face recognition, which is convenient for park managers to enter and exit;

[0034] (2) The present invention determines whether the photographed subject is in a standard position based on a real-time facial image. If the photographed subject is not in the standard position, the photographed subject does not need to adjust the position. Instead, a third angle is obtained based on the real-time facial image and the second posture, and the facial recognition device is adjusted according to the third angle to achieve facial recognition. This effectively solves the problem that the photographed subject is difficult to make precise adjustments because he is not sure whether he is in an ideal shooting position, thereby improving the accuracy and efficiency of shooting. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of a park pedestrian gate management method based on face recognition authorization in the present invention;

[0036] Figure 2 A schematic diagram of a gate machine, a face recognition device and a lighting lamp in the present invention;

[0037] Figure 3 for Figure 2 The middle part is a partially enlarged schematic diagram;

[0038] Figure 4 This is a schematic diagram of a face model in a three-dimensional coordinate system;

[0039] Figure 5 A schematic diagram of a computer-readable storage medium in the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] Example 1

[0042] See also Figure 1 As shown, this embodiment discloses a park pedestrian gate management method based on face recognition authorization, including:

[0043] S10: Obtain the current of the lighting lamp. If the current of the lighting lamp is zero, proceed to S20. If the current of the lighting lamp is not zero, proceed to S30. The lighting lamp is used to illuminate the gate.

[0044] It should be noted that if Figure 2 As shown, a face recognition device is arranged on the top of the gate, and a lighting lamp is arranged above the gate and the face recognition device. Since the gate in the park is usually arranged in an outdoor environment, it is used for management personnel to enter and exit the park. People enter and exit the park during the day and at night, and the daytime environment is usually very different from the nighttime environment. In the daytime environment, due to sometimes too strong light, the face recognition device is easily affected by the light during the face recognition process of the employee, resulting in inaccurate face recognition. In the night environment, light compensation is usually required to make face recognition more accurate. Therefore, it is necessary to distinguish whether the face recognition environment is a daytime environment or a night environment, so as to better eliminate the influence of too strong or too weak light on face recognition;

[0045] The lighting lamp in this embodiment refers to Figure 2 The lighting lamp can be arranged above the gate and the face recognition device to illuminate the area where the gate is located. Similarly, the lighting lamp can be arranged on both sides of the gate. The present invention does not limit the position of the lighting lamp. Whether the lighting lamp is in working state is judged by the lighting lamp current, so as to determine whether the face recognition environment is a daytime environment or a nighttime environment;

[0046] S20: Acquire positioning information, generate a first adjustment angle based on the positioning information and a pre-built angle adjustment model, adjust the face recognition device according to the first adjustment angle and proceed to S40, wherein the positioning information includes the gate position, the first time, and the ultraviolet intensity;

[0047] It is understandable that there are usually multiple gates set up around the park, so the different orientations of the gates also affect the angle of sunlight irradiating the gates. Therefore, the gate orientation in this embodiment refers to the orientation of the gate, and the orientation of the gate can be pre-stored in the system in advance. The gates facing east and south receive stronger sunlight during the day and are most likely to reflect light during the face recognition process. The gates facing west and north receive relatively weak sunlight during the day, so the degree of reflection is relatively mild and can be directly obtained through the timestamp at the first time. The ultraviolet intensity can also be obtained in real time through the Internet. The ultraviolet intensity is divided into five levels, and the intensity gradually increases from level one to level five;

[0048] like Figure 4 As shown, the face recognition device on the gate can rotate in multiple directions, so the first adjustment angle also includes rotation angles in three directions, so the first adjustment angle is determined by people in this field through experiments. For example, the gate is facing east, the ultraviolet intensity is obtained in real time, and the first time can be grouped by hours. For example, a set of sample data for training the angle adjustment model is shown in the following Table 1;

[0049] Table 1: Training data table

[0050]

[0051]

[0052] It is understandable that the data in Table 1 above are only for exemplary explanation. The adjustment angle in Table 1 includes the horizontal angle and the vertical angle. The ultraviolet intensity is constantly changing according to time and can be obtained in real time. By changing the direction and ultraviolet intensity and other information, complete sample data can be obtained. It is understandable that the first time can be grouped by an interval of one hour, and also by an interval of two hours. It should be understood that the first adjustment angle (the adjustment angle in Table 1) is the optimal adjustment angle;

[0053] Methods for determining the best adjustment angle include:

[0054] Acquire an experimental face image at a real-time angle, generate a real-time grayscale value based on the experimental face image, and determine whether the absolute value of the difference between the real-time grayscale value and the standard grayscale value is less than a preset grayscale difference threshold; if so, determine the real-time angle as the optimal adjustment angle, and the standard grayscale value is the grayscale value of the standard face image;

[0055] It should be noted that reflections usually make certain areas in the image brighter, and the grayscale values ​​of these areas will increase. Therefore, if the optimal adjustment angle needs to be determined, the experimental face image needs to be compared with the standard face image to determine the similarity between the two. If the similarity between the two meets the conditions, the real-time angle is determined as the optimal adjustment angle. The standard face image is the face image in the database. By continuously adjusting the angle of the face recognition device by those skilled in the art, the first adjustment angle (equivalent to the optimal adjustment angle) can be determined.

[0056] The construction method of the angle adjustment model includes:

[0057] Obtain a sample data set, wherein the sample data set includes historical gate position information, historical first time, historical ultraviolet intensity, and historical first adjustment angle, divide the sample data set into a sample training set and a sample test set, construct a regression network, use the historical gate position information, historical first time, and historical ultraviolet intensity in the sample training set as input data of the regression network, use the historical first adjustment angle in the sample training set as output data of the regression network, train the regression network, obtain an initial regression network for predicting the real-time first adjustment angle, test the initial regression network using the sample test set, output a regression network that meets a preset test accuracy as an angle adjustment model, and the regression network is preferably a support vector machine model or a linear regression model;

[0058] S30: Obtain the first posture and the second time of the current device, generate the number of compensation lamps based on the first posture of the current device, the lighting lamp current, and the pre-built light compensation model, and determine whether to return to S10 according to the second time;

[0059] In this embodiment, the first posture includes a first height and a first angle. The first height refers to the height information of the face recognition device from the ground in a night environment, and the first angle refers to the angle of the face recognition device in a night environment. Figure 4As shown, the pitch angle, yaw angle and roll angle can represent the orientation of the face in three-dimensional coordinates, so the pitch angle, yaw angle and roll angle are also required to represent the orientation of the face recognition device in three-dimensional coordinates. The first angle includes a first pitch angle, a first yaw angle and a first roll angle. It can be understood that the first adjustment angle in the above indicates the angle at which the face recognition device needs to turn, and the first angle indicates the orientation of the face recognition device. However, both the first angle and the first adjustment angle need to be expressed in the same coordinate system;

[0060] The method of constructing the lighting compensation model includes:

[0061] Obtain a sample data set, wherein the sample data set includes a historical first height, a historical first angle, a historical lighting lamp current, and a historical number of compensation lamps; divide the sample data set into a sample training set and a sample test set; construct a regression network; use the historical first height, the historical first angle, and the historical lighting lamp current in the sample training set as input data of the regression network; use the historical number of compensation lamps in the sample training set as output data of the regression network; train the regression network to obtain an initial regression network for predicting the number of real-time compensation lamps; use the sample test set to test the initial regression network; output a regression network that meets a preset test accuracy as a lighting compensation model; the regression network is preferably a support vector machine model or a linear regression model;

[0062] It should be noted that if Figure 3 As shown, the small light bulbs on both sides of the face recognition device are compensation lights in this embodiment. The same compensation lights can be set at other positions. The compensation lights are used to perform light compensation during the face recognition process, so that the efficiency of face recognition in the night environment is higher. The number of compensation lights is also obtained by those skilled in the art through experiments, and the present invention will not be repeated in detail.

[0063] The method for determining whether to return to S10 according to the second time includes:

[0064] Determine whether the second time is the first target time, if so, return to S10;

[0065] It is worth noting that, in accordance with the above content, the present invention clearly states in the above content that the daytime environment is usually very different from the nighttime environment, so it is necessary to return to S10 at the set time to determine whether it is a daytime environment or a nighttime environment. For example, Table 1 shows a daytime environment from 5:00 to 18:00, so the nighttime environment should be 18:00 on the first day to 5:00 on the second day. It can be understood that since the face recognition device adjusts the angle every time on time, for example, the angle is adjusted once from 5:00 until the last adjustment at 17:00 in the afternoon, the daytime environment includes the time period of 17:00-18:00, so the first target time should be set to 5:00, and the second time is always from 18:00 on the first day to 5:00 on the second day, until after 5:00, it is transferred from the night environment to the daytime environment. This is only an example and is not specifically limited. Therefore, when the second time is not the first target time, it indicates that the outdoor environment has always been a night environment, and there is no need to transfer to S10;

[0066] This embodiment obtains the current of the lighting lamp to distinguish whether the outdoor environment is a daytime environment or a nighttime environment. After distinguishing whether the face recognition environment is a daytime environment or a nighttime environment, the face recognition device is adjusted to eliminate the influence of too strong light on the face recognition, or the light compensation is used to eliminate the influence of too weak light on the face recognition, thereby making the face recognition more accurate and improving the efficiency of the face recognition, which is convenient for the park management personnel to enter and exit;

[0067] S40: acquiring a real-time face image and a second posture, determining whether the photographed object is in a standard position based on the real-time face image, and if so, performing face recognition; if not, acquiring a third angle based on the real-time face image and the second posture, adjusting the face recognition device to perform face recognition based on the third angle, and determining whether to return to S10 based on the first time;

[0068] It should be noted that the second posture also includes a second height and a second angle, the second height refers to the height information of the face recognition device from the ground in a daytime environment, the second angle refers to the angle of the face recognition device in a daytime environment, and the second angle also includes a second pitch angle, a second yaw angle, and a second roll angle, and the third angle includes a third pitch angle, a third yaw angle, and a third roll angle;

[0069] Methods for determining whether the photographed object is in a standard position include:

[0070] Acquire real-time feature points based on the real-time face image, calculate the real-time Euclidean distance between the real-time feature points and the standard feature points, and determine whether the real-time Euclidean distance is less than a distance threshold. If so, determine that the photographed object is in the standard position; if not, determine that the photographed object is not in the standard position, and the standard feature points are facial feature points of the standard face image;

[0071] It can be understood that the real-time feature points refer to the key facial feature points extracted from the real-time face image using facial recognition technology (such as Dlib, OpenCV, etc.). These facial feature points usually include key facial positions such as the corners of the eyes, the tip of the nose, and the corners of the mouth. Since the standard face image and the real-time face image are both acquired using the same type of face recognition device, an image coordinate system is established, for example, the nose tip in the standard face image is used as the origin to establish a coordinate system, the real-time feature points are placed in the image coordinate system, and the Euclidean distance between the real-time feature points and the standard feature points is calculated, thereby determining the degree of overlap between the real-time face image and the standard face image. Similarly, the standard face image and the real-time face image can also be acquired using different types of face recognition devices, which will result in a difference in size between the standard face image and the real-time face image. Then, the standard face image and the real-time face image can be placed in the same coordinate system by affine transformation. This embodiment will not be described in detail.

[0072] The method for obtaining the third angle according to the real-time face image and the second posture includes:

[0073] Establishing a real-time 3D face model based on real-time feature points, determining a rotation matrix based on the real-time 3D face model and a standard 3D face model, determining a rotation angle based on the rotation matrix, and determining a third angle based on the second posture and the rotation angle, wherein the standard 3D face model is established by standard feature points, and the rotation angle includes adjusting a pitch angle, adjusting a yaw angle, and adjusting a roll angle;

[0074] It should be noted that the pre-established standard 3D facial model includes 3D feature points corresponding to the feature points in the 2D image. Then, the real-time feature points in the real-time face image are first obtained, and the corresponding 3D feature points are determined by the real-time feature points to establish the real-time face 3D model. The standard face 3D model is established in the same way. The real-time face 3D model and the standard face 3D model are placed in the same 3D coordinate system, and the rotation matrix is ​​determined according to the coordinate transformation method. It is worth noting that the rotation matrix is ​​a 3×3 matrix, for example;

[0075]

[0076] Where T is a 3x3 rotation matrix, x, y and z are the coordinates of the real-time feature points in the three-dimensional coordinate system, and x′, y′ and z′ are the coordinates of the standard feature points in the three-dimensional coordinate system;

[0077] It is worth noting that the real-time feature points in the formula correspond to the standard feature points. For example, the eye corner coordinates in the real-time face 3D model are x, y and z, and the eye corner coordinates in the corresponding standard face 3D model are x′, y′ and z′. The rotation angle can be determined based on the rotation matrix by directly calling the function rotation_matrix_to_euler_angle.

[0078] The method for determining the third angle according to the second posture and the rotation angle includes:

[0079] Tda=Sda-Rta;

[0080] Where Tda is the third angle, Sda is the second angle in the second posture, and Rta is the rotation angle;

[0081] It should be noted that the rotation angle refers to the angle required to transform from a real-time 3D face model to a standard 3D face model. However, in this application, the face recognition device needs to be rotated, which is equivalent to transforming the standard 3D face model into a real-time 3D face model. The second angle refers to the angle at which the face recognition device just starts to rotate, and the third angle refers to the angle at which the face recognition device has completed the rotation. Therefore, the second angle minus the rotation angle is required to obtain the third angle.

[0082] The method for determining whether to return to S10 based on the first time includes:

[0083] Determine whether the first time is the second target time, if so, return to S10;

[0084] In accordance with the above, for example, Table 1 shows a daytime environment from 5:00 to 18:00, and the nighttime environment should be 18:00 on the first day to 5:00 on the second day. It can be understood that since the face recognition device adjusts the angle every time on time, the second target time should be set to 18:00. This is only an example and is not specifically limited. When the first time is not the second target time, it indicates that the outdoor environment has always been a daytime environment, and there is no need to enter S10;

[0085] In this embodiment, it is determined whether the photographed subject is in the standard position based on the real-time face image. If the photographed subject is not in the standard position, the photographed subject does not need to adjust the position, but obtains the third angle according to the real-time face image and the second posture, and adjusts the face recognition device according to the third angle to achieve face recognition, which effectively solves the problem that the photographed subject is difficult to make precise adjustments because he is not sure whether he is in the ideal shooting position, thereby improving the accuracy and efficiency of shooting;

[0086] Example 2

[0087] This embodiment discloses a park pedestrian gate management system based on face recognition authorization on the basis of embodiment 1, including:

[0088] The discrimination module is used to obtain the current of the lighting lamp. If the current of the lighting lamp is zero, it is transferred to the adjustment module. If the current of the lighting lamp is not zero, it is transferred to the compensation module. The lighting lamp is used to illuminate the gate machine.

[0089] It should be noted that if Figure 2 As shown, a face recognition device is arranged on the top of the gate, and a lighting lamp is arranged above the gate and the face recognition device. Since the gate in the park is usually arranged in an outdoor environment, it is used for management personnel to enter and exit the park. People enter and exit the park during the day and at night, and the daytime environment is usually very different from the nighttime environment. In the daytime environment, due to sometimes too strong light, the face recognition device is easily affected by the light during the face recognition process of the employee, resulting in inaccurate face recognition. In the night environment, light compensation is usually required to make face recognition more accurate. Therefore, it is necessary to distinguish whether the face recognition environment is a daytime environment or a night environment, so as to better eliminate the influence of too strong or too weak light on face recognition;

[0090] The lighting lamp in this embodiment refers to Figure 2 The lighting lamp can be arranged above the gate and the face recognition device to illuminate the area where the gate is located. Similarly, the lighting lamp can be arranged on both sides of the gate. The present invention does not limit the position of the lighting lamp. Whether the lighting lamp is in working state is judged by the lighting lamp current, so as to determine whether the face recognition environment is a daytime environment or a nighttime environment;

[0091] Adjustment module: obtain positioning information, generate a first adjustment angle based on the positioning information and a pre-built angle adjustment model, adjust the face recognition device according to the first adjustment angle and transfer to the posture adjustment module, wherein the positioning information includes the gate position, the first time and the ultraviolet intensity;

[0092] It is understandable that usually there are multiple gates set up around the park, so the different orientations of the gates also affect the angle of sunlight irradiating the gates. Therefore, the gate orientation in this embodiment refers to the orientation of the gate, and the orientation of the gate can be pre-stored in the system in advance. The gates facing east and south receive stronger sunlight during the day and are most likely to reflect light during the face recognition process. The gates facing west and north receive relatively weak sunlight during the day, so the degree of reflection is relatively mild and can be directly obtained through the timestamp at the first time. The ultraviolet intensity can also be obtained in real time through the Internet. The ultraviolet intensity is divided into five levels, and the intensity gradually increases from level one to level five;

[0093] Methods for determining the best adjustment angle include:

[0094] Acquire an experimental face image at a real-time angle, generate a real-time grayscale value based on the experimental face image, and determine whether the absolute value of the difference between the real-time grayscale value and the standard grayscale value is less than a preset grayscale difference threshold; if so, determine the real-time angle as the optimal adjustment angle, and the standard grayscale value is the grayscale value of the standard face image;

[0095] It should be noted that reflections usually make certain areas in the image brighter, and the grayscale values ​​of these areas will increase. Therefore, if the optimal adjustment angle needs to be determined, the experimental face image needs to be compared with the standard face image to determine the similarity between the two. If the similarity between the two meets the conditions, the real-time angle is determined as the optimal adjustment angle. The standard face image is the face image in the database. By continuously adjusting the angle of the face recognition device by those skilled in the art, the first adjustment angle (equivalent to the optimal adjustment angle) can be determined.

[0096] The construction method of the angle adjustment model includes:

[0097] Obtain a sample data set, wherein the sample data set includes historical gate position information, historical first time, historical ultraviolet intensity, and historical first adjustment angle, divide the sample data set into a sample training set and a sample test set, construct a regression network, use the historical gate position information, historical first time, and historical ultraviolet intensity in the sample training set as input data of the regression network, use the historical first adjustment angle in the sample training set as output data of the regression network, train the regression network, obtain an initial regression network for predicting the real-time first adjustment angle, test the initial regression network using the sample test set, output a regression network that meets a preset test accuracy as an angle adjustment model, and the regression network is preferably a support vector machine model or a linear regression model;

[0098] Compensation module: obtains the first position and second time of the current device, generates the number of compensation lights based on the first position of the current device, the lighting current, and the pre-built light compensation model, and determines whether to return to the discrimination module according to the second time;

[0099] In this embodiment, the first posture includes a first height and a first angle. The first height refers to the height information of the face recognition device from the ground in a night environment, and the first angle refers to the angle of the face recognition device in a night environment. Figure 4 As shown, the pitch angle, yaw angle and roll angle can represent the orientation of the face in three-dimensional coordinates, so the pitch angle, yaw angle and roll angle are also required to represent the orientation of the face recognition device in three-dimensional coordinates. The first angle includes a first pitch angle, a first yaw angle and a first roll angle. It can be understood that the first adjustment angle in the above indicates the angle at which the face recognition device needs to turn, and the first angle indicates the orientation of the face recognition device. However, both the first angle and the first adjustment angle need to be expressed in the same coordinate system;

[0100] The method of constructing the lighting compensation model includes:

[0101] Obtain a sample data set, wherein the sample data set includes a historical first height, a historical first angle, a historical lighting lamp current, and a historical number of compensation lamps; divide the sample data set into a sample training set and a sample test set; construct a regression network; use the historical first height, the historical first angle, and the historical lighting lamp current in the sample training set as input data of the regression network; use the historical number of compensation lamps in the sample training set as output data of the regression network; train the regression network to obtain an initial regression network for predicting the number of real-time compensation lamps; use the sample test set to test the initial regression network; output a regression network that meets a preset test accuracy as a lighting compensation model; the regression network is preferably a support vector machine model or a linear regression model;

[0102] It should be noted that if Figure 3 As shown, the small light bulbs on both sides of the face recognition device are compensation lights in this embodiment. The same compensation lights can be set at other positions. The compensation lights are used to perform light compensation during the face recognition process, so that the efficiency of face recognition in the night environment is higher. The number of compensation lights is also obtained by those skilled in the art through experiments, and the present invention will not be repeated in detail.

[0103] The method for determining whether to return to the discrimination module according to the second time includes:

[0104] Determine whether the second time is the first target time, and if so, return to the determination module;

[0105] It is worth noting that, further explained in the above content, the present invention clearly states in the above content that the daytime environment is usually very different from the nighttime environment, so it is necessary to return to the discrimination module at the set time to determine whether it is a daytime environment or a nighttime environment. When the second time is not the first target time, it indicates that the outdoor environment has always been a nighttime environment, and there is no need to switch to the discrimination module;

[0106] Posture adjustment module: obtains a real-time face image and a second posture, determines whether the photographed object is in a standard position based on the real-time face image, and performs face recognition if the object is in a standard position; if not, obtains a third angle based on the real-time face image and the second posture, adjusts the face recognition device to perform face recognition based on the third angle, and determines whether to return to the discrimination module based on the first time;

[0107] It should be noted that the second posture also includes a second height and a second angle, the second height refers to the height information of the face recognition device from the ground in a daytime environment, the second angle refers to the angle of the face recognition device in a daytime environment, and the second angle also includes a second pitch angle, a second yaw angle, and a second roll angle, and the third angle includes a third pitch angle, a third yaw angle, and a third roll angle;

[0108] Methods for determining whether the photographed object is in a standard position include:

[0109] Acquire real-time feature points based on the real-time face image, calculate the real-time Euclidean distance between the real-time feature points and the standard feature points, and determine whether the real-time Euclidean distance is less than a distance threshold. If so, determine that the photographed object is in the standard position; if not, determine that the photographed object is not in the standard position, and the standard feature points are facial feature points of the standard face image;

[0110] It can be understood that the real-time feature points refer to the key facial feature points extracted from the real-time face image using facial recognition technology (such as Dlib, OpenCV, etc.). These facial feature points usually include key facial positions such as the corners of the eyes, the tip of the nose, and the corners of the mouth. Since the standard face image and the real-time face image are both acquired using the same type of face recognition device, an image coordinate system is established, for example, the nose tip in the standard face image is used as the origin to establish a coordinate system, the real-time feature points are placed in the image coordinate system, and the Euclidean distance between the real-time feature points and the standard feature points is calculated, thereby determining the degree of overlap between the real-time face image and the standard face image. Similarly, the standard face image and the real-time face image can also be acquired using different types of face recognition devices, which will result in a difference in size between the standard face image and the real-time face image. Then, the standard face image and the real-time face image can be placed in the same coordinate system by affine transformation. This embodiment will not be described in detail.

[0111] The method for obtaining the third angle according to the real-time face image and the second posture includes:

[0112] Establishing a real-time 3D face model based on real-time feature points, determining a rotation matrix based on the real-time 3D face model and a standard 3D face model, determining a rotation angle based on the rotation matrix, and determining a third angle based on the second posture and the rotation angle, wherein the standard 3D face model is established by standard feature points, and the rotation angle includes adjusting a pitch angle, adjusting a yaw angle, and adjusting a roll angle;

[0113] It should be noted that the pre-established standard 3D facial model includes 3D feature points corresponding to the feature points in the 2D image. Then, the real-time feature points in the real-time face image are first obtained, and the corresponding 3D feature points are determined by the real-time feature points to establish the real-time face 3D model. The standard face 3D model is established in the same way. The real-time face 3D model and the standard face 3D model are placed in the same 3D coordinate system, and the rotation matrix is ​​determined according to the coordinate transformation method. It is worth noting that the rotation matrix is ​​a 3×3 matrix, for example;

[0114]

[0115] Where T is a 3x3 rotation matrix, x, y and z are the coordinates of the real-time feature points in the three-dimensional coordinate system, and x′, y′ and z′ are the coordinates of the standard feature points in the three-dimensional coordinate system;

[0116] It is worth noting that the real-time feature points in the formula correspond to the standard feature points. For example, the eye corner coordinates in the real-time face 3D model are x, y and z, and the eye corner coordinates in the corresponding standard face 3D model are x′, y′ and z′. The rotation angle can be determined based on the rotation matrix by directly calling the function rotation_matrix_to_euler_angle.

[0117] The method for determining the third angle according to the second posture and the rotation angle includes:

[0118] Tda=Sda-Rta;

[0119] Where Tda is the third angle, Sda is the second angle in the second posture, and Rta is the rotation angle;

[0120] It should be noted that the rotation angle refers to the angle required to transform from a real-time 3D face model to a standard 3D face model. However, in this application, the face recognition device needs to be rotated, which is equivalent to transforming the standard 3D face model into a real-time 3D face model. The second angle refers to the angle at which the face recognition device just starts to rotate, and the third angle refers to the angle at which the face recognition device has completed the rotation. Therefore, the second angle minus the rotation angle is required to obtain the third angle.

[0121] The method for determining whether to return to the discrimination module based on the first time includes:

[0122] Determine whether the first time is the second target time, and if so, return to the judgment module;

[0123] When the first time is not the second target time, it indicates that the outdoor environment is always a daytime environment, and there is no need to enter the judgment module.

[0124] Example 3

[0125] This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements any one of the methods for managing campus pedestrian gates based on facial recognition authorization provided by the above methods.

[0126] Since the electronic device introduced in this embodiment is an electronic device used to implement the park pedestrian gate management method based on face recognition authorization in the embodiment of this application, based on the park pedestrian gate management method based on face recognition authorization introduced in the embodiment of this application, the technical personnel of this field can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application is not described in detail here. As long as the technical personnel of this field implement the electronic device used in the park pedestrian gate management method based on face recognition authorization in the embodiment of this application, it belongs to the scope of protection of this application.

[0127] Example 4

[0128] The present embodiment discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the above-mentioned campus pedestrian gate management method based on face recognition authorization is implemented.

[0129] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters, weights and thresholds in the formula are set by technicians in this field according to actual conditions.

[0130] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired network or a wireless network. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD) or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0131] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0132] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0133] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only one, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0136] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0137] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A park pedestrian gate management method based on face recognition authorization, characterized in that: include: S10: Obtain the current of the lighting lamp. If the current of the lighting lamp is zero, proceed to S20. If the current of the lighting lamp is not zero, proceed to S30. The lighting lamp is used to illuminate the gate. S20: Acquire positioning information, generate a first adjustment angle based on the positioning information and a pre-built angle adjustment model, adjust the face recognition device according to the first adjustment angle and proceed to S40, wherein the positioning information includes the gate position, the first time, and the ultraviolet intensity; S30: Obtain the first posture and the second time of the current device, generate the number of compensation lamps based on the first posture of the current device, the lighting lamp current, and the pre-built light compensation model, and determine whether to return to S10 according to the second time; S40: acquiring a real-time face image and a second posture, determining whether the photographed object is in a standard position based on the real-time face image, and if so, performing face recognition; if not, acquiring a third angle based on the real-time face image and the second posture, adjusting the face recognition device to perform face recognition based on the third angle, and determining whether to return to S10 based on the first time; The first adjustment angle is an optimal adjustment angle, and a method for determining the optimal adjustment angle includes: Acquire an experimental face image at a real-time angle, generate a real-time grayscale value based on the experimental face image, and determine whether the absolute value of the difference between the real-time grayscale value and the standard grayscale value is less than a preset grayscale difference threshold; if so, determine the real-time angle as the optimal adjustment angle, and the standard grayscale value is the grayscale value of the standard face image; The method for constructing the angle adjustment model includes: Acquire a sample data set, wherein the sample data set includes historical gate position information, historical first time, historical ultraviolet intensity, and historical first adjustment angle, divide the sample data set into a sample training set and a sample test set, construct a regression network, use the historical gate position information, historical first time, and historical ultraviolet intensity in the sample training set as input data of the regression network, use the historical first adjustment angle in the sample training set as output data of the regression network, train the regression network, obtain an initial regression network for predicting the real-time first adjustment angle, test the initial regression network using the sample test set, and output a regression network that meets a preset test accuracy as an angle adjustment model; The method for determining whether the photographed object is in a standard position comprises: Acquire real-time feature points based on the real-time face image, calculate the real-time Euclidean distance between the real-time feature points and the standard feature points, and determine whether the real-time Euclidean distance is less than a distance threshold. If so, determine that the photographed object is in the standard position; if not, determine that the photographed object is not in the standard position, and the standard feature points are facial feature points of the standard face image; The method for obtaining the third angle according to the real-time face image and the second posture includes: A real-time three-dimensional face model is established based on real-time feature points, a rotation matrix is ​​determined based on the real-time three-dimensional face model and a standard three-dimensional face model, a rotation angle is determined based on the rotation matrix, and a third angle is determined based on the second posture and the rotation angle. The standard three-dimensional face model is established by standard feature points, and the rotation angle includes adjusting the pitch angle, adjusting the yaw angle, and adjusting the roll angle.

2. The park pedestrian gate management method based on face recognition authorization according to claim 1 is characterized in that: The method for determining whether to return to S10 according to the second time includes: Determine whether the second time is the first target time, and if so, return to S10.

3. The park pedestrian gate management method based on face recognition authorization according to claim 1 is characterized in that: The method for determining whether to return to S10 based on the first time includes: Determine whether the first time is the second target time, and if so, return to S10.

4. A park pedestrian gate management system based on face recognition authorization, which is used to implement the park pedestrian gate management method based on face recognition authorization as described in any one of claims 1 to 3, characterized in that: include: The discrimination module is used to obtain the current of the lighting lamp. If the current of the lighting lamp is zero, it is transferred to the adjustment module. If the current of the lighting lamp is not zero, it is transferred to the compensation module. The lighting lamp is used to illuminate the gate machine. Adjustment module: used to obtain positioning information, generate a first adjustment angle based on the positioning information and a pre-built angle adjustment model, adjust the face recognition device according to the first adjustment angle and transfer to the posture adjustment module, wherein the positioning information includes the gate position, the first time and the ultraviolet intensity; Compensation module: used to obtain the first posture and second time of the current device, generate the number of compensation lights based on the first posture of the current device, the lighting current, and the pre-built light compensation model, and determine whether to return to the discrimination module according to the second time; Posture adjustment module: used to obtain real-time face image and second posture, determine whether the photographed object is in the standard position based on the real-time face image, if so, perform face recognition, if not, obtain a third angle based on the real-time face image and the second posture, adjust the face recognition device according to the third angle to perform face recognition, and determine whether to return to the discrimination module based on the first time.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, it implements the campus pedestrian gate management method based on face recognition authorization as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, implements the campus pedestrian gate management method based on face recognition authorization as described in any one of claims 1 to 3.