Attendance method, device, equipment and storage medium based on face recognition
The panoramic image is acquired and segmented through the gimbal camera, the scanning angle and focal length are determined, and the face recognition and attendance recording are performed, which solves the problem of difficult to capture and cumbersome details in large-scale monitoring scenarios in the prior art, and achieves efficient and accurate face recognition and attendance recording.
Patent Information
- Application Number
- CN202410932828.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-07-12
AI Technical Summary
The existing solution for face recognition for panoramic screen interception and enlargement in large-scale monitoring scenarios has high camera clarity requirements, difficult to capture details, cumbersome operation, poor user experience, poor dynamic environment adaptability, and high maintenance costs.
The panoramic image is obtained through the gimbal camera, divided into area images, and the scanning angle and focal length of the gimbal camera are determined based on the coordinate information, the image to be recognized is obtained, and input it into the face recognition model for recognition, so that attendance records are performed when the recognition result is valid.
Ensure clear images on the premise of covering a larger range, improve the accuracy and efficiency of face recognition, reduce cumbersome operations, improve user experience, and adapt to dynamic environments and reduce maintenance costs.
Smart Images

Figure CN118537940B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition technology, and in particular to an attendance method, device, equipment and storage medium based on face recognition. Background Art
[0002] Existing solutions for face recognition by capturing and enlarging panoramic images have many drawbacks, mainly in that they require high camera clarity, especially in large-scale monitoring scenarios, where details are difficult to capture, thus affecting the accuracy of face recognition. In addition, some solutions require personnel who need to check attendance to go to a designated location for attendance, which is cumbersome to operate and has a poor user experience.
[0003] In summary, the problems existing in the prior art need to be solved urgently. Summary of the invention
[0004] The present invention provides an attendance method, device, equipment and storage medium based on face recognition, which are used to solve the defects in the prior art and realize personnel attendance based on face recognition.
[0005] The present invention provides an attendance method based on face recognition, comprising:
[0006] Obtain panoramic images through a pan-tilt camera;
[0007] Segmenting the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information;
[0008] Determine the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information;
[0009] According to the scanning angle and the scanning focal length, the image to be identified is acquired by the pan-tilt camera;
[0010] Inputting the image to be recognized into a face recognition model to obtain a face recognition result;
[0011] When the face recognition result is confirmed to be valid, attendance records are made according to the personnel information corresponding to the face recognition result.
[0012] According to an attendance method based on face recognition provided by the present invention, the step of acquiring a panoramic image through a pan-tilt camera specifically includes:
[0013] The original image data is obtained by scanning the PTZ camera according to the preset path;
[0014] Aligning the original image data to the same coordinate system;
[0015] The aligned original image data are seamlessly fused to obtain the panoramic image.
[0016] According to an attendance method based on face recognition provided by the present invention, the step of determining the scanning angle and scanning focal length of the pan-tilt camera according to the coordinate information specifically includes:
[0017] Inputting a plurality of the region images into an image processing model to determine whether the region images contain a face image;
[0018] When the area image includes a face image, coordinate information corresponding to the area image is obtained, and the scanning angle and scanning focal length of the pan-tilt camera are determined according to the coordinate information.
[0019] According to an attendance method based on face recognition provided by the present invention, after the step of inputting the image to be recognized into the face recognition model to obtain the face recognition result, the attendance method further includes:
[0020] Determine a face ratio value according to the face recognition result, wherein the face ratio value is used to represent the ratio of the face image to the region image;
[0021] When the face ratio value is within a preset interval, the face recognition result is confirmed to be valid;
[0022] When the face ratio value is not within the preset interval, the face recognition result is confirmed to be invalid.
[0023] According to an attendance method based on face recognition provided by the present invention, after the step of confirming that the face recognition result is invalid when the face proportion value is not within a preset interval, the attendance method further includes:
[0024] When the face recognition result is confirmed to be invalid, determining the target angle and target focal length according to the face proportion value;
[0025] Acquiring an optimized image through the pan / tilt camera according to the target angle and the target focal length;
[0026] The optimized image is input into the face recognition model to obtain a face recognition result.
[0027] According to a method for attendance based on face recognition provided by the present invention, the step of determining the target angle and the target focal length according to the face proportion value specifically includes:
[0028] Determining the target focal length according to the face ratio value and the target magnification factor;
[0029] The target angle is determined according to the target focal length.
[0030] According to an attendance method based on face recognition provided by the present invention, the specific manner of determining the target angle according to the target focal length is as follows:
[0031]
[0032]
[0033]
[0034]
[0035]
[0036] in, is the target horizontal focal length, is the target vertical focal length, f current is the current focal length, is the target horizontal magnification, is the target vertical magnification, f new is the target focal length, W is the width of the panoramic image, H is the height of the panoramic image, and the coordinates of the center point of the image to be identified are P ( x center , y center ), θ pan is the target horizontal angle, θ tilt is the target vertical angle.
[0037] The present invention also provides an attendance device based on face recognition, comprising:
[0038] A panoramic image module is used to obtain panoramic images through a pan-tilt camera;
[0039] An image segmentation module, used for segmenting the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information;
[0040] A parameter determination module, used to determine the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information;
[0041] An image recognition module, used for acquiring an image to be recognized through the pan-tilt camera according to the scanning angle and the scanning focal length;
[0042] A face recognition module, used to input the image to be recognized into a face recognition model to obtain a face recognition result;
[0043] The personnel attendance module is used to record attendance according to the personnel information corresponding to the face recognition result when the face recognition result is confirmed to be valid.
[0044] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the attendance method based on face recognition as described above is implemented.
[0045] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the attendance method based on face recognition as described in any one of the above is implemented.
[0046] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned attendance methods based on face recognition.
[0047] The attendance method, device, equipment and storage medium based on face recognition provided by the present invention obtain a panoramic image through a pan-tilt camera; divide the panoramic image to obtain a plurality of regional images, and the regional images include coordinate information; determine the scanning angle and scanning focal length of the pan-tilt camera according to the coordinate information; obtain the image to be recognized through the pan-tilt camera according to the scanning angle and the scanning focal length; input the image to be recognized into the face recognition model to obtain the face recognition result; when the face recognition result is confirmed to be valid, the attendance record is made according to the personnel information corresponding to the face recognition result. The present invention can ensure image clarity while covering a larger range by scanning in different areas and adjusting the focal length, thereby improving the accuracy and efficiency of face recognition, and does not require the attendance personnel to go to the designated location for attendance, the system automatically completes the regional scanning and recognition, and the user experience is better. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 It is a flow chart of the attendance method based on face recognition provided by the present invention;
[0050] Figure 2 It is a structural schematic diagram of the attendance device based on face recognition provided by the present invention;
[0051] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0053] In the application of face recognition technology, the popularity of panoramic cameras has provided convenience for large-scale monitoring. However, the existing solutions for capturing and enlarging panoramic images for face recognition have many problems, which are mainly manifested in the following aspects:
[0054] 1. High camera definition required
[0055] In order to obtain clear facial images in large-scale monitoring scenarios, existing solutions usually require high-resolution cameras. This not only increases the cost of equipment, but also places higher requirements on network bandwidth and storage capacity. In addition, even with high-resolution cameras, it is still difficult to capture clear facial images in some cases (such as insufficient lighting or fast-moving targets), thus affecting the accuracy of recognition.
[0056] 2. Details are hard to capture
[0057] In large-scale surveillance scenarios, the size of human faces in the panoramic image is usually small. Although the image can be enlarged through digital magnification technology, this often leads to a decrease in image quality, blurred details, and difficulty in ensuring the accuracy of face recognition. Especially in dense crowds, the faces of adjacent people in the image may overlap, further increasing the difficulty of recognition.
[0058] 3. Complicated operation and poor user experience
[0059] Some existing face recognition solutions require people who need to check attendance to go to a designated location for attendance, which is cumbersome and inefficient. In addition, attendance personnel need to remember specific locations and operation procedures, which increases the difficulty of use and reduces user experience. For large enterprises or public places, this method is difficult to promote and apply on a large scale.
[0060] 4. Poor adaptability to dynamic environment
[0061] Most existing solutions have poor adaptability when facing dynamic environments (such as light changes and personnel flow). The fixed viewing angle and fixed focal length of the camera limit the flexibility of the system, and it is impossible to adjust the monitoring area and focal length in real time to adapt to the changing environment and targets.
[0062] 5. High maintenance cost
[0063] High-resolution cameras and complex operating procedures not only increase the initial construction cost of the system, but also increase the subsequent maintenance cost. Professionals are required to install, debug and maintain the equipment, which increases the operational burden of the enterprise. In addition, the high complexity of the system may also lead to a higher failure rate, affecting the reliability and stability of the system.
[0064] In order to solve the problems in the prior art, the present invention proposes an attendance method based on face recognition to realize personnel attendance based on face recognition. The attendance method based on face recognition is described below. Figure 1 As shown, including but not limited to the following steps:
[0065] Step 110: Acquire a panoramic image through a pan-tilt camera.
[0066] Specifically, select a PTZ camera with appropriate resolution and focal length to ensure that it can cover the preset monitoring area. Install the PTZ camera in an appropriate position and set its initial shooting angle and position. Set the angle of each rotation and the speed of movement of the PTZ camera during the scanning process to ensure that the entire monitoring area is covered and avoid omissions. The control module drives the PTZ camera to collect images in segments along the preset path. At each predetermined position, the camera stops and takes an image. Set a reasonable collection interval to ensure that there is a certain overlapping area between each image for subsequent image stitching. Crop the stitched image to remove the excess parts at the edges to generate the final panoramic image.
[0067] Step 120: Segment the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information.
[0068] In step 120, the panoramic image generated in step 110 is imported into the image processing module to prepare for the segmentation operation. The parameters of image segmentation, including the size of each regional image, the number of rows and columns for segmentation, etc., are set to ensure that the segmented regional image covers the entire panoramic image. According to the preset segmentation parameters, the panoramic image is divided into several rectangular areas. A fixed-size window can be used for segmentation, or the window size can be dynamically adjusted according to actual needs. For each divided area, the corresponding image data is extracted to generate several regional images. For each regional image, its coordinate information in the panoramic image is calculated, including the upper left corner coordinates and the lower right corner coordinates. The coordinate information can be expressed in pixel values. The calculated coordinate information is attached to the corresponding regional image to ensure that each regional image contains its position information in the panoramic image.
[0069] Step 130: Determine the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information.
[0070] In step 130, the regional images segmented in step 120 and their corresponding coordinate information are read. Each regional image contains its center coordinate information in the panoramic image. The scanning angles and scanning focal lengths corresponding to different coordinate regions are pre-stored in the database. The database table structure includes fields such as coordinate region, horizontal scanning angle, vertical scanning angle, and focal length. According to actual monitoring requirements and performance parameters of the PTZ camera, the scanning angles and focal lengths corresponding to different coordinate regions are pre-calculated and stored. These data can be generated by actual testing or simulation calculation. According to the coordinate information of the regional image, the matching records are searched in the database, that is, the matching scanning angle and focal length information are obtained from the database.
[0071] Step 140: acquiring the image to be recognized through the pan-tilt camera according to the scanning angle and the scanning focal length.
[0072] In step 140, the control module generates corresponding control instructions according to the scanning angle and scanning focal length determined in step 130. These instructions include horizontal rotation angle, vertical rotation angle and focal length adjustment parameters. The generated control instructions are sent to the PTZ camera via a wired or wireless network. After receiving the control instructions, the PTZ camera rotates according to the specified horizontal and vertical angles to locate the image to be identified. After the camera is stable, the image acquisition module is started to capture the image to be identified under the current viewing angle. Ensure that the acquired image covers the image to be identified and has sufficient clarity and resolution. The acquired image to be identified is transmitted to the image processing module via the network for further processing.
[0073] Step 150: input the image to be recognized into a face recognition model to obtain a face recognition result.
[0074] In step 150, a face detection algorithm is used to locate the face region in the image and generate a face bounding box. A pre-trained face detection model, such as MTCNN (Multi-task Cascaded Convolutional Networks) or other efficient detection algorithms can be used. According to the detected face bounding box, the image is cropped to retain only the face region to reduce background interference and improve recognition accuracy. Next, a pre-trained face recognition model is loaded. Common models include FaceNet, VGG-Face, ResNet, etc., which can generate high-dimensional face feature vectors. The cropped face image is input into the face recognition model to extract the face feature vector. The feature vector is a representation of the face in the feature space, which is used for subsequent recognition and matching. The extracted face feature vector is matched with the known face feature vector stored in the database. Similarity calculation can be performed using metrics such as Euclidean distance and cosine similarity. According to the feature matching results, the identity of the face in the image to be recognized is determined. If the similarity is higher than the preset threshold, the match is considered successful and the recognition result is obtained; otherwise, the match is considered failed.
[0075] Step 160: When the face recognition result is confirmed to be valid, attendance records are made according to the personnel information corresponding to the face recognition result.
[0076] In step 160, the face recognition result is checked for validity to ensure that the result is accurate. The check includes whether the similarity score is higher than the preset threshold, whether the identified person is on the attendance list, etc. The detailed information of the person corresponding to the recognition result is queried from the personnel information database, including name, work number, department, etc. Check whether the queried personnel information is consistent with the information in the recognition result to ensure that the information is accurate. After it is correct, when the attendance record is generated, the current timestamp is recorded. The timestamp format can include date and specific time, for example 2024-07-10 09:00:00. Then, based on the recognition result and personnel information, an attendance record is generated. The content of the attendance record includes information such as personnel name, work number, department, attendance time, etc.
[0077] Furthermore, the attendance records can be statistically analyzed, including attendance rate, lateness rate, absence rate and other indicators. Monthly, quarterly and annual attendance reports can be generated for management reference. And the attendance data can be linked with other human resources management systems for personnel performance appraisal, salary calculation and other applications to improve the efficiency and accuracy of human resources management.
[0078] As a further optional embodiment, the step of acquiring a panoramic image by using a pan / tilt camera specifically includes:
[0079] The original image data is obtained by scanning the PTZ camera according to the preset path;
[0080] Aligning the original image data to the same coordinate system;
[0081] The aligned original image data are seamlessly fused to obtain the panoramic image.
[0082] In this embodiment, the scanning path of the PTZ camera can be pre-set in the system. Path planning includes the scanning range and step angle in the horizontal and vertical directions to cover the entire monitoring area, so as to obtain the original image data. Subsequently, a unified coordinate system is defined as the alignment reference for all original image data. The center of the panoramic image is usually selected as the origin, and a standard Cartesian coordinate system is used. Each original image is geometrically corrected and projected to align it to the same coordinate system. Image processing algorithms such as perspective transform and image stitching can be used to transform and align the images. Feature points are detected between adjacent original images. Commonly used methods include SIFT (Scale-Invariant Feature Transform), SURF (Speeded-Up Robust Features), etc. Using a matching algorithm, the feature points in adjacent images are paired to determine the overlapping area between the images. Using an image stitching algorithm, the aligned original images are seamlessly merged. Commonly used methods include weighted averaging and multi-band blending to eliminate stitching gaps and color differences. In the overlapping area, adjacent images are fused to ensure the brightness and color consistency of the images and generate a seamless panoramic image. All aligned and fused image data are synthesized into a complete panoramic image. Ensure that the various parts of the panoramic image are seamlessly connected, and the image is clear and detailed.
[0083] As a further optional embodiment, the step of determining the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information specifically includes:
[0084] Inputting a plurality of the region images into an image processing model to determine whether the region images contain a face image;
[0085] When the area image includes a face image, coordinate information corresponding to the area image is obtained, and the scanning angle and scanning focal length of the pan-tilt camera are determined according to the coordinate information.
[0086] In this embodiment, a pre-trained face detection model is loaded, and commonly used models include Haar Cascade, MTCNN (Multi-task Cascaded Convolutional Networks), YOLO (You Only Look Once), etc. The model is used to extract features from the regional image to extract feature areas that may contain faces. The pre-processed regional image is input into the face detection model to perform face detection. The model will output the detection results, including the face bounding box and its confidence score. The regional images containing faces are screened out according to the confidence score, and images with low confidence or no face detected are removed. The coordinate information of the regional image containing the face is extracted and mapped to the unified coordinate system of the panoramic image. The specific position of the regional image in the panoramic image is calibrated to determine the adjustment parameters of the pan-tilt camera. According to the extracted coordinate information, the corresponding scanning angle and scanning focal length are searched in a pre-set database. The database stores the corresponding relationship between different positions of the panoramic image and the angle and focal length of the pan-tilt camera. The corresponding scanning angle and scanning focal length parameters are obtained from the database as a basis for subsequent adjustment of the pan-tilt camera. According to the acquired scanning angle and focal length parameters, a control instruction is generated, including horizontal rotation angle, vertical rotation angle and focal length adjustment parameters.
[0087] As a further optional embodiment, after the step of inputting the image to be recognized into the face recognition model to obtain the face recognition result, the attendance method further includes:
[0088] Determine a face ratio value according to the face recognition result, wherein the face ratio value is used to represent the ratio of the face image to the region image;
[0089] When the face ratio value is within a preset interval, the face recognition result is confirmed to be valid;
[0090] When the face ratio value is not within the preset interval, the face recognition result is confirmed to be invalid.
[0091] As a further optional embodiment, after the step of confirming that the face recognition result is invalid when the face ratio value is not within a preset interval, the attendance method further includes:
[0092] When the face recognition result is confirmed to be invalid, determining the target angle and target focal length according to the face proportion value;
[0093] Acquiring an optimized image through the pan / tilt camera according to the target angle and the target focal length;
[0094] The optimized image is input into the face recognition model to obtain a face recognition result.
[0095] In this embodiment, the validity of the face recognition result needs to be determined based on the face ratio value. The position information and size of the face bounding box are obtained from the output result of the face recognition model. The bounding box defines the position and size of the face in the image to be recognized. The overall size of the image to be recognized, such as width and height, is obtained to calculate the ratio value. The face ratio value is calculated using the formula: face ratio value = face bounding box area / regional image area. According to actual application requirements, a reasonable interval range of the face ratio value is set. For example, the reasonable interval of the face ratio value is set to [0.1, 0.3], indicating that the face ratio in the image should be between 10% and 30%. It is determined whether the calculated face ratio value falls within the preset interval. When the face ratio value is within the preset interval, the face recognition result is confirmed to be valid; otherwise, the face recognition result is confirmed to be invalid. If the face ratio value is not within the preset interval, the system can readjust the angle and focal length of the pan-tilt camera to obtain an image to be recognized that meets the requirements. The re-acquired image to be recognized is input into the face recognition model again for secondary recognition, and the face ratio value is calculated again for verification.
[0096] As a further optional embodiment, the step of determining the target angle and the target focal length according to the face proportion value specifically includes:
[0097] Determining the target focal length according to the face ratio value and the target magnification factor;
[0098] The target angle is determined according to the target focal length.
[0099] As a further optional embodiment, the specific manner of determining the target angle according to the target focal length is as follows:
[0100]
[0101]
[0102]
[0103]
[0104]
[0105] in, is the target horizontal focal length, is the target vertical focal length, f current is the current focal length, is the target horizontal magnification, is the target vertical magnification, f newis the target focal length, W is the width of the panoramic image, H is the height of the panoramic image, and the coordinates of the center point of the image to be identified are P ( x center , y center ), θ pan is the target horizontal angle, θ tilt is the target vertical angle.
[0106] In this embodiment, it is first necessary to determine the current horizontal magnification and vertical magnification, which can be obtained by the width ratio and height ratio of the panoramic image and the image to be identified. Then, according to the current horizontal magnification and vertical magnification, the target horizontal magnification and target vertical magnification can be determined. The target horizontal focal length and target vertical focal length can be determined by the target horizontal magnification and target vertical magnification. Then take the larger value in the horizontal direction and the vertical direction to ensure that the magnification requirements can be met in both directions. Then, the target horizontal angle and the target vertical angle are determined by the following formula:
[0107]
[0108]
[0109] in, is the target horizontal focal length, is the target vertical focal length, f current is the current focal length, is the target horizontal magnification, is the target vertical magnification, f new is the target focal length, W is the width of the panoramic image, H is the height of the panoramic image, and the coordinates of the center point of the image to be identified are P ( x center , y center ), θ pan is the target horizontal angle, θ tilt is the target vertical angle.
[0110] The attendance device based on face recognition provided by the present invention is described below. As shown in FIG. x, the attendance device based on face recognition described below and the attendance method based on face recognition described above can be referred to each other.
[0111] An attendance device based on face recognition, comprising:
[0112] A panoramic image module 210 is used to obtain a panoramic image through a pan-tilt camera;
[0113] An image segmentation module 220 is used to segment the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information;
[0114] A parameter determination module 230, for determining a scanning angle and a scanning focal length of the pan / tilt camera according to the coordinate information;
[0115] An image recognition module 240 is used to obtain an image to be recognized through the PTZ camera according to the scanning angle and the scanning focal length;
[0116] The face recognition module 250 is used to input the image to be recognized into the face recognition model to obtain the face recognition result;
[0117] The personnel attendance module 260 is used to record attendance according to the personnel information corresponding to the face recognition result when the face recognition result is confirmed to be valid.
[0118] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communications interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the attendance method based on face recognition, and the method includes:
[0119] Obtain panoramic images through a pan-tilt camera;
[0120] Segmenting the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information;
[0121] Determine the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information;
[0122] According to the scanning angle and the scanning focal length, the image to be identified is acquired by the pan-tilt camera;
[0123] Inputting the image to be recognized into a face recognition model to obtain a face recognition result;
[0124] When the face recognition result is confirmed to be valid, attendance records are made according to the personnel information corresponding to the face recognition result.
[0125] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0126] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the attendance method based on face recognition provided by the above methods, the method includes:
[0127] Obtain panoramic images through a pan-tilt camera;
[0128] Segmenting the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information;
[0129] Determine the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information;
[0130] According to the scanning angle and the scanning focal length, the image to be identified is acquired by the pan-tilt camera;
[0131] Inputting the image to be recognized into a face recognition model to obtain a face recognition result;
[0132] When the face recognition result is confirmed to be valid, attendance records are made according to the personnel information corresponding to the face recognition result.
[0133] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the attendance method based on face recognition provided by the above methods, the method comprising:
[0134] Obtain panoramic images through a pan-tilt camera;
[0135] Segmenting the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information;
[0136] Determine the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information;
[0137] According to the scanning angle and the scanning focal length, the image to be identified is acquired by the pan-tilt camera;
[0138] Inputting the image to be recognized into a face recognition model to obtain a face recognition result;
[0139] When the face recognition result is confirmed to be valid, attendance records are made according to the personnel information corresponding to the face recognition result.
[0140] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0141] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for attendance based on face recognition, characterized in that: include: Obtain panoramic images through a pan-tilt camera; Segmenting the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information; Determine the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information; According to the scanning angle and the scanning focal length, the image to be identified is acquired by the pan-tilt camera; Inputting the image to be recognized into a face recognition model to obtain a face recognition result; When the face recognition result is confirmed to be valid, attendance record is performed according to the personnel information corresponding to the face recognition result; The step of determining the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information specifically includes: Inputting a plurality of the region images into an image processing model to determine whether the region images contain a face image; When the regional image contains a face image, obtaining coordinate information corresponding to the regional image, and determining the scanning angle and scanning focal length of the pan-tilt camera according to the coordinate information; After the step of inputting the image to be recognized into the face recognition model to obtain the face recognition result, the attendance method further includes: Determine a face ratio value according to the face recognition result, wherein the face ratio value is used to represent the ratio of the face image to the region image; When the face ratio value is within a preset interval, the face recognition result is confirmed to be valid; When the face ratio value is not within the preset interval, the face recognition result is confirmed to be invalid; After the step of confirming that the face recognition result is invalid when the face ratio value is not within the preset interval, the attendance method further includes: When the face recognition result is confirmed to be invalid, determining the target angle and target focal length according to the face proportion value; Acquiring an optimized image through the pan / tilt camera according to the target angle and the target focal length; Inputting the optimized image into the face recognition model to obtain a face recognition result; The step of determining the target angle and the target focal length according to the face proportion value specifically includes: Determining the target focal length according to the face ratio value and the target magnification factor; Determining the target angle according to the target focal length; The specific method of determining the target angle according to the target focal length is as follows: in, is the target horizontal focal length, is the target vertical focal length, f current is the current focal length, is the target horizontal magnification, is the target vertical magnification, f new is the target focal length, W is the width of the panoramic image, H is the height of the panoramic image, and the coordinates of the center point of the image to be identified are P ( x center , y center ), θ pan is the target horizontal angle, θ tilt is the target vertical angle.
2. The attendance method based on face recognition according to claim 1 is characterized in that: The step of obtaining a panoramic image through a pan-tilt camera specifically includes: The original image data is obtained by scanning the PTZ camera according to the preset path; Aligning the original image data to the same coordinate system; The aligned original image data are seamlessly fused to obtain the panoramic image.
3. An attendance device based on face recognition, characterized in that: include: A panoramic image module is used to obtain panoramic images through a pan-tilt camera; An image segmentation module, used for segmenting the panoramic image to obtain a plurality of regional images, wherein the regional images include coordinate information; A parameter determination module, used to determine the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information; An image recognition module, used for acquiring an image to be recognized through the pan-tilt camera according to the scanning angle and the scanning focal length; A face recognition module, used to input the image to be recognized into a face recognition model to obtain a face recognition result; A personnel attendance module, which is used to record attendance according to the personnel information corresponding to the face recognition result when the face recognition result is confirmed to be valid; The step of determining the scanning angle and scanning focal length of the pan / tilt camera according to the coordinate information specifically includes: Inputting a plurality of the region images into an image processing model to determine whether the region images contain a face image; When the regional image contains a face image, obtaining coordinate information corresponding to the regional image, and determining the scanning angle and scanning focal length of the pan-tilt camera according to the coordinate information; After the step of inputting the image to be recognized into the face recognition model to obtain the face recognition result, the attendance method further includes: Determine a face ratio value according to the face recognition result, wherein the face ratio value is used to represent the ratio of the face image to the region image; When the face ratio value is within a preset interval, the face recognition result is confirmed to be valid; When the face ratio value is not within the preset interval, the face recognition result is confirmed to be invalid; After the step of confirming that the face recognition result is invalid when the face ratio value is not within the preset interval, the attendance method further includes: When the face recognition result is confirmed to be invalid, determining the target angle and target focal length according to the face proportion value; Acquiring an optimized image through the pan / tilt camera according to the target angle and the target focal length; Inputting the optimized image into the face recognition model to obtain a face recognition result; The step of determining the target angle and the target focal length according to the face proportion value specifically includes: Determining the target focal length according to the face ratio value and the target magnification factor; Determining the target angle according to the target focal length; The specific method of determining the target angle according to the target focal length is as follows: in, is the target horizontal focal length, is the target vertical focal length, f current is the current focal length, is the target horizontal magnification, is the target vertical magnification, f new is the target focal length, W is the width of the panoramic image, H is the height of the panoramic image, and the coordinates of the center point of the image to be identified are P ( x center , y center ), θ pan is the target horizontal angle, θ tilt is the target vertical angle.
4. An electronic 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 program, the attendance method based on face recognition as described in any one of claims 1 to 2 is implemented.
5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the attendance method based on face recognition as claimed in any one of claims 1 to 2 is implemented.
Citation Information
Patent Citations
Video monitoring method, video monitoring apparatus, and video monitoring system
CN104125427A
Attendance checking method, system based on side face multi-feature fusion face recognition and device and medium
CN110852703A