Face recognition method, device, system and terminal equipment
By predicting the positional changes of the target object and the relationship between the camera and the viewfinder, the base is rotated, solving the problem of low face recognition efficiency in strong backlight scenes and achieving a highly efficient and accurate recognition process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIVIEW TECH CO LTD
- Filing Date
- 2024-11-28
- Publication Date
- 2026-05-29
AI Technical Summary
In strong backlighting scenarios, the sun itself is present behind the face in the image captured by the terminal device, affecting the efficiency of face recognition. Furthermore, adjusting the camera angle requires the user to move along with the image, reducing recognition efficiency.
By predicting the positional changes of the target object and the relationship between the camera and the viewfinder, the base is rotated to ensure that the target object is not visible in the viewfinder of the second camera. This allows for facial recognition using the second camera, avoiding interference from the target object.
This improves facial recognition efficiency, eliminating the need for users to follow the camera and the direction of the access gate, thus enhancing the accuracy and efficiency of recognition.
Smart Images

Figure CN122116434A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camera technology, and in particular to a face recognition method, device, system and terminal equipment. Background Technology
[0002] In today's digital age, security has become an indispensable part of daily life and work. With the continuous advancement of technology, facial recognition technology has emerged. Whether in office parks, community management, or public safety, facial recognition technology plays an increasingly important role. However, the terminal devices... Figure 1 When recognizing faces in a strong backlighting scene, the presence of the sun behind the face in the image captured by the terminal device affects face recognition.
[0003] In related technologies, terminal equipment and camera equipment are usually set up on the access gate. When the terminal equipment detects the sun in the image captured by the camera equipment, it adjusts the angle of the camera equipment and performs facial recognition based on the adjusted camera equipment. Users who pass the facial recognition are allowed to pass through the access gate.
[0004] However, in the aforementioned technologies, if the camera device's adjustment angle is too large, the user will need to move with the camera device's angle first, and then return to the direction of the access gate after facial recognition is successful, thus reducing the efficiency of facial recognition. Summary of the Invention
[0005] This invention provides a face recognition method, apparatus, system, and terminal device to address the shortcomings of reduced efficiency in existing face recognition technologies.
[0006] This invention provides a face recognition method, comprising: If it is determined that the target object is included in the first sky video captured by the first camera device, based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens image of the first camera device and the second lens image of the second camera device, the target position, target duration and second position change pattern of the target object entering the second lens image are predicted. Based on the target location, the target duration, and the change pattern of the second location, the base is controlled to rotate. A passage door is provided on the base. The first camera device and the second camera device are both installed on the passage door so that the target object is not included in the lens view of the second camera device. Facial recognition is performed using a second camera device.
[0007] According to a face recognition method provided by the present invention, the step of predicting the target position, target duration, and second position change pattern of the target object entering the second lens frame based on the first position change pattern of the target object in the sky video and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device includes: Based on the first position change pattern, the moving direction and moving speed of the target object are determined; Based on the direction of movement, the speed of movement, and the positional relationship, predict the target position, the duration of the target's entry into the second camera view, and the pattern of change in the second position.
[0008] According to a face recognition method provided by the present invention, the step of controlling the base to rotate based on the target location, the target duration, and the change law of the second location includes: Determine the target distance between the target location and the target edge in the second lens image, wherein the target edge is perpendicular to the edge in the second lens image where the target location is located; Based on the target distance, the target duration, and the pattern of the second position change, the target rotation speed of the base is determined; The base is controlled to rotate the target for a duration based on the target's rotation speed.
[0009] According to a face recognition method provided by the present invention, the method further includes: In the case where there is a target area with a brightness lower than the first preset brightness in the first sky video, the brightness change pattern at the target area is obtained, where the first preset brightness is the brightness corresponding to the sun itself. When the brightness variation pattern is uniform and the difference between the brightness at the target area and the second preset brightness is greater than a preset threshold, the target area is determined to include the halo of the sun body, the halo of the sun body is determined as the target object, and the second preset brightness is the brightness corresponding to the non-halo.
[0010] According to a face recognition method provided by the present invention, the method further includes: When the preset sunset time arrives and the target object is not present in the first shot frame, the base is controlled to rotate to its initial position based on a preset rotation speed.
[0011] According to a face recognition method provided by the present invention, the method further includes: In a sunrise scene, before the preset sunrise time, the base is controlled to rotate by a preset angle so that after the preset sunrise time arrives, the target object is not included in the lens view of the second camera device after rotating by the preset angle. The preset angle is obtained based on the image collected in the sunrise scene. Face recognition is performed using a second camera device after it has been rotated to a preset angle.
[0012] According to a face recognition method provided by the present invention, the method further includes: Based on the second sky video captured by the first camera device, the movement trajectory of the target object is determined; If the target object is not included in the third lens image predicted based on the movement trajectory, the base after rotating by a preset angle is controlled to rotate to the initial position of the base based on a preset rotation speed, and the third lens image is the lens image of the second camera device at the initial position.
[0013] The present invention also provides a face recognition device, comprising: The prediction unit is used, in a sunset scene, when it is determined that the target object is included in the first sky video captured by the first camera device, to predict the target position, target duration and second position change pattern of the target object entering the second lens frame based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device. The first control unit is used to control the base to rotate based on the target position, the target duration and the change law of the second position. The base is provided with a passage door. The first camera device and the second camera device are both installed on the passage door so that the target object is not included in the lens image of the second camera device. The first recognition unit is used for facial recognition based on the second camera device.
[0014] The present invention also provides a face recognition system, including a base, an access gate, a first camera device, a second camera device, and a terminal device. The access gate is disposed on the base, and the terminal device, the first camera device, and the second camera device are all disposed on the access gate. The first camera device is used to send the captured first sky video to the terminal device; The terminal device is used, in a sunset scene, when it is determined that the target object is included in the first sky video captured by the first camera device, to predict the target position, target duration, and second position change pattern of the target object entering the second lens frame based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device. The terminal device is also used to control the base to rotate based on the target position, the target duration, and the change pattern of the second position, so that the target object is not included in the lens view of the second camera device; The terminal device is also used for facial recognition based on the second camera device.
[0015] The present invention also provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the face recognition method as described above.
[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the face recognition method as described above.
[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the face recognition method as described above.
[0018] The face recognition method, apparatus, system, and terminal device provided by this invention, when it is determined that a target object is included in a first sky video captured by a first camera device, predicts the target position, target duration, and second position change pattern of the target object entering the second lens image based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens image of the first camera device and the second lens image of the second camera device. Based on the target position, target duration, and second position change pattern, the base of the access gate, the first camera device, and the second camera device is controlled to rotate so that the target object is not included in the lens image of the second camera device, and then face recognition is performed based on the second camera device. As can be seen, this invention predicts the target position, target duration, and second position change pattern of a target object entering the second lens frame of a second camera device based on the first sky video captured by the first camera device. Based on these target position, target duration, and second position change patterns, the base is controlled to rotate so that after the base rotates, the target object is not included in the lens frame of the second camera device. Thus, during the movement of the target object, it will not be included in the lens frame of the second camera device, avoiding any impact on facial recognition. In this process, since this invention controls the rotation of the entire base, the user does not need to follow the direction of the second camera device and the direction of the access gate, thereby improving the efficiency of facial recognition. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of a strong backlight scene in related technologies.
[0021] Figure 2 This is one of the flowcharts of the face recognition method provided in the embodiments of the present invention.
[0022] Figure 3 This is one of the scenario diagrams of the face recognition method provided in the embodiments of the present invention.
[0023] Figure 4 This is a schematic diagram of the structure of the face recognition system provided in an embodiment of the present invention.
[0024] Figure 5 This is the second flowchart of the face recognition method provided in the embodiments of the present invention.
[0025] Figure 6This is the second scenario illustration of the face recognition method provided in the embodiments of the present invention.
[0026] Figure 7 This is the third flowchart of the face recognition method provided in this embodiment of the invention.
[0027] Figure 8 This is the fourth flowchart of the face recognition method provided in the embodiments of the present invention.
[0028] Figure 9 This is the third scenario illustration of the face recognition method provided in the embodiments of the present invention.
[0029] Figure 10 This is the fourth scenario illustration of the face recognition method provided in the embodiments of the present invention.
[0030] Figure 11 This is the fifth flowchart of the face recognition method provided in the embodiments of the present invention.
[0031] Figure 12 This is the sixth flowchart of the face recognition method provided in this embodiment of the invention.
[0032] Figure 13 This is a schematic diagram of the structure of the face recognition device provided in an embodiment of the present invention.
[0033] Figure 14 This is a schematic diagram of the physical structure of the terminal device provided in an embodiment of the present invention. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0035] The following is combined with Figures 2-12 The present invention describes a face recognition method. The subject executing the face recognition method can be a terminal device or a face recognition device installed in the terminal device. The face recognition device can be implemented by software, hardware or a combination of both.
[0036] Figure 2 This is one of the flowcharts illustrating the face recognition method provided in this embodiment of the invention, such as... Figure 2 As shown, the face recognition method includes the following steps: Step 201: If it is determined that the target object is included in the first sky video captured by the first camera device, based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens image of the first camera device and the second lens image of the second camera device, predict the target position, target duration and second position change pattern of the target object entering the second lens image.
[0037] For example, Figure 3 This is one of the scenario illustrations of the face recognition method provided in the embodiments of the present invention, such as... Figure 3 As shown, the first camera device is installed at the top of the passageway, selected to capture the entire sky. This first camera detects and tracks the trajectory of the sun. The second camera captures facial images. The sunrise time at the location of the terminal device is obtained. Before a preset time period arrives at sunrise, the first camera enters a sun detection mode, capturing a first-day sky video. This video is then analyzed to determine if a target object is included. The target object can be the sun itself or its halo when obscured by clouds. If the target object is found, a first position change pattern is determined based on its position within the video. Then, based on this first position change pattern and the pre-defined positional relationship between the first and second camera views, the target object's entry into the second camera view is predicted, along with its target position, duration, and second position change pattern. The target position and duration are correlated; the target position can be the predicted edge of the second camera view or another location.
[0038] It should be noted that the present invention does not limit the execution time of step 201; it can be executed as long as the target object is detected. For example, it can be executed in a sunrise scene, a sunset scene, or other scenes in which the target object is detected.
[0039] Step 202: Based on the target position, the target duration, and the change pattern of the second position, control the base to rotate. The base is provided with a passage door. The first camera device and the second camera device are both installed on the passage door so that the target object is not included in the lens view of the second camera device.
[0040] Among them, the access gate is a device that controls the entry and exit of users. The access gate can be a speed gate or a turnstile, etc.
[0041] For example, when predicting the target position, target duration, and second position change pattern of the target object entering the second lens frame of the second camera device, the rotation speed of the base is dynamically analyzed based on the target position, target duration, and second position change pattern. The base is controlled to rotate based on the analyzed rotation speed, ensuring that the target object is not included in the lens frame of the second camera device after the base rotates. In this way, the target object will not appear in the lens frame of the second camera device during the movement of the target object, effectively avoiding interference of the target object with face recognition. Figure 4 This is a schematic diagram of the structure of the face recognition system provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the terminal device and the access gate are set as a whole on the base, which can be a turntable. Users who pass facial recognition are allowed to pass through the access gate.
[0042] Step 203: Perform facial recognition based on the second camera device.
[0043] For example, after the base rotates, since the second camera device is mounted on the base, the second camera device rotates along with the base. At this time, the second camera device captures a face image, and then the face in the face image is recognized.
[0044] The face recognition method provided by this invention, when it is determined that a target object is included in a first sky video captured by a first camera device, predicts the target position, target duration, and second position change pattern of the target object entering the second lens image based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens image of the first camera device and the second lens image of the second camera device. Based on the target position, target duration, and second position change pattern, the base of the access gate, the first camera device, and the second camera device is controlled to rotate so that the target object is not included in the lens image of the second camera device, and then face recognition is performed based on the second camera device. As can be seen, this invention predicts the target position, target duration, and second position change pattern of a target object entering the second lens frame of a second camera device based on the first sky video captured by the first camera device. Based on these target position, target duration, and second position change patterns, the base is controlled to rotate so that after the base rotates, the target object is not included in the lens frame of the second camera device. Thus, during the movement of the target object, it will not be included in the lens frame of the second camera device, avoiding any impact on facial recognition. In this process, since this invention controls the rotation of the entire base, the user does not need to follow the direction of the second camera device and the direction of the access gate, thereby improving the efficiency of facial recognition.
[0045] In one embodiment, Figure 5 This is a second schematic flowchart of the face recognition method provided in this embodiment of the invention, as shown below.Figure 5 As shown, step 201 above, based on the first position change pattern of the target object in the sky video and the positional relationship between the first lens view of the first camera device and the second lens view of the second camera device, predicts the target position, target duration, and second position change pattern of the target object entering the second lens view. This can be achieved through the following steps: Step 2011: Based on the first position change pattern, determine the moving direction and moving speed of the target object.
[0046] For example, the duration of continuous tracking of the first sky video can be set based on requirements. For instance, if the continuous tracking duration is 30 minutes and the target object is the sun itself, when it is determined that the first sky video includes the sun itself, the first position change pattern of the sun itself is determined based on the position of the pixels representing the sun itself in each sky image in the first sky video. Then, based on the analysis of the first position change pattern, the direction and speed of movement of the sun itself are calculated.
[0047] Step 2012: Based on the movement direction, the movement speed, and the positional relationship, predict the target position, the target duration, and the change pattern of the second position when the target object enters the second camera view.
[0048] For example, Figure 6 This is a second scenario illustration of the face recognition method provided in this embodiment of the invention, as shown below. Figure 6 As shown, the lens orientations of the first and second camera devices are adjusted so that a portion of the second lens image from the second camera device appears within the first lens image from the first camera device. The positional relationship between the first and second lens images within the first camera device is recorded. After determining the positional relationship, the direction and speed of the sun's movement, a line is drawn starting from the position of the sun in a sky image from the first sky video, along the direction of movement, until it extends to the edge of the second lens image included in the first camera device, thus obtaining the target position of the edge of the second lens image. Figure 6 The target position is represented by A. The target duration corresponding to the target position can be determined based on the distance and movement speed between the sun's position and the target position in the sky image. Furthermore, the change pattern of the sun's position as it enters the second shot frame can be predicted based on the direction and speed of movement, and then the target duration corresponding to other target positions of the sun in the second shot frame can be predicted based on this change pattern.
[0049] In this embodiment, the target position, target duration, and second position change pattern of the target object entering the second lens image can be dynamically predicted based on the target object's moving direction, moving speed, and the positional relationship between the first lens image and the second lens image. This facilitates subsequent control of the base rotation to avoid the target object based on the target position, target duration, and second position change pattern, thereby improving the efficiency of face recognition.
[0050] In one embodiment, the target information further includes movement speed; Figure 7 This is the third flowchart illustrating the face recognition method provided in this embodiment of the invention, as shown below. Figure 7 As shown, step 202 above controls the base to rotate based on the target position, the target duration, and the change pattern of the second position. This can be achieved through the following steps: Step 701: Determine the target distance between the target position and the target edge in the second lens image, wherein the target edge is perpendicular to the edge where the target position is located in the second lens image.
[0051] For example, taking the sun as the target object, when predicting the target position of the sun entering the second shot's frame, the distance between the target position and the target edge in the second shot's frame can be calculated. Here, the target edge can be... Figure 6 The edges 1 and 2 shown represent the calculated distances 1 and 2 between the target location and edge 1, respectively. Either distance 1 or distance 2 can be determined as the target distance, or distance 1 and distance 2 can be compared, and the minimum distance between them can be determined as the target distance. Figure 6 If distance 1 is set as the target distance, then the rotation direction of the base can be determined to be clockwise; if distance 2 is set as the target distance, then the rotation direction of the base can be determined to be counterclockwise.
[0052] Step 702: Determine the target rotation speed of the base based on the target distance, the target duration, and the second position change pattern.
[0053] For example, such as Figure 6As shown, starting from the position of the sun in a certain sky image of the first sky video, a line is drawn along the direction of movement until it extends to the edge of the second lens frame included in the first camera device. The length of the resulting line segment L is the distance 1 between the position of the sun in the sky image and the target position. Dividing the distance 1 by the movement speed, the target time t1 of the sun moving from its position in the sky image to the target position at the edge of the second lens frame can be predicted. Based on the change law of the second position, other target positions and corresponding target times of the sun entering the second lens frame are predicted. Thus, the target rotation speed v1 of the base is dynamically determined based on the predicted target times.
[0054] Step 703: Control the base to rotate the target for the duration based on the target rotation speed.
[0055] For example, when the target rotation speed v1 of the base is obtained, the base is controlled to rotate for a target duration t1 along the rotation direction of the base determined above based on the target rotation speed v1. The second camera device follows the rotation of the base. When the target duration t1 ends, the sun body moves to the target position and will not appear in the lens of the second camera device, thus effectively avoiding interference of the sun body with face recognition.
[0056] It should be noted that, based on the target position, target duration, and the change pattern of the second position, controlling the base rotation can also be achieved in the following way: input the target position, target duration, and the change pattern of the second position into the speed prediction model to obtain the predicted rotation speed output by the speed prediction model, and control the base to rotate along the determined rotation direction of the base based on the predicted rotation speed for the corresponding target duration t1.
[0057] The specific training process of the velocity prediction model is as follows: Multiple sample sets are acquired, including the sample position of the target object entering the second shot frame, the sample duration of the target object entering the second shot frame, and the sample position change pattern of the target object. All sample sets are input into the initial velocity prediction model to obtain the predicted velocity of the base rotation output by the initial velocity prediction model. Based on the predicted velocity of the base rotation and the velocity labels corresponding to the sample sets, the model parameters of the initial velocity prediction model are iteratively optimized until the convergence condition is met, thus obtaining the velocity prediction model. The velocity label represents the rotational speed of the target object after the base rotation, when it does not appear in the second shot frame, given the sample position, sample duration, and sample position change pattern.
[0058] It should be noted that the model structure of the initial velocity prediction model can be a deep neural network (DNN) or a convolutional neural network (CNN), etc., and this invention does not limit it.
[0059] In this embodiment, the target rotation speed of the base can be dynamically determined based on the target distance between the target position and the target edge of the second lens image, the target duration, and the change law of the second position, thereby realizing the automatic rotation of the base and further improving the efficiency of face recognition.
[0060] In one embodiment, Figure 8 This is the fourth flowchart illustrating the face recognition method provided in this embodiment of the invention, as shown below. Figure 8 As shown, the face recognition method also includes the following steps: Step 801: If there is a target area in the first sky video with a brightness lower than the first preset brightness, obtain the brightness change pattern of the target area, where the first preset brightness is the brightness corresponding to the sun itself.
[0061] For example, the brightness of each sky image in the first sky video is analyzed to identify target areas with brightness levels lower than a first preset brightness. Since the first preset brightness corresponds to the brightness of the sun itself, the target areas can be determined to be regions not containing the sun. For each target area, based on sky images in the first sky video arranged chronologically that include the target area, the brightness variation pattern at the target area is determined.
[0062] Step 802: When the brightness change pattern is uniform and the difference between the brightness at the target area and the second preset brightness is greater than a preset threshold, it is determined that the target area includes the halo of the sun body, and the halo of the sun body is determined as the target object, and the second preset brightness is the brightness corresponding to the non-halo.
[0063] For example, when the brightness variation pattern in the target area is uniform, it is further determined whether the difference between the brightness in the target area and the second preset brightness corresponding to the non-halo and non-solar body is greater than a preset threshold. If it is determined that the difference between the brightness in the target area and the second preset brightness corresponding to the non-halo and non-solar body is greater than the preset threshold, it indicates that the brightness in the target area is greater than the brightness corresponding to the non-halo, and it can be determined that the target area is not the area where the non-halo is located. Since the brightness of the halo of the solar body is greater than the brightness of the non-halo but less than the brightness of the solar body, the target area can be determined as the area where the halo of the solar body is located, and thus the halo of the solar body in the target area is determined as the target object.
[0064] It should be noted that when there is a target area with a brightness greater than or equal to the first preset brightness in the first sky video, it is determined that the target area includes the sun body, and the sun body in the target area is determined as the target object; or the image features of each sky image in the first sky video are analyzed to determine whether the image features corresponding to the sun body are included. When it is determined that the image features corresponding to the sun body are included, the target object included in the first sky video is determined to be the sun body.
[0065] It should be noted that, if the brightness change at the target location is uniform and the difference between the brightness of the halo and the target brightness (the brightness at the target location excluding the halo) is greater than a preset threshold, it can be determined that there is a halo of the sun at the target location. As the brightness change indicates that the brightness is gradually increasing, based on the correspondence between the halo region and the duration, the duration t2 corresponding to the target halo region to which the halo of the sun at the target location belongs is predicted. The duration t2 is the duration from the image representing the target halo region to representing the sun at the target location. This duration t2 is determined as the target duration. This invention does not limit this.
[0066] Specifically, considering that the sun may sometimes be obscured by clouds, causing abnormalities in sun detection and tracking, the position and direction of movement of the sun can be predicted based on the brightness changes at the edge of the second camera image. Specifically, the sun can be moved from outside the acquisition frame to inside, and the outer region of the sun in the acquisition frame can be divided into multiple halo regions. The brightness of each halo region and the brightness of the sun body region are calculated. The same method is used to calculate the brightness of each halo region and the brightness of the sun body region in multiple acquisition frames. Based on the brightness of each halo region and the brightness of the sun body region in multiple acquisition frames, the brightness change pattern is learned. Furthermore, for each halo region, the time it takes for the same location to change from a halo region to the sun body is recorded, thus obtaining the correspondence between halo regions and time durations. When a halo of the sun is present at the target position at the edge of the second lens image of the second camera device, it is further determined whether the brightness of the halo gradually increases. If the brightness gradually increases, it indicates that the sun is about to appear at the target position. Therefore, the direction of movement of the sun is determined to be along the direction of the second lens image of the second camera device. Then, the target halo region to which the halo at the target position belongs is determined. If the halo at the target position includes only one halo region, then that halo region is determined as the target halo region. If the halo at the target position includes at least two halo regions, the halo region with the highest brightness among the at least two halo regions is determined as the target halo region. Based on the pre-stored correspondence between halo regions and durations, the duration t2 corresponding to the target halo region is determined. Figure 9 This is the third scenario illustration of the face recognition method provided in this embodiment of the invention, as shown below. Figure 9As shown, there is a halo of the sun at the target position in the second lens image. Based on the correspondence between the halo area and the duration, the duration t2 corresponding to the target halo area at the target position can be determined. This duration t2 is then determined as the target duration, and the target rotation speed of the base can be determined accordingly. Figure 10 This is the fourth scenario illustration of the face recognition method provided in this embodiment of the invention, as shown below. Figure 10 As shown, when there is a halo around the sun at the edge of the second shot's view, if the sun moves downwards, you can avoid it by rotating the control base clockwise.
[0067] In this embodiment, based on the brightness variation pattern in the target area, it is determined whether the target area includes the halo of the sun. When the target area includes the halo of the sun, the halo of the sun is identified as the target object, thus realizing the tracking of the sun when the sun is obscured by clouds, thereby improving the accuracy of face recognition.
[0068] In one embodiment, after step 203 described above, the face recognition method further includes the following steps: When the preset sunset time arrives and the target object is not present in the first shot frame, the base is controlled to rotate to its initial position based on a preset rotation speed.
[0069] For example, a preset sunset time is obtained. When the terminal device reaches the preset sunset time, it determines whether the sun or its halo exists in the first lens image of the first camera device. If the first lens image of the second camera device does not contain the sun or its halo, the control base rotates back to its initial position based on a preset rotation speed, thus returning the base to its upright position. The terminal device also exits the sun detection mode. It should be noted that the preset rotation speed can be set according to needs, and a speed that is imperceptible to the user can be selected to avoid affecting the passage experience.
[0070] On the second day, the sunrise time of the location of the terminal device is acquired again. Before the preset time period of sunrise is reached, the first camera device is controlled to enter the sun detection mode. This cycle is repeated to achieve face recognition.
[0071] In this embodiment, when the preset sunset time arrives and there is no target object in the first lens frame, the control base rotates to the initial position of the base based on a preset rotation speed, thereby realizing the return of the base to its correct position and improving the aesthetics of the face recognition system.
[0072] In one embodiment, Figure 11 This is the fifth flowchart illustrating the face recognition method provided in this embodiment of the invention, as shown below. Figure 11 As shown, the face recognition method also includes the following steps: Step 1101: In a sunrise scene, before the preset sunrise time, control the base to rotate by a preset angle so that after the preset sunrise time arrives, the target object is not included in the lens view of the second camera device after rotating by the preset angle. The preset angle is obtained based on the image collected in the sunrise scene.
[0073] For example, when performing face recognition for the first time in a sunrise scene, the base angle can be manually rotated, or the angle can be determined by testing based on images captured in the sunrise scene. This angle needs to ensure that after the preset sunrise time arrives, that is, during the process of the sun rising, the sun itself or its halo will not appear in the lens image of the first camera device. This angle is calibrated as the preset angle, which can also be called the "avoidance angle". Before the preset sunrise time, the base is controlled to rotate the preset angle.
[0074] Step 1102: Perform face recognition based on the second camera device after rotating at a preset angle.
[0075] For example, when the control base rotates to a preset angle, the second camera device rotates along with the base. Therefore, it can be ensured that after rotating to the preset angle, the lens image of the second camera device does not include the sun body or the halo of the sun body. Thus, face recognition based on the second camera device after rotating to the preset angle can avoid the sun body or the halo of the sun body.
[0076] In this embodiment, in a sunrise scenario, the base is pre-controlled to rotate by a preset angle before the preset sunrise time, so that the target object is not included in the lens image of the second camera device after the preset sunrise time has arrived, thus avoiding the target object from affecting face recognition and improving the accuracy of face recognition.
[0077] In one embodiment, Figure 12 This is the sixth flowchart illustrating the face recognition method provided in this embodiment of the invention, as shown below. Figure 12 As shown, after step 1102 above, the face recognition method further includes the following steps: Step 1103: Based on the second sky video captured by the first camera device, determine the movement trajectory of the target object; if the target object is not included in the predicted third lens image based on the movement trajectory, control the base after rotating by a preset angle to rotate to the initial position of the base at a preset rotation speed, and the third lens image is the lens image of the second camera device at the initial position.
[0078] For example, taking the sun as the target object, after controlling the base to rotate at a preset angle, it is determined whether the second sky video captured by the first camera device includes the sun. If the sun is included in the second sky video, the movement trajectory of the sun is determined based on the second sky video. Based on the movement trajectory, it is predicted whether the sun will appear in the third lens view of the second camera device after the base is returned to its original position. If it is predicted that the sun will not appear in the third lens view, it means that the base can avoid the sun after returning to its original position. Therefore, the base is controlled to rotate to the initial position of the base based on a preset rotation speed to achieve the return of the base to its original position.
[0079] On the second day, based on the sunrise time of the location of the terminal device, the base is controlled to rotate in advance by the "preset angle / preset rotation speed" time. This ensures that the base can rotate to the preset angle before sunrise to accurately avoid the sun. When it is predicted that the sun will not appear in the third lens of the second camera device after the base is returned to its original position based on the new movement trajectory, the base is controlled to return to its original position. This cycle is repeated to achieve face recognition.
[0080] It should be noted that when the target object is the halo of the sun itself, the movement trajectory of the halo of the sun itself can be determined based on the second sky video, and then the homing of the base can be determined based on the movement trajectory of the halo. This invention will not be elaborated here.
[0081] In this embodiment, when the target object is not included in the third lens image based on the predicted movement trajectory, the control base rotates to the initial position of the base based on a preset rotation speed, thereby achieving the return of the base to its correct position and improving the aesthetics of the face recognition system.
[0082] The face recognition device provided by the present invention will be described below. The face recognition device described below can be referred to in correspondence with the face recognition method described above.
[0083] Figure 13 This is a schematic diagram of the structure of the face recognition device provided in an embodiment of the present invention, as shown below. Figure 13 As shown, the face recognition device 1300 includes a prediction unit 1301, a first control unit 1302, and a first recognition unit 1303; wherein: The prediction unit 1301 is used to predict the target position, target duration, and second position change pattern of the target object entering the second lens frame when it is determined that the first sky video captured by the first camera device includes a target object, based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device. The first control unit 1302 is used to control the base to rotate based on the target position, target duration, and the change law of the second position. The base is provided with a passage door. The first camera device and the second camera device are both installed on the passage door so that the target object is not included in the lens image of the second camera device. The first recognition unit 1303 is used for face recognition based on the second camera device.
[0084] The facial recognition device provided by this invention, in a sunset scene, when it is determined that the target object is included in the first sky video captured by the first camera device, predicts the target position, target duration, and second position change pattern of the target object entering the second lens frame based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device. Based on the target position, target duration, and second position change pattern, the device controls the base of the access gate, the first camera device, and the second camera device to rotate so that the target object is not included in the lens frame of the second camera device, and then performs facial recognition based on the second camera device. As can be seen, this invention predicts the target position, target duration, and second position change pattern of a target object entering the second lens frame of a second camera device based on the first sky video captured by the first camera device. Based on these target position, target duration, and second position change patterns, the base is controlled to rotate so that after the base rotates, the target object is not included in the lens frame of the second camera device. Thus, during the movement of the target object, it will not be included in the lens frame of the second camera device, avoiding any impact on facial recognition. In this process, since this invention controls the rotation of the entire base, the user does not need to follow the direction of the second camera device and the direction of the access gate, thereby improving the efficiency of facial recognition.
[0085] Based on any of the above embodiments, the prediction unit 1301 is specifically configured to include: Based on the first position change pattern, the moving direction and moving speed of the target object are determined; Based on the direction of movement, the speed of movement, and the positional relationship, predict the target position, the duration of the target's entry into the second camera view, and the pattern of change in the second position.
[0086] Based on any of the above embodiments, the target information further includes movement speed; the first control unit 1302 is specifically used for: Determine the target distance between the target location and the target edge in the second lens image, wherein the target edge is perpendicular to the edge in the second lens image where the target location is located; Based on the target distance, the target duration, and the pattern of the second position change, the target rotation speed of the base is determined; The base is controlled to rotate the target for a duration based on the target's rotation speed.
[0087] Based on any of the above embodiments, the face recognition device 1300 further includes: The acquisition unit is used to acquire the brightness change pattern of the target area when there is a target area with a brightness lower than a first preset brightness in the first sky video, where the first preset brightness is the brightness corresponding to the sun itself. The first determining unit is configured to determine that the target area includes the halo of the sun body when the brightness change pattern is uniform and the difference between the brightness at the target area and the second preset brightness is greater than a preset threshold, and to determine the halo of the sun body as the target object, wherein the second preset brightness is the brightness corresponding to the non-halo.
[0088] Based on any of the above embodiments, the face recognition device 1300 further includes: The second control unit is used to control the base to rotate to the initial position of the base based on a preset rotation speed when the preset sunset time arrives and the target object is not in the first lens frame.
[0089] Based on any of the above embodiments, the face recognition device 1300 further includes: The third control unit is used to control the base to rotate by a preset angle before the preset sunrise time in a sunrise scene, so that the target object is not included in the lens image of the second camera device after the preset sunrise time is reached. The preset angle is obtained by testing based on images collected in the sunrise scene. The second recognition unit is used to perform face recognition based on the second camera device after rotating at a preset angle.
[0090] Based on any of the above embodiments, the face recognition device 1300 further includes: The second determining unit is used to determine the movement trajectory of the target object based on the second sky video captured by the first camera device; The fourth control unit is used to control the base, after rotating by a preset angle, to rotate to the initial position of the base at a preset rotation speed when the target object is not included in the third lens image based on the predicted movement trajectory. The third lens image is the lens image of the second camera device at the initial position.
[0091] This invention also provides a face recognition system, including a base, an access gate, a first camera device, a second camera device, and a terminal device. The access gate is disposed on the base, and the terminal device, the first camera device, and the second camera device are all disposed on the access gate. The first camera device is used to send the captured first sky video to the terminal device; The terminal device is used to predict the target position, target duration, and second position change pattern of the target object entering the second lens frame based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device when it is determined that the target object is included in the first sky video captured by the first camera device. The terminal device is also used to control the base to rotate based on the target position, target duration, and the change pattern of the second position, so that the target object is not included in the lens view of the second camera device; The terminal device is also used for facial recognition based on the second camera device.
[0092] Figure 14 This is a schematic diagram of the physical structure of the terminal device provided in the embodiments of the present invention, such as... Figure 14 As shown, the terminal device may include a processor 1410, a communications interface 1420, a memory 1430, and a communication bus 1440, wherein the processor 1410, the communications interface 1420, and the memory 1430 communicate with each other through the communication bus 1440. The processor 1410 can call logical instructions in the memory 1430 to execute a face recognition method. The method includes: when it is determined that a target object is included in a first sky video captured by a first camera device, based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens image of the first camera device and the second lens image of the second camera device, predicting the target position, target duration, and second position change pattern of the target object entering the second lens image; controlling the base to rotate based on the target position, the target duration, and the second position change pattern, wherein the base is provided with a passage gate, and both the first camera device and the second camera device are mounted on the passage gate, so that the target object is not included in the lens image of the second camera device; and performing face recognition based on the second camera device.
[0093] Furthermore, the logical instructions in the aforementioned memory 1430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0094] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the face recognition method provided by the above methods. The method includes: when it is determined that a target object is included in a first sky video captured by a first camera device, predicting the target position, target duration, and second position change pattern of the target object entering the second lens image based on a first position change pattern of the target object in the first sky video and the positional relationship between the first lens image of the first camera device and the second lens image of the second camera device; controlling the base to rotate based on the target position, the target duration, and the second position change pattern, wherein a passage door is provided on the base, and both the first camera device and the second camera device are disposed on the passage door, so that the target object is not included in the lens image of the second camera device; and performing face recognition based on the second camera device.
[0095] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the face recognition method provided by the above methods. The method includes: when it is determined that a target object is included in a first sky video captured by a first camera device, predicting, based on a first position change pattern of the target object in the first sky video and the positional relationship between the first lens view of the first camera device and the second lens view of the second camera device, the target object's entry into the second lens view; controlling a base to rotate based on the target position, the target duration, and the second position change pattern, wherein a passage gate is provided on the base, and both the first and second camera devices are mounted on the passage gate, so that the target object is not included in the lens view of the second camera device; and performing face recognition based on the second camera device.
[0096] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0097] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A face recognition method, characterized in that, include: If it is determined that the target object is included in the first sky video captured by the first camera device, based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens image of the first camera device and the second lens image of the second camera device, the target position, target duration and second position change pattern of the target object entering the second lens image are predicted. Based on the target location, the target duration, and the change pattern of the second location, the base is controlled to rotate. A passage door is provided on the base. The first camera device and the second camera device are both installed on the passage door so that the target object is not included in the lens view of the second camera device. Facial recognition is performed based on the second camera device.
2. The face recognition method according to claim 1, characterized in that, The method of predicting the target position, target duration, and second position change pattern of the target object entering the second lens frame based on the first position change pattern of the target object in the sky video and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device includes: Based on the first position change pattern, the moving direction and moving speed of the target object are determined; Based on the direction of movement, the speed of movement, and the positional relationship, the target position, the duration of the target's entry into the second camera view, and the pattern of change in the second position are predicted.
3. The face recognition method according to claim 2, characterized in that, The step of controlling the base to rotate based on the target position, the target duration, and the change pattern of the second position includes: Determine the target distance between the target location and the target edge in the second lens image, wherein the target edge is perpendicular to the edge in the second lens image where the target location is located; Based on the target distance, the target duration, and the pattern of the second position change, the target rotation speed of the base is determined; The base is controlled to rotate the target for a duration based on the target's rotation speed.
4. The face recognition method according to claim 1, characterized in that, The method further includes: In the case where there is a target area with a brightness lower than the first preset brightness in the first sky video, the brightness change pattern at the target area is obtained, where the first preset brightness is the brightness corresponding to the sun itself. When the brightness variation pattern is uniform and the difference between the brightness at the target area and the second preset brightness is greater than a preset threshold, the target area is determined to include the halo of the sun body, the halo of the sun body is determined as the target object, and the second preset brightness is the brightness corresponding to the non-halo.
5. The face recognition method according to any one of claims 1-4, characterized in that, The method further includes: When the preset sunset time arrives and the target object is not present in the first shot frame, the base is controlled to rotate to its initial position based on a preset rotation speed.
6. The face recognition method according to any one of claims 1-4, characterized in that, The method further includes: In a sunrise scene, before the preset sunrise time, the base is controlled to rotate by a preset angle so that after the preset sunrise time arrives, the target object is not included in the lens view of the second camera device after rotating by the preset angle. The preset angle is obtained based on the image collected in the sunrise scene. Face recognition is performed using a second camera device after it has been rotated to a preset angle.
7. The face recognition method according to claim 6, characterized in that, The method further includes: Based on the second sky video captured by the first camera device, the movement trajectory of the target object is determined; If the target object is not included in the third lens image based on the predicted movement trajectory, the base, after being rotated by a preset angle, is controlled to rotate to the initial position of the base at a preset rotation speed, and the third lens image is the lens image of the second camera device at the initial position.
8. A face recognition device, characterized in that, include: The prediction unit is used to predict the target position, target duration, and second position change pattern of the target object entering the second lens frame, based on the first position change pattern of the target object in the first sky video captured by the first camera device and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device, when it is determined that the target object is included in the first sky video captured by the first camera device. The first control unit is used to control the base to rotate based on the target position, the target duration and the change law of the second position. The base is provided with a passage door. The first camera device and the second camera device are both installed on the passage door so that the target object is not included in the lens image of the second camera device. The first recognition unit is used to perform face recognition based on the second camera device.
9. A face recognition system, characterized in that, It includes a base, a passage gate, a first camera device, a second camera device, and a terminal device. The passage gate is mounted on the base, and the terminal device, the first camera device, and the second camera device are all mounted on the passage gate. The first camera device is used to send the captured first sky video to the terminal device; The terminal device is used to predict the target position, target duration, and second position change pattern of the target object entering the second lens frame based on the first position change pattern of the target object in the first sky video and the positional relationship between the first lens frame of the first camera device and the second lens frame of the second camera device when it is determined that the target object is included in the first sky video captured by the first camera device. The terminal device is also used to control the base to rotate based on the target position, the target duration, and the change pattern of the second position, so that the target object is not included in the lens image of the second camera device; The terminal device is also used for facial recognition based on the second camera device.
10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the face recognition method as described in any one of claims 1 to 7.