Pedestrian tracking and positioning method and device based on face recognition

By judging the usage scenario in face recognition technology and obtaining the corresponding video source, combined with the location information of multiple cameras and GPS chips, the problem of inaccurate positioning in complex scenes is solved, and efficient face recognition and pedestrian tracking and positioning are achieved.

CN117292419BActive Publication Date: 2024-10-11XIAMEN JINGFENG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311055106.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-21
Publication Date
2024-10-11
Estimated Expiration
2043-08-21

AI Technical Summary

Technical Problem

Existing face recognition technology can easily lead to inaccurate positioning in complex scenes, leading to inaccurate tracking results.

Method used

By obtaining the face recognition usage scenario, determine whether it is a static or dynamic recognition mode, obtain static or real-time dynamic video sources for face recognition, and perform pedestrian tracking and positioning based on the recognition results, using multiple cameras and GPS chips to collect location information. Real-time positioning.

Benefits of technology

It improves the flexibility of face recognition and tracking and positioning efficiency, and is suitable for security monitoring, identity verification, personnel management and other fields, ensuring the accuracy and efficiency of positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117292419B_ABST
    Figure CN117292419B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of face recognition technology, and relates to a pedestrian tracking and positioning method and device based on face recognition, the method comprising: S1, obtaining a face recognition usage scenario, the usage scenario comprising a static recognition mode and a dynamic recognition mode; S2, judging whether the usage scenario is a static recognition mode according to the usage scenario, if so, obtaining a static video source, and performing face recognition on the static video source, otherwise entering S3; S3, judging whether the usage scenario is a dynamic recognition mode according to the usage scenario, if so, obtaining a real-time dynamic video source, and performing face recognition on the real-time dynamic video source; S4, performing pedestrian tracking and positioning according to the face recognition result. It can perform face recognition according to the actual usage scenario, is flexible and convenient, and has high tracking and positioning efficiency, and can be widely used in security monitoring, identity authentication, personnel management and other fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of face recognition technology, and in particular to a pedestrian tracking and positioning method and device based on face recognition. Background Art

[0002] In modern society, security issues have attracted much attention. With the continuous advancement of science and technology, face recognition technology has been widely used in various fields, such as security monitoring, identity authentication, personnel management, etc. Face recognition technology can accurately identify the identity of a person by comparing the recorded face image with the face image collected on site. Using this technology in the fields of police, national defense, finance, etc. can greatly improve security and prevent the intrusion of criminals. With the development of society, the scale of personnel is getting larger and larger. The traditional manual verification method requires a lot of time and manpower, and is inefficient. Face recognition technology can quickly complete the verification work, save a lot of time and labor costs, and improve work efficiency. Modern consumers pay great attention to convenience and efficiency. Face recognition technology allows consumers to directly carry out various consumption activities such as shopping, checking in, dining, etc. without manually verifying their identity, improving user experience and increasing customer stickiness. Face recognition technology can also be used as a means to deal with emergencies. For example, when emergencies such as fires and earthquakes occur, the recognition of face images can help rescuers quickly find trapped people and save their lives.

[0003] Although technologies such as face recognition and positioning play a big role in today's society, they are usually used for one scenario, such as face recognition and positioning for video surveillance. When the usage scenario is complex, inaccurate positioning is prone to occur, which will result in inaccurate tracking results. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to propose a pedestrian tracking and positioning method and device based on face recognition to solve the problem in the prior art that face recognition positioning is usually performed on one scenario, such as video surveillance. When the usage scenario is complex, inaccurate positioning is prone to occur, which will result in inaccurate tracking results.

[0005] In order to solve the above technical problems, on the one hand, the present invention provides a pedestrian tracking and positioning method based on face recognition, which adopts the following technical solution, including:

[0006] S1. Obtaining a face recognition usage scenario, where the usage scenario includes a static recognition mode and a dynamic recognition mode;

[0007] S2. According to the usage scenario, determine whether the usage scenario is a static recognition mode. If yes, obtain a static video source and perform face recognition on the static video source. Otherwise, proceed to S3.

[0008] S3. According to the usage scenario, determine whether the usage scenario is a dynamic recognition mode, and if so, obtain a real-time dynamic video source and perform face recognition on the real-time dynamic video source;

[0009] S4. Pedestrian tracking and positioning is performed based on the face recognition results.

[0010] Preferably, the step of obtaining a face recognition usage scenario in S1, wherein the usage scenario includes a static recognition mode and a dynamic recognition mode, specifically comprises:

[0011] Get the face recognition usage scenario configuration file;

[0012] The configuration file is parsed to obtain the usage scenario.

[0013] Preferably, the step of S2, judging whether the usage scenario is a static recognition mode according to the usage scenario, if yes, obtaining a static video source, and performing face recognition on the static video source, otherwise entering S3 specifically includes:

[0014] Determining whether the usage scenario is the static recognition mode;

[0015] If the usage scenario is the static recognition mode, a static video source is obtained;

[0016] According to the static video source, capturing multiple consecutive frames of images to obtain recording position information;

[0017] Filter non-face images from multiple consecutive image frames and retain face images;

[0018] Perform face recognition on the face image to obtain face features, otherwise go to S3.

[0019] Preferably, the step of determining whether the usage scenario is a dynamic recognition mode according to the usage scenario, and if so, obtaining a real-time dynamic video source, and performing face recognition on the real-time dynamic video source specifically includes:

[0020] Determining whether the usage scenario is the dynamic recognition mode;

[0021] The usage scenario is the dynamic recognition mode, and multiple cameras are used to simultaneously collect real-time dynamic video streams of different areas. Multiple cameras have built-in GPS chips, and the GPS chips are used to collect location information and transmit it back to the cameras;

[0022] According to the real-time dynamic video stream, multiple frames of images are captured, each frame of image information carries position information;

[0023] Filter non-face images from multiple consecutive frames and retain face images;

[0024] Perform face recognition on the face image and fuse the face features, pedestrian features and location information.

[0025] Preferably, the step of performing pedestrian tracking and positioning according to the face recognition result in S4 specifically includes:

[0026] According to the face recognition result, a database matching the face features with the position information is established, the face features are numbered, and a face feature ID is generated;

[0027] According to the database, the same facial feature ID is tracked and located.

[0028] Preferably, the step of filtering non-face images from the continuous multiple frames of images and retaining face images comprises:

[0029] Extracting Haar-like feature values ​​of the continuous multi-frame images;

[0030] Submit the haar-like feature value to the adaboost algorithm;

[0031] The adaboost algorithm is used to determine whether the current frame image is a face image. Otherwise, the current frame image is filtered out and the face image is retained.

[0032] Preferably, after the step of tracking and locating pedestrians according to the face recognition result in S4, the method further includes:

[0033] S5. Output pedestrian tracking and positioning results.

[0034] In order to solve the above technical problems, the present invention also provides a pedestrian tracking and positioning device based on face recognition, which adopts the following technical solution, including:

[0035] An acquisition module is used to acquire face recognition usage scenarios, including static recognition mode and dynamic recognition mode;

[0036] A first face recognition module is used to determine whether the usage scenario is a static recognition mode according to the usage scenario, and if so, obtain a static video source and perform face recognition on the static video source;

[0037] A second face recognition module is used to determine whether the usage scenario is a dynamic recognition mode according to the usage scenario, and if so, obtain a real-time dynamic video source and perform face recognition on the real-time dynamic video source;

[0038] The tracking and positioning module is used to track and position pedestrians based on the face recognition results.

[0039] Preferably, the acquisition module includes:

[0040] Configuration module, used to obtain face recognition usage scenario configuration file;

[0041] The parsing module is used to parse the configuration file and obtain the usage scenario.

[0042] Preferably, the first face recognition module includes:

[0043] A first judgment module, used to judge whether the usage scenario is the static recognition mode;

[0044] A static video source acquisition module is used to acquire a static video source when the usage scenario is the static recognition mode;

[0045] A position information acquisition module, used to capture multiple consecutive frames of images according to the static video source to obtain recording position information;

[0046] A first filtering module, used for filtering non-face images from the continuous multi-frame image graph and retaining face images;

[0047] The first feature extraction module is used to perform face recognition on the face image to obtain face features.

[0048] Compared with the prior art, the present invention mainly has the following beneficial effects: first, by obtaining the usage scenario of face recognition, the usage scenario includes static recognition mode and dynamic recognition mode; if it is static recognition mode, a static video source is obtained, and face recognition is performed on the static video source; if it is dynamic recognition mode, a real-time dynamic video source is obtained, and face recognition is performed on the real-time dynamic video source, and then pedestrian tracking and positioning is performed according to the face recognition result; face recognition is performed according to the actual usage scenario, which is flexible and convenient, and the tracking and positioning efficiency is high, and it can be widely applied to security monitoring, identity authentication, personnel management and other fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the scheme in the present invention, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present invention. 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 any creative work.

[0050] Figure 1 is an exemplary system architecture diagram in which the present invention can be applied;

[0051] Figure 2 is a flow chart of an embodiment of a pedestrian tracking and positioning method based on face recognition of the present invention;

[0052] Figure 3It is a structural schematic diagram of an embodiment of a pedestrian tracking and positioning device based on face recognition of the present invention;

[0053] Figure 4 It is a schematic structural diagram of an embodiment of a computer device of the present invention. DETAILED DESCRIPTION

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present invention; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present invention or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0055] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0056] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings.

[0057] like Figure 1 As shown, the system architecture 100 may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0058] The user can use the first terminal device 101, the second terminal device 102 or the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0059] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.

[0060] The server 105 may be a server that provides various services, for example, a background server that provides support for pages displayed on the first terminal device 101 , the second terminal device 102 , and the third terminal device 103 .

[0061] It should be noted that the pedestrian tracking and positioning method based on face recognition provided in the embodiment of the present invention is generally executed by a server / terminal device, and accordingly, the pedestrian tracking and positioning device based on face recognition is generally arranged in the server / terminal device.

[0062] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0063] Embodiment 1

[0064] Continue to refer Figure 2 , shows a flow chart of an embodiment of a pedestrian tracking and positioning method based on face recognition of the present invention. The pedestrian tracking and positioning method based on face recognition comprises the following steps:

[0065] Step S1, obtaining face recognition usage scenarios, where the usage scenarios include static recognition mode and dynamic recognition mode.

[0066] In this embodiment, the pedestrian tracking and positioning method based on face recognition is executed on an electronic device (eg Figure 1 The server / terminal device shown in the figure can receive the pedestrian tracking and positioning request based on face recognition through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAXX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0067] In this embodiment, step S1 further includes the steps of:

[0068] S11. Obtain a face recognition usage scenario configuration file.

[0069] Face recognition can be used in the security field, such as face recognition access control system, face payment, etc.; social media and user experience, such as face recognition albums, face filters, etc.; retail and advertising, to achieve customer identification and behavior analysis; it is also widely used in the medical field; it can also be used in the education field, such as attendance systems; automation and intelligent interaction, such as intelligent transportation. In general, it can be divided into real-time face recognition tracking and positioning and face recognition tracking and positioning based on surveillance video. In this embodiment, the scene using face recognition is stored in a file, for example, the file format can be txt, xml, etc.

[0070] S12. Parse the configuration file to obtain the usage scenario.

[0071] According to the format in which the usage scenario configuration file is stored, the usage scenario configuration file is read to obtain the specific scenario mode currently being used for face recognition, tracking and positioning.

[0072] Step S2, judging whether the usage scenario is a static recognition mode according to the usage scenario, if yes, obtaining a static video source and performing face recognition on the static video source, otherwise entering S3.

[0073] In this embodiment, the face recognition usage scenarios are divided into two types. One is the static recognition mode, that is, face recognition tracking and positioning of portraits in existing surveillance videos, that is, static video sources, and historical positioning of pedestrians, which is of great significance to public security work such as criminal case investigation, public security management and control, and traffic management.

[0074] In this embodiment, step S2 further includes the steps of:

[0075] S21. Determine whether the usage scenario is a static recognition mode.

[0076] According to the usage scenario configuration file, the usage scenario value is read and it is determined whether the usage scenario value is a static recognition mode, if yes, step S22 is executed, otherwise step S3 is executed.

[0077] S22: If the usage scenario is a static recognition mode, a static video source is obtained.

[0078] When it is determined that the usage scenario is a static recognition mode, an online or offline static video source is obtained through a network, or an offline static video source is obtained through a storage device. The static video source can be one or more recorded video streams.

[0079] S23. According to the static video source, capture multiple consecutive frames of images to obtain recording position information.

[0080] By comparing and searching the background, architecture, scenery and other elements in multiple consecutive frames, similar recording location information can be found to determine the shooting location. Geographical signs in the image can also be used: such as street names, trademarks, landmark buildings, etc., which can be used to locate on the map and determine the recording location information. Video screenshots or key frames can also be uploaded to search engines, such as Google or Baidu Image Search, and Google or Baidu Images can find similar images and related information through image recognition technology to infer the recording location information. Video screenshots can also be uploaded to social media platforms, such as Instagram, Facebook, etc., and posts and information related to the video shooting location can be found through tags or geographic location searches to determine the recording location information. Then the location information of pedestrians in this static video source is obtained.

[0081] S24, filtering non-face images from the continuous multi-frame image graph and retaining face images.

[0082] Extract the Haar-like feature values ​​of multiple consecutive frames of images, and then give the Haar-like feature values ​​to the Adaboost algorithm; the Adaboost algorithm determines whether the current frame image is a face image, otherwise the current frame image is filtered out and the face image is retained.

[0083] First, filtering out non-face images can save a lot of computational cost.

[0084] S25, perform face recognition on the face image to obtain face features, otherwise go to S3.

[0085] First, use image processing technology to determine the facial contours and feature points in the image, and then extract the features of the face, such as eyes, nose, mouth, hair, etc. Then, use machine learning technology to convert these features into feature vectors as the basis for feature comparison.

[0086] Secondly, feature comparison is performed, which is an important step in realizing face recognition. In this step, the collected face feature vector is compared with the face feature vector in the database to determine whether they are the same person. Generally speaking, the result of feature comparison is a similarity value, based on which it can be determined whether they are the same person.

[0087] Then, a decision is made, which is the last step in realizing face recognition security. In this step, a judgment is made based on the result of feature comparison to determine whether it is the same person. Generally speaking, when the feature comparison result reaches a certain threshold, it can be judged as the same person.

[0088] A two-dimensional face image of size M*N can be viewed as a face image column vector of length MN. In order to convert a two-dimensional face image into a column vector, the size of the face image is first calculated, then the face image is transposed by row, and finally all grayscale values ​​are taken out by column to form a one-dimensional vector of size MN. In fact, the effect of the whole stage is equivalent to taking out the grayscale values ​​of the image by row and connecting them into a one-dimensional image vector, thereby generating a matrix T composed of one-dimensional image vectors.

[0089] Normalize the image matrix T and then calculate the eigenfaces. First, calculate the mean value m of the one-dimensional column vector in the image matrix, and then subtract the mean value from each column of the image matrix to form a normalized image matrix A.

[0090] The covariance matrix of the face training image is C = AA T , where the face training samples are A = [Φ1, ..., Φ P ], the dimension is M×N×P, then the dimension of the covariance matrix C is (MN) 2 Since the dimension of C is too high, it is difficult to calculate its eigenvalues ​​and eigenvectors. The singular value decomposition theorem can be used to solve this problem.

[0091] The singular value decomposition theorem is:

[0092] Assume that B is a matrix of n×m dimensions and rank p, then there are two orthogonal matrices and one diagonal matrix: The orthogonal matrix is:

[0093]

[0094] V = [v1, v2, ..., v p ]∈R m×m (Formula 2),

[0095] in:

[0096] U T U=I (Formula 3),

[0097] V T V=I, (Formula 4),

[0098] The diagonal matrix is:

[0099] ∧=diag[λ1,λ2,...,λ p ]∈R m×m λ1≥λ2...≥λ p (Formula 5),

[0100] Then we can get:

[0101]

[0102] And BB T and B T B have common non-zero eigenvalues, u i and v i BB T and B T B corresponds to the orthogonal eigenvectors of the eigenvalues.

[0103] From the above theorem we can get:

[0104]

[0105] Then the covariance matrix C = AA T , construct the matrix L = A T A∈R m×m , so it is easy to find the eigenvalues ​​and eigenvectors of the construction matrix L, and then according to formula 7, the eigenvalues ​​and eigenvectors of the covariance C can be found.

[0106] In specific implementation, not all eigenvalues ​​and eigenvectors of the covariance are needed, and m (m<M, M is the number of eigenvalues) eigenvalues ​​are sufficient for face recognition. Therefore, only the eigenvectors corresponding to the first m largest eigenvalues ​​of L are used to calculate the eigenface.

[0107] In this embodiment, the matrix L=A is directly constructed. T A∈R m×m , to calculate the eigenvalue of L, then select the L eigenvalue greater than 100 as the eigenvalue of C, and finally calculate its eigenvector through the eigenvalue of C to form the eigenface.

[0108] The face recognition process is divided into two stages: training and testing. In the training stage, the main task is to extract the features of the face images in the database and form a feature library. In the testing stage, the main task is to extract the features of the image to be recognized and calculate the distance measure between the extracted features and the features in the feature library, and output the face image corresponding to the minimum distance measure as the result.

[0109] For example, in the training phase, each column vector in the normalized image matrix A is projected onto the feature subspace to form a feature library. In the testing phase, first assume that the test face image is Y. Before face recognition, it is first standardized, that is, Φ = Y-Ψ. Then, the standardized face image is projected onto the feature subspace to obtain the vector Ω = U T Φ, this embodiment uses the nearest collar classifier Euclidean distance for decision classification. The distance between the test image and each face image is ε k =||RR k ||(k=1, 2, ..., P), and the training image corresponding to the minimum distance is used as the matching image of the test image.

[0110] HoG face detection uses traditional machine learning algorithms, so its performance is relatively high and it can run relatively fast on the CPU. However, it cannot detect faces smaller than 80*80, and the recognition effect is not very good for rotated faces and non-frontal faces, and its accuracy needs to be improved. The face detection algorithm using convolutional neural networks has obvious advantages. It is more accurate and robust than the HoG face detection algorithm, and can also detect faces under occlusion. Even non-frontal and dark pictures can be well detected. However, the corresponding shortcomings of the algorithm are also obvious. The time spent in the detection process is very long and it cannot be run in real time on the CPU. This embodiment uses the BlazeFace face recognition algorithm. BlazeFace is a very lightweight and highly accurate face detector, known as a sub-millisecond face detector.

[0111] The Mediapipe library provides an implementation of this algorithm. The core code is as follows:

[0112] import mediapipe as mp

[0113] #Drawing Tools

[0114] mp_drawing=mp.solutions.drawing_utils

[0115] # Initialize the face detection model

[0116] mp_face_detection=mp.solutions.face_detection

[0117] mp_face_detector=mp_face_detection.

[0118] FaceDetection(min_detection_confidence=0.4)

[0119] results=mp_face_detector.process(imgRGB)

[0120] if results.detections:

[0121] # Face detected by face changing

[0122] for face_no,face in enumerate(resu1ts.detections):

[0123] #Draw the key points of the face

[0124] mp_drawing.draw_detection(image=output_image, detection=face,keypoint_drawing_spec=mp_drawing.DrawingSpec(color=(0,255,0),thic kness=-1,circle_radius=image_width / / 115),bbox_drawing_spec=mp_drawing.DrawingSpec(color=(0,255,0),thickness=image_width / / 180))

[0125] #Draw a face frame

[0126] face_bbox=face.location_data.relative_bounding_box

[0127] x1=int(face_bbox.xmin*image_width)

[0128] y1=int(face_bbox.ymin*image_height)

[0129] cv2.rectangle(output_image,pt1=(x1,y1-image_width / / 20),pt2=(x1+image_width / / 16,y1),color=(0,255,0),thickness=-1)

[0130] As you can see, the BaeFace algorithm can not only detect faces, but also identify the six key points of the face (eyes, nose, ears, and mouth).

[0131] In this embodiment, machine learning can also use the python dlib library to perform face recognition and obtain 68 feature points on the face.

[0132] Step S3, judging whether the usage scenario is a dynamic recognition mode according to the usage scenario, if so, obtaining a real-time dynamic video source, and performing face recognition on the real-time dynamic video source.

[0133] In this embodiment, another scenario for face recognition is dynamic recognition mode, that is, face recognition tracking and positioning for real-time dynamic video sources, which has a very broad application prospect for solving the problem of pedestrian matching under cross-cameras. For example, when a child and his parents are lost in a large public place, the public security officers can use pedestrian re-identification technology to help their parents quickly find the lost child; and after the criminal suspect flees after committing a crime, the public security officers can also use pedestrian re-identification technology to track the criminal suspect's escape path. By detecting and identifying the location and escape path of the target through the system, a lot of arrest time and economic losses are saved for the public security officers. By identifying and tracking the trajectory of human traffickers, accurate rescue routes can be provided for rescue personnel, saving a lot of rescue time and reducing casualties.

[0134] In this embodiment, step S3 further includes the steps of:

[0135] S31. Determine whether the usage scenario is a dynamic recognition mode.

[0136] According to the usage scenario configuration file, the usage scenario value is read and it is determined whether the usage scenario value is a dynamic recognition mode, if yes, step S32 is executed, otherwise the face recognition tracking and positioning process is terminated.

[0137] S32. If the usage scenario is a dynamic recognition mode, multiple cameras are used to simultaneously collect real-time dynamic video streams of different areas. Multiple cameras have built-in GPS chips, which are used to collect location information and transmit it back to the cameras.

[0138] Multiple cameras placed in different areas are connected through the network, and the cameras are ID-numbered and their physical location information is recorded, so as to ensure that the source of the real-time dynamic video stream is accurate.

[0139] When the camera is connected to the power supply, the GPS chip automatically starts working. After the camera is installed, the GPS chip collects GPS signals, stores and records GPS data information, and then transmits the GPS data back to the camera back end through the transmission module. GPS data information includes GGA (position, positioning type), GLL (longitude, latitude), GSA (receiving operation mode, positioning satellite, DOP value), GSV (elevation, azimuth, signal-to-noise ratio), RMC (time, date, speed), etc.

[0140] The GPS chip positioning workflow is as follows: automatically locate and upload information when the power is turned on; when the GPS chip starts working, relocate and upload information at intervals by setting a timer; whenever the positioning information changes, shorten the interval and perform positioning until the positioning information no longer changes, then restore to the original set interval; to prevent the smart camera from losing physical location information due to power outages, set the GPS chip to relocate and update information every time it is powered on.

[0141] S33. According to the real-time dynamic video stream, multiple consecutive frames of images are captured, and each frame of image information carries position information.

[0142] In specific implementation, when performing face recognition tracking and positioning, the camera can be kept in recording mode, and the video stream of the preset period can be stored in advance. For example, the preset period can be 10 minutes or 30 minutes, etc., which can be determined according to actual needs. Then the video stream of the preset period is processed to capture multiple consecutive frames of images. Since the GPS chip collects the location information in real time and transmits it back to the camera, each frame of image information carries the location information. This makes it convenient to track and locate pedestrians.

[0143] The purpose of storing the video stream of the preset time period is to perform face recognition from this video first, and then quickly compare the faces that appear in the following videos. If it is a face that has not appeared in this video, new features are added. If it has already appeared, it is more convenient to track and locate the existing face.

[0144] S34, filtering non-face images from the continuous multiple frame images and retaining face images.

[0145] First, the Haar-like feature values ​​of multiple consecutive frames of images can be extracted; then the Haar-like feature values ​​are given to the Adaboost algorithm; and the Adaboost algorithm determines whether the current frame image is a face image, otherwise the current frame image is filtered out and the face image is retained.

[0146] First, filtering out non-face images can save a lot of computational cost.

[0147] S35, performing face recognition on the face image, and fusing the face features, pedestrian features and location information.

[0148] First, use image processing technology to determine the facial contours and feature points in the image, and then extract the features of the face, such as eyes, nose, mouth, hair, etc. Then, use machine learning technology to convert these features into feature vectors as the basis for feature comparison. You can use the detectMultiScale() function that comes with OpenCV to detect pedestrians and obtain pedestrian features, which is simple to implement.

[0149] Secondly, feature comparison is performed, which is an important step in realizing face recognition. In this step, the collected face feature vector is compared with the face feature vector in the database to determine whether they are the same person. Generally speaking, the result of feature comparison is a similarity value, based on which it can be determined whether they are the same person.

[0150] Then, a decision is made, which is the last step in realizing face recognition security. In this step, a judgment is made based on the result of feature comparison to determine whether it is the same person. Generally speaking, when the feature comparison result reaches a certain threshold, it can be judged as the same person.

[0151] In this embodiment, machine learning uses the python dlib library to perform face recognition and obtain 68 feature points on the face.

[0152] The fusion of pedestrian features, facial features, and location information requires the original data information of the images in the video image library, and the corresponding running of the commonly used face recognition model algorithms such as Eigenfaces, Fisherfaces, LBPH, and convolutional neural network (CNN) on the original video image data to extract the discriminative visual features unique to each model. Although pedestrian and facial features are different, the fusion application can create a table to describe the same target feature and store pedestrian features and facial features together. Whether it is pedestrian features or facial features, they are all in high-dimensional encoding when the model is output, that is, in the form of a matrix. Before being stored in the database, type conversion is required, otherwise it cannot be stored in the database.

[0153] Step S4: tracking and locating pedestrians based on the face recognition results.

[0154] In this embodiment, step S4 further includes the steps of:

[0155] S41. According to the face recognition result, a database matching the face features with the position information is established, the face features are numbered, and a face feature ID is generated.

[0156] This embodiment first converts the high-dimensional encoding in the form of a matrix into a list form, and then converts each element in the list, such as the record primary key, camera number, picture number, picture path, pedestrian feature value, face feature value, etc., into a string in turn, and splices the string into a whole string. Finally, only this string needs to be stored in the database to store the feature value in the database. When it is necessary to take out the feature value for comparison, first take out the string corresponding to the feature value, convert it into a matrix and then compare it. The specific operation is to first cut the string and convert the cut result into a list, then convert each element in the list into a floating point type, and finally convert the floating point element into a matrix to compare the feature value. This embodiment constructs a feature library for storing pedestrian feature values, face feature values, camera numbers, image names, image paths, location information, etc. of images in the video image database. That is to say, according to the face recognition results, a database matching face features with location information is established, face features are numbered, and face feature IDs are generated.

[0157] S42. Track and locate the same facial feature ID according to the database.

[0158] Different pedestrians have different facial features. Numbering facial features makes it easier to track and locate the same facial feature ID. Using the facial feature ID as the main search keyword, the time information and location information matching the facial feature ID are retrieved from the database.

[0159] In some optional implementations of this embodiment, after step S4, the electronic device may further perform the following steps:

[0160] S5. Output pedestrian tracking and positioning results.

[0161] In order to facilitate the tracking and positioning of pedestrians, the pedestrian tracking and positioning results are output. The results can be displayed in a view, for example, the locations where a pedestrian with a facial feature ID appears in a specified time period can be displayed in a view or in a list or text; or the time when a pedestrian with a facial feature ID appears in a specified location can be displayed in text, a list or a view. This makes it easier for staff to view and improves work efficiency.

[0162] The beneficial effects of implementing this embodiment are as follows: first, by obtaining the face recognition usage scenario, the usage scenario includes a static recognition mode and a dynamic recognition mode; if it is a static recognition mode, a static video source is obtained, and face recognition is performed on the static video source; if it is a dynamic recognition mode, a real-time dynamic video source is obtained, and face recognition is performed on the real-time dynamic video source; then, based on the face recognition result, pedestrian tracking and positioning is performed; face recognition is performed according to the actual usage scenario, which is flexible and convenient, and the tracking and positioning efficiency is high, and it can be widely used in security monitoring, identity authentication, personnel management and other fields.

[0163] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0164] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0165] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0166] Embodiment 2

[0167] Further references Figure 3 , as a response to the above Figure 2 The present invention provides an embodiment of a pedestrian tracking and positioning device based on face recognition, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0168] like Figure 3 As shown, the pedestrian tracking and positioning device 50 based on face recognition in this embodiment includes: an acquisition module 51 , a first face recognition module 52 , a second face recognition module 53 and a tracking and positioning module 54 .

[0169] in:

[0170] An acquisition module 51 is provided for acquiring a face recognition usage scenario, wherein the usage scenario includes a static recognition mode and a dynamic recognition mode;

[0171] The first face recognition module 52 is used to determine whether the use scenario is a static recognition mode according to the use scenario, and if so, obtain a static video source and perform face recognition on the static video source;

[0172] The second face recognition module 53 is used to determine whether the use scenario is a dynamic recognition mode according to the use scenario, and if so, obtain a real-time dynamic video source and perform face recognition on the real-time dynamic video source;

[0173] The tracking and positioning module 54 is used to track and position pedestrians according to the face recognition results.

[0174] During specific implementation, the pedestrian tracking and positioning device 50 may further include: an output module 55 for outputting pedestrian tracking and positioning results.

[0175] In specific implementation, the acquisition module 51 may further include:

[0176] Configuration module 511, used to obtain face recognition usage scenario configuration file;

[0177] The parsing module 512 is used to parse the configuration file and obtain the usage scenario.

[0178] In specific implementation, the first face recognition module 52 further includes:

[0179] The first determination module 521 is used to determine whether the usage scenario is a static recognition mode;

[0180] The static video source acquisition module 522 is used to acquire a static video source when the usage scenario is a static recognition mode;

[0181] The position information acquisition module 523 is used to capture multiple consecutive frames of images according to the static video source to obtain the recording position information;

[0182] A first filtering module 524, configured to filter non-face images from the continuous multi-frame image graph and retain face images;

[0183] The first feature extraction module 525 is used to perform face recognition on the face image to obtain face features.

[0184] In specific implementation, the second face recognition module 53 further includes:

[0185] The second determination module 531 is used to determine whether the usage scenario is a dynamic recognition mode;

[0186] The real-time video acquisition module 532 is used for using a dynamic recognition mode, and then using multiple cameras to simultaneously acquire real-time dynamic video streams of different areas. Multiple cameras have built-in GPS chips, and the GPS chips are used to acquire location information and transmit it back to the cameras;

[0187] The capture module 533 is used to capture multiple consecutive frames of images according to the real-time dynamic video stream, and each frame of image information carries position information;

[0188] A second filtering module 534, used to filter non-face images from the continuous multiple frames of images and retain face images;

[0189] The second feature extraction module 535 is used to perform face recognition on the face image and fuse the face features, pedestrian features and position information.

[0190] In specific implementation, the tracking and positioning module 54 further includes:

[0191] The facial feature ID generation module 541 is used to establish a database matching facial features with position information according to the facial recognition results, number the facial features, and generate facial feature IDs;

[0192] The facial feature ID tracking and positioning module 542 is used to track and locate the same facial feature ID according to the database. The implementation of this embodiment has the following beneficial effects: first, by obtaining the facial recognition usage scenario, the usage scenario includes a static recognition mode and a dynamic recognition mode; if it is a static recognition mode, a static video source is obtained, and facial recognition is performed on the static video source; if it is a dynamic recognition mode, a real-time dynamic video source is obtained, and facial recognition is performed on the real-time dynamic video source, and then pedestrian tracking and positioning is performed according to the facial recognition result; facial recognition is performed according to the actual usage scenario, which is flexible and convenient, and the tracking and positioning efficiency is high, and it can be generally applied to security monitoring, identity authentication, personnel management and other fields.

[0193] Embodiment 3

[0194] To solve the above technical problems, the embodiment of the present invention also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0195] The above-mentioned computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 6 having components of a memory 61, a processor 62, and a network interface 63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a programmable gate array (FPGA), a digital processor (DSP), an embedded device, etc.

[0196] The computer device may be a desktop computer, a notebook computer, a PDA, a cloud server, etc. The computer device may interact with the user through a keyboard, a mouse, a remote control, a touch pad, or a voice control device.

[0197] The memory 61 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 6. Of course, the memory 61 may also include both the internal storage unit of the computer device 6 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions of a pedestrian tracking and positioning method based on face recognition. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.

[0198] The processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to run the computer-readable instructions or process data stored in the memory 61, such as running the computer-readable instructions of the pedestrian tracking and positioning method based on face recognition.

[0199] The network interface 63 may include a wireless network interface or a wired network interface. The network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.

[0200] The beneficial effects of implementing this embodiment are as follows: first, by obtaining the face recognition usage scenario, the usage scenario includes a static recognition mode and a dynamic recognition mode; if it is a static recognition mode, a static video source is obtained, and face recognition is performed on the static video source; if it is a dynamic recognition mode, a real-time dynamic video source is obtained, and face recognition is performed on the real-time dynamic video source; then, based on the face recognition result, pedestrian tracking and positioning is performed; face recognition is performed according to the actual usage scenario, which is flexible and convenient, and the tracking and positioning efficiency is high, and it can be widely used in security monitoring, identity authentication, personnel management and other fields.

[0201] Embodiment 4

[0202] The present invention also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions. The computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the pedestrian tracking and positioning method based on face recognition as described above.

[0203] The beneficial effects of implementing this embodiment are as follows: first, by obtaining the face recognition usage scenario, the usage scenario includes a static recognition mode and a dynamic recognition mode; if it is a static recognition mode, a static video source is obtained, and face recognition is performed on the static video source; if it is a dynamic recognition mode, a real-time dynamic video source is obtained, and face recognition is performed on the real-time dynamic video source; then, based on the face recognition result, pedestrian tracking and positioning is performed; face recognition is performed according to the actual usage scenario, which is flexible and convenient, and the tracking and positioning efficiency is high, and it can be widely used in security monitoring, identity authentication, personnel management and other fields.

[0204] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the various embodiment methods of the present invention.

[0205] Obviously, the embodiments described above are only some embodiments of the present invention, rather than all embodiments. The preferred embodiments of the present invention are given in the accompanying drawings, but they do not limit the patent scope of the present invention. The present invention can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive. Although the present invention has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific embodiments, or to perform equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of the present invention, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present invention.

Claims

1. A pedestrian tracking and positioning method based on face recognition, characterized in that: The steps include: S1. Obtaining a face recognition usage scenario, where the usage scenario includes a static recognition mode and a dynamic recognition mode; S2. According to the usage scenario, determine whether the usage scenario is a static recognition mode. If yes, obtain a static video source and perform face recognition on the static video source. Otherwise, proceed to S3. S3. According to the usage scenario, determine whether the usage scenario is a dynamic recognition mode, and if so, obtain a real-time dynamic video source and perform face recognition on the real-time dynamic video source; S4. Tracking and positioning pedestrians based on face recognition results; The step of S2, judging whether the usage scenario is a static recognition mode according to the usage scenario, if yes, obtaining a static video source and performing face recognition on the static video source, otherwise entering S3 specifically includes: Determining whether the usage scenario is the static recognition mode; If the usage scenario is the static recognition mode, a static video source is obtained; when it is determined that the usage scenario is the static recognition mode, an online or offline static video source is obtained through a network, or an offline static video is obtained through a storage device, and the static video source is one or more recorded video streams; According to the static video source, capturing multiple consecutive frames of images to obtain recording position information; Filter non-face images from the continuous multi-frame image map and retain the face image; extract the Haar-like feature value of the continuous multi-frame image, and then give the Haar-like feature value to the Adaboost algorithm; the Adaboost algorithm determines whether the current frame image is a face image, otherwise the current frame image is filtered out and the face image is retained; Perform face recognition on the face image to obtain face features, otherwise proceed to S3; The step S3, judging whether the usage scenario is a dynamic recognition mode according to the usage scenario, and if so, obtaining a real-time dynamic video source, and performing face recognition on the real-time dynamic video source specifically comprises: Determining whether the usage scenario is the dynamic recognition mode; The usage scenario is the dynamic recognition mode, and multiple cameras are used to simultaneously collect real-time dynamic video streams of different areas. Multiple cameras have built-in GPS chips, and the GPS chips are used to collect location information and transmit it back to the cameras; According to the real-time dynamic video stream, multiple frames of images are captured, each frame of image information carries position information; Filter non-face images from multiple consecutive frames and retain face images; Perform face recognition on the face image and fuse the face features, pedestrian features and location information.

2. The pedestrian tracking and positioning method based on face recognition according to claim 1 is characterized in that: The step of obtaining a face recognition usage scenario in S1, wherein the usage scenario includes a static recognition mode and a dynamic recognition mode, specifically includes: Get the face recognition usage scenario configuration file; The configuration file is parsed to obtain the usage scenario.

3. The pedestrian tracking and positioning method based on face recognition according to claim 1, characterized in that: The step of performing pedestrian tracking and positioning according to the face recognition result in S4 specifically includes: According to the face recognition result, a database matching the face features with the position information is established, the face features are numbered, and a face feature ID is generated; According to the database, the same facial feature ID is tracked and located.

4. The pedestrian tracking and positioning method based on face recognition according to any one of claims 1 to 3, characterized in that: After the step of tracking and locating pedestrians according to the face recognition result in S4, the following steps are further included: S5. Output pedestrian tracking and positioning results.

5. A pedestrian tracking and positioning device based on face recognition, the device implements the method according to claim 1, characterized in that: include: An acquisition module is used to acquire face recognition usage scenarios, including static recognition mode and dynamic recognition mode; A first face recognition module is used to determine whether the usage scenario is a static recognition mode according to the usage scenario, and if so, obtain a static video source and perform face recognition on the static video source; A second face recognition module is used to determine whether the usage scenario is a dynamic recognition mode according to the usage scenario, and if so, obtain a real-time dynamic video source and perform face recognition on the real-time dynamic video source; The tracking and positioning module is used to track and position pedestrians based on the face recognition results.

6. The pedestrian tracking and positioning device based on face recognition according to claim 5, characterized in that: The acquisition module comprises: Configuration module, used to obtain face recognition usage scenario configuration file; The parsing module is used to parse the configuration file and obtain the usage scenario.

7. The pedestrian tracking and positioning device based on face recognition according to claim 6, characterized in that: The first face recognition module includes: A first judgment module, used to judge whether the usage scenario is the static recognition mode; A static video source acquisition module is used to acquire a static video source when the usage scenario is the static recognition mode; A position information acquisition module, used to capture multiple consecutive frames of images according to the static video source to obtain recording position information; A first filtering module, used for filtering non-face images from the continuous multi-frame image graph and retaining face images; The first feature extraction module is used to perform face recognition on the face image to obtain face features.