A focal plane positioning method and positioning system

The focal plane positioning method that combines a depth camera and a neural network model solves the problem of difficulty in capturing clear pedestrian face images with traditional surveillance methods, achieves precise positioning and tracking of pedestrian heads, and improves the accuracy of face recognition and system efficiency. Practicality.

CN118334729BActive Publication Date: 2024-09-27SICHUAN NATIONAL INNOVATION VISION UHD VIDEO TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410748770.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-27
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

It is difficult for traditional surveillance methods to continuously capture clear facial images when pedestrians are moving, especially when moving quickly or on irregular paths, and factors such as lighting, posture, and occlusion increase the difficulty of face recognition.

Method used

Combining depth cameras, target detection and neural network models, it filters pedestrian areas through depth images, identifies and tracks pedestrian heads, and uses pre-trained prediction models to adjust the focal plane of the front camera to preview and refocus pedestrian heads. .

Benefits of technology

It achieves precise positioning and tracking of pedestrian heads, improves the accuracy of face recognition and the response speed of the system, and ensures the acquisition of high-definition face images in dynamic scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118334729B
    Figure CN118334729B
Patent Text Reader

Abstract

The present invention provides a focal plane positioning method and a positioning system, which belong to the field of image positioning technology. A first depth image is collected by a depth camera, and a region containing pedestrians is screened out based on the first depth image; a target detection method is used to identify and track the pedestrian's head in the region containing pedestrians in the first depth image; based on the tracking data of the pedestrian's head, a pre-trained prediction model is used to predict the head position of the pedestrian's head in a prediction frame; the focal plane of a front camera is adjusted based on the predicted head position; based on the previewed focal plane, a second depth image is collected by the front camera when the prediction frame is reached, and the corresponding current head position in the second depth image is compared with the predicted head position based on a preset deviation threshold; the focal plane where the head position is located is calibrated according to the comparison result, so as to refocus the front camera on the adjusted focal plane. The present invention realizes accurate positioning and tracking of the pedestrian's head.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image positioning, and in particular to a focal plane positioning method and a positioning system. Background Art

[0002] In scenarios where pedestrians are monitored and identified in real time, such as in public places, transportation hubs, or around important facilities, in order to improve monitoring efficiency and ensure public safety, it is necessary to quickly and accurately locate and track pedestrians' heads to obtain clear facial images.

[0003] However, traditional monitoring methods often rely on fixed-position cameras and fixed focal planes, which makes it difficult for cameras to continuously capture clear facial images when pedestrians are moving, especially when they are moving at high speeds or with irregular paths. In addition, the difficulty of facial recognition is increased due to the influence of multiple factors such as lighting conditions, pedestrian postures, and occlusion.

[0004] Therefore, it is necessary to provide a focal plane positioning method and a positioning system to solve the above technical problems. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a focal plane positioning method and a positioning system, which combine a depth camera, target detection and a neural network model to achieve accurate positioning and tracking of pedestrians' heads.

[0006] The present invention provides a focal plane positioning method, the positioning method comprising the following steps:

[0007] S1: collecting a first depth image through a depth camera, and screening out at least one area containing a pedestrian based on the first depth image;

[0008] S2: using a target detection method to perform pedestrian head recognition on at least one area containing pedestrians in the first depth image, and tracking each recognized pedestrian head using a tracking method;

[0009] S3: Based on the tracking data of at least one pedestrian's head, predict the head position of at least one pedestrian's head in the prediction frame using a pre-trained prediction model, wherein the prediction model is a neural network model trained according to historical trajectory data;

[0010] S4: adjusting the focal plane of the front camera based on the predicted head position to achieve preview of at least one pedestrian's head;

[0011] S5: using the front camera to collect a second depth image when the predicted frame is reached based on the preview focal plane, and comparing the current head position corresponding to the second depth image with the predicted head position based on a preset deviation threshold;

[0012] S6: Calibrate the focal plane where the head position is located according to the comparison result, so as to refocus the front camera on the adjusted focal plane to obtain a corresponding face image.

[0013] Preferably, step S1 specifically includes:

[0014] S101: Based on a pre-arranged depth camera, collect three-dimensional depth information of a current scene and generate a first depth image;

[0015] S102: Preprocessing the first depth image, wherein the preprocessing includes noise filtering, correction, and image enhancement;

[0016] S103: performing preliminary division on the preprocessed first depth image using a preset depth threshold to obtain a foreground image and a background image;

[0017] S104: Filter out regions whose heights meet a preset value from the foreground image to obtain at least one region containing a pedestrian.

[0018] Preferably, step S2 specifically includes the following steps:

[0019] S201: identifying a candidate frame containing a pedestrian's head based on at least one region containing a pedestrian, and confirming a head region according to features of the candidate frame;

[0020] S202: Allocate a unique ID for the confirmed head region, and initialize the displacement attributes of the head region in the current frame, wherein the displacement attributes include position, size, and speed;

[0021] S203: configuring a Kalman filter for each head region based on the displacement attribute of the head region after initialization to track the head region.

[0022] Preferably, step S3 specifically includes the following steps:

[0023] S301: collecting historical trajectory data including position information, moving speed and acceleration of the pedestrian's head in previous frames, and extracting associated features from the collected historical trajectory data, wherein the associated features include motion trend, direction angle change rate and environmental impact factors;

[0024] S302: converting the historical trajectory data into a feature vector, and inputting the feature vector into the neural network model for forward propagation training to obtain a trained prediction model;

[0025] S303: inputting the tracking data of the pedestrian's head into the trained prediction model to perform forward propagation calculation to obtain the prediction result of each pedestrian's head in the prediction frame;

[0026] S304: Decode the depth information of the head position from the prediction result output by the prediction model, and convert it into a preview depth in the camera coordinate system of the front camera.

[0027] Preferably, step S4 specifically includes the following steps:

[0028] S401: Convert the two-dimensional coordinates of the head position into three-dimensional world coordinates based on the preview depth and the depth camera internal parameters. The specific conversion formula is:

[0029]

[0030]

[0031]

[0032] in, is the two-dimensional coordinate of the head position, is the current depth of the depth camera, They are respectively the camera internal reference center edge Axis and The focal length scale factor for the axis, is the optical center coordinate of the head position, is the 3D world coordinate of the head position;

[0033] S402: Using the acquired preview depth as the focal plane depth, and converting the focal plane depth from the world coordinate system to the coordinate system of the front camera, the specific conversion formula is:

[0034]

[0035] in, is the focal plane depth in the world coordinate system, is the rotation matrix, is the translation vector, is the focal plane depth in the coordinate system of the front camera;

[0036] S403: Calculate the focal length that needs to be adjusted according to the focal plane depth in the coordinate system of the front camera, and adjust the focal plane of the front camera according to the focal length that needs to be adjusted, so that the focal plane of the front camera is located at the depth of the predicted head position.

[0037] Preferably, step S5 specifically includes the following steps:

[0038] S501: using a front camera to obtain a second depth image at a predicted frame, and obtaining a current head position corresponding to the predicted head position in the second depth image;

[0039] S502: Compare the current head position with the predicted head position, and calculate the deviation according to a deviation formula, wherein the deviation formula is:

[0040]

[0041] in, is the deviation, is the current head position, is the predicted head position;

[0042] S503: Compare the calculated deviation with a preset deviation threshold.

[0043] If the absolute value If the deviation threshold is exceeded, the execution stops and the focal plane of the front camera is no longer adjusted; otherwise, step S6 is executed.

[0044] Preferably, step S6 comprises the following steps:

[0045] The deviation As the adjustment distance, the focal plane where the head position is located is shifted according to the adjustment distance, and finally the front camera is refocused on the focal plane shifted according to the adjustment distance to obtain a corresponding face image.

[0046] The present invention also provides a focal plane positioning system, which is applied to the focal plane positioning method. The positioning system comprises:

[0047] An area screening module, configured to collect a first depth image through a depth camera, and screen out at least one area containing a pedestrian based on the first depth image;

[0048] A tracking module, configured to perform pedestrian head recognition on at least one area containing pedestrians in the first depth image using a target detection method, and to track each identified pedestrian head using a tracking method;

[0049] A prediction module, configured to predict the head position of at least one pedestrian in a prediction frame using a pre-trained prediction model based on the tracking data of at least one pedestrian's head, wherein the prediction model is a neural network model trained according to historical trajectory data;

[0050] A focal plane adjustment module, used to adjust the focal plane of the front camera based on the predicted head position to achieve preview of at least one pedestrian's head;

[0051] A comparison module, configured to collect a second depth image when the predicted frame is reached using a front camera based on the preview focal plane, and compare the current head position corresponding to the second depth image with the predicted head position based on a preset deviation threshold;

[0052] The focal plane calibration module is used to calibrate the focal plane where the head position is located according to the comparison result, so as to refocus the front camera on the adjusted focal plane to obtain a corresponding face image.

[0053] Compared with the related art, the focal plane positioning method and positioning system provided by the present invention have the following beneficial effects:

[0054] The present invention collects a first depth image through a depth camera and filters out the area containing pedestrians; then uses a target detection method to identify the heads of pedestrians, and tracks the heads of each pedestrian through a tracking method; then, based on the tracking data, uses a pre-trained prediction model to predict the position of the pedestrian's head in the prediction frame; finally, adjusts the focal plane of the front camera according to the predicted position to achieve preview and refocusing of the pedestrian's head, thereby obtaining a clear face image, achieving accurate recognition and tracking of the pedestrian's head, and improving the accuracy of face recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A flow chart of a focal plane positioning method provided by the present invention;

[0056] Figure 2 A module structure diagram of a focal plane positioning system provided by the present invention. DETAILED DESCRIPTION

[0057] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings. In addition, the embodiments of the present invention and the features in the embodiments may be combined with each other without conflict.

[0058] It should also be noted that, for ease of description, only the parts related to the present invention, but not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the various operations (or steps) as being processed sequentially, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the various operations can be rearranged. The processing can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0059] Embodiment 1

[0060] The present invention provides a focal plane positioning method, referring to Figure 1 As shown, the positioning method includes the following steps:

[0061] S1: Capture a first depth image through a depth camera, and filter out at least one area containing a pedestrian based on the first depth image.

[0062] In this embodiment, a depth camera is used to obtain three-dimensional depth information of the scene, and potential pedestrian areas are screened out by setting an appropriate depth threshold (based on the average height range of people), thereby reducing the amount of data for subsequent processing, focusing on key areas containing pedestrians, speeding up processing speed and improving the utilization of system resources.

[0063] S2: using a target detection method to perform pedestrian head recognition on at least one area containing pedestrians in the first depth image, and using a tracking method to track each identified pedestrian head.

[0064] In this embodiment, a target detection method enhanced by depth information is used to identify the head position in the screened pedestrian area. Once the head is identified, a Kalman filter tracking algorithm is used to continuously track the dynamic changes of the head, thereby improving the accuracy of head recognition and the stability of tracking, and maintaining continuous tracking of the target even when the pedestrian is moving, occluded or in a complex background.

[0065] S3: Based on the tracking data of at least one pedestrian's head, use a pre-trained prediction model to predict the head position of at least one pedestrian's head in the prediction frame, wherein the prediction model is a neural network model trained according to historical trajectory data.

[0066] In this embodiment, a neural network model is trained using historical tracking data, the tracked head position is input, and the head position in the predicted frame is output, thereby achieving forward-looking focal plane adjustment, reducing image blur or focus delay caused by real-time adjustment of the focal length, and improving the system's response speed and shooting quality.

[0067] S4: Adjust the focal plane of the front camera based on the predicted head position to achieve preview of at least one pedestrian's head.

[0068] In this embodiment, the focal plane depth to be adjusted is calculated based on the head position output by the prediction model, and the predicted head position is pre-aligned, which improves the accuracy and efficiency of shooting and enables the front camera to capture a clear image immediately when the target enters the optimal shooting position.

[0069] S5: Based on the preview focal plane, use the front camera to collect a second depth image when the predicted frame is reached, and compare the current head position corresponding to the second depth image with the predicted head position based on a preset deviation threshold.

[0070] In this embodiment, the current head position of the pedestrian is detected in the second depth image actually taken and compared with the predicted position. The need for further calibration of the focal plane is determined based on a preset deviation threshold, thereby forming a closed-loop control mechanism to ensure that even when the prediction is incorrect or the pedestrian's motion pattern changes suddenly, adjustments can be made quickly to maintain image clarity.

[0071] S6: Calibrate the focal plane where the head position is located according to the comparison result, so as to refocus the front camera on the adjusted focal plane to obtain a corresponding face image.

[0072] In this embodiment, the focal plane is further accurately adjusted according to the result of the deviation comparison to ensure that the final face image is clear.

[0073] Specifically, according to the deviation found in S5, the focal plane is adjusted again so that the front camera can focus accurately on the actual head position. After the adjustment, the front camera is refocused to capture high-quality face images, which ultimately ensures the high definition of the final output image. It can effectively track and focus on the target even in dynamic scenes, improving the practicality of the system and user experience.

[0074] Specifically, step S1 specifically includes:

[0075] S101: Based on a pre-arranged depth camera, collect three-dimensional depth information of a current scene and generate a first depth image.

[0076] In this embodiment, a depth camera is installed at a specific location, and its infrared or structured light technology is used to capture the depth information of each point in the scene, generating a first depth image with rich depth levels. Finally, by obtaining the depth information of the physical space, compared with traditional two-dimensional image processing, the ability to judge the distance and size of objects in the scene is greatly enhanced, providing more accurate basic data for subsequent pedestrian area screening.

[0077] S102: Preprocess the first depth image, wherein the preprocessing includes noise filtering, correction, and image enhancement.

[0078] In this embodiment, a denoising algorithm is first applied to remove random noise and spots in the image; secondly, geometric correction is performed to correct the image deformation caused by camera lens distortion to ensure the accuracy of depth information; finally, image enhancement technology is used to improve the image visual effect and highlight the features of the region of interest to facilitate subsequent processing, thereby ultimately improving the image quality and information reliability and reducing the misjudgment rate of subsequent pedestrian detection and head tracking. Preprocessing is particularly important, especially in low light, complex texture or occluded environments.

[0079] S103: Preliminarily dividing the preprocessed first depth image using a preset depth threshold to obtain a foreground image and a background image.

[0080] In this embodiment, a preset depth threshold (such as a depth range based on common obstacles in the scene and a person's standing height) is used to binarize the preprocessed depth image, and pixels within the threshold range (usually representing possible pedestrians or close-up objects) are marked as foregrounds, and the rest are marked as backgrounds. Ultimately, the processing scope is significantly narrowed, focusing on areas that may contain pedestrians, which not only reduces the computational burden but also improves the efficiency and accuracy of pedestrian detection.

[0081] S104: Filter out regions whose heights meet a preset value from the foreground image to obtain at least one region containing a pedestrian.

[0082] In this embodiment, first, a size analysis is performed on each connected domain in the foreground image, with particular attention paid to the height dimension. A reasonable height threshold interval is set based on the average height range of adult pedestrians when standing (for example, approximately 1.5 meters to 2 meters). The height of each candidate area is measured using a contour extraction method and compared with a preset value. Those areas whose heights fall within the preset pedestrian height range are retained. Ultimately, areas that may actually belong to pedestrians are effectively identified among many foreground objects, significantly improving the accuracy and efficiency of subsequent pedestrian head recognition and tracking, avoiding interference from irrelevant objects, and improving the practicality of the system.

[0083] Specifically, step S2 specifically includes the following steps:

[0084] S201: identifying a candidate frame containing a pedestrian's head based on at least one region containing a pedestrian, and confirming a head region according to features of the candidate frame.

[0085] In this embodiment, a fusion analysis based on the depth map and the RGB image is used, combined with the head shape and texture features (such as the ratio of the head to the body, color difference, etc.) to identify candidate boxes that may contain the head. Subsequently, these candidate boxes are evaluated using a pre-trained machine learning classifier to identify the area that best matches the pedestrian's head features, thereby improving the accuracy and robustness of head recognition. Even in complex visual environments, the head can be effectively distinguished from other objects, providing a reliable foundation for subsequent steps.

[0086] S202: Allocate a unique ID for the confirmed head region, and initialize the displacement attributes of the head region in the current frame, wherein the displacement attributes include position, size, and speed.

[0087] In this embodiment, a unique ID is assigned to each independently confirmed head region, which is convenient for distinguishing and managing when multiple head regions exist. At the same time, the position, size and estimated speed of the head region in the current frame (calculated based on the changes in the previous and next frames) are recorded as the initial value of its displacement attribute. Finally, by assigning an ID and initializing the displacement attribute, the movement and change of each head over time can be effectively tracked, providing the necessary initialization parameters for the subsequent Kalman filter, and enhancing the stability and continuity of tracking.

[0088] S203: configuring a Kalman filter for each head region based on the displacement attribute of the head region after initialization to track the head region.

[0089] In this embodiment, based on the displacement attribute initialized in S202, a Kalman filter is configured for each head region. Specifically, the Kalman filter predicts the possible position of the next frame based on the motion model of the head in the previous frames (including the changing trend of position, size and speed), and then updates the prediction model based on the newly acquired actual observation data (i.e., the head position information in the new depth image), thereby continuously optimizing the estimation of the head position, thereby significantly improving the stability and accuracy of tracking, especially in the case of target occlusion, rapid movement or changing lighting conditions, which can effectively reduce tracking errors and ensure continuous tracking of the head region, thereby making the focal plane positioning more accurate, thereby improving the real-time performance and shooting quality of the overall system.

[0090] Specifically, step S3 specifically includes the following steps:

[0091] S301: Collect historical trajectory data including position information, moving speed and acceleration of the pedestrian's head in previous frames, and extract associated features from the collected historical trajectory data, wherein the associated features include motion trend, direction angle change rate and environmental influencing factors.

[0092] In this embodiment, by recording and analyzing the position, moving speed, acceleration, etc. of the pedestrian's head in a series of continuous frames, as well as environmental factors that may affect the movement of the head (such as crowd density, obstacle distribution, etc.), features such as movement trends (such as straight-line walking, acceleration or deceleration, etc.) and angular change rate (speed and direction of head rotation) are extracted. These features reflect the dynamic behavior patterns of pedestrians and their interaction with the surrounding environment, provide rich contextual information for the prediction model, enhance the generalization ability and accuracy of the prediction model, and enable the model to more accurately predict the future position of pedestrians based on their historical behavior and current environmental conditions, thereby guiding the forward-looking adjustment of the focal plane.

[0093] S302: Convert the historical trajectory data into a feature vector and input it into the neural network model for forward propagation training to obtain a trained prediction model.

[0094] In this embodiment, the collected historical trajectory data is converted into feature vectors as input to the neural network model. The neural network model includes a convolutional layer to capture the spatiotemporal dependencies in the time series data. Through iterative training of a large amount of historical trajectory data, the neural network model learns the mapping relationship of predicting the future state from the current state. Ultimately, the trained model can learn from the pedestrian's immediate state and past behavior and predict the future position of his head, which improves the adaptability and accuracy of the prediction and lays a solid foundation for fast and accurate focal plane adjustment.

[0095] S303: Input the tracking data of the pedestrian's head into the trained prediction model to perform forward propagation calculation to obtain the prediction result of each pedestrian's head in the prediction frame.

[0096] In this embodiment, during the tracking process, the tracking data such as the position, speed and acceleration of the pedestrian's head captured in real time are input into the trained neural network model. The model performs forward propagation calculations and outputs the predicted position of each pedestrian's head in the next frame or the next few frames, thereby realizing real-time prediction of the dynamic position of the pedestrian's head, being able to adjust the focal plane in advance, reducing the image blur problem caused by the delay between the actual action and the adjustment, and improving the real-time performance and image quality of shooting.

[0097] S304: Decode the depth information of the head position from the prediction result output by the prediction model, and convert it into a preview depth in the camera coordinate system of the front camera.

[0098] In this embodiment, depth information is extracted from the prediction result of the prediction model and converted into a depth value that conforms to the front camera coordinate system, namely, the preview depth.

[0099] Specifically, the specific spatial coordinates are decoded from the high-dimensional feature space output by the prediction model, and necessary coordinate transformations are performed according to the internal parameters of the camera to ensure that the predicted head position can be directly applied to the camera's focus control. Ultimately, a seamless connection is achieved from the prediction model output to the actual camera control signal, ensuring the effective application of the prediction results, improving the accuracy and efficiency from prediction to execution, and further consolidating the dynamic tracking and focusing capabilities in the entire focal plane positioning process.

[0100] Specifically, step S4 specifically includes the following steps:

[0101] S401: Convert the two-dimensional coordinates of the head position into three-dimensional world coordinates based on the preview depth and the depth camera internal parameters. The specific conversion formula is:

[0102]

[0103]

[0104]

[0105] in, is the two-dimensional coordinate of the head position, is the current depth of the depth camera, They are respectively the camera internal reference center edge Axis and The focal length scale factor for the axis, is the optical center coordinate of the head position, is the 3D world coordinate of the head position.

[0106] In this embodiment, through this conversion, the position of the pedestrian's head in the real three-dimensional space can be accurately known, providing precise depth information for the subsequent focal plane adjustment, thereby enhancing the spatial perception ability of the system.

[0107] S402: Using the acquired preview depth as the focal plane depth, and converting the focal plane depth from the world coordinate system to the coordinate system of the front camera, the specific conversion formula is:

[0108]

[0109] in, is the focal plane depth in the world coordinate system, is the rotation matrix, is the translation vector, is the focal plane depth in the coordinate system of the front camera.

[0110] In this embodiment, the conversion of the coordinate system ensures the accuracy of the focal plane adjustment instruction, avoids focusing errors caused by mismatching of the coordinate system, and improves the accuracy of focusing.

[0111] S403: Calculate the focal length that needs to be adjusted according to the focal plane depth in the coordinate system of the front camera, and adjust the focal plane of the front camera according to the focal length that needs to be adjusted, so that the focal plane of the front camera is located at the depth of the predicted head position.

[0112] In this embodiment, based on the converted focal plane depth value, the focal length to which the front camera needs to be adjusted is calculated. By directly adjusting the focal length to the predicted depth of the head, it is ensured that a quick response and clear focus can be maintained even when the target moves, thereby improving the shooting quality and system response speed in dynamic scenes.

[0113] Specifically, step S5 specifically includes the following steps:

[0114] S501: using a front camera to obtain a second depth image at a predicted frame, and obtaining a current head position corresponding to the predicted head position in the second depth image.

[0115] In this embodiment, when the predicted frame arrives, the front camera shoots according to the previewed focal plane to obtain a second depth image, and uses the head detection algorithm to identify and determine the actual position of the current pedestrian's head in the second depth image, providing an actual reference point for subsequent deviation calculations. Ultimately, through real-time image capture, it is possible to verify and adapt to the dynamic changes of pedestrians in real time, thereby improving the real-time and accuracy of the focal plane adjustment and ensuring stable performance in complex dynamic scenes.

[0116] S502: Compare the current head position with the predicted head position, and calculate the deviation according to a deviation formula, wherein the deviation formula is:

[0117]

[0118] in, is the deviation, is the current head position, is the predicted head position.

[0119] In this embodiment, the direction and size of the prediction error can be clearly determined by calculating the deviation vector.

[0120] S503: Compare the calculated deviation with a preset deviation threshold.

[0121] If the absolute value If the deviation threshold is exceeded, the execution stops and the focal plane of the front camera is no longer adjusted; otherwise, step S6 is executed.

[0122] In this embodiment, the calculated absolute value of the deviation is compared with a preset deviation threshold. If the deviation is less than the threshold, it means that the predicted position is close enough to the actual position, and the current focal plane setting is maintained to avoid unnecessary adjustments. On the contrary, if the deviation is greater than or equal to the threshold, further calibration of the focal plane is triggered, and step S6 is executed to readjust the focal plane. By introducing a deviation threshold judgment mechanism, it is possible to intelligently decide when to intervene in the adjustment, avoiding frequent adjustment of the focal length within the acceptable range of pedestrian micro-movement or prediction error, improving the efficiency and stability of the system, while ensuring the focusing accuracy when necessary, and optimizing the user experience.

[0123] Specifically, step S6 includes the following steps:

[0124] The deviation As the adjustment distance, the focal plane where the head position is located is shifted according to the adjustment distance, and finally the front camera is refocused on the focal plane shifted according to the adjustment distance to obtain a corresponding face image.

[0125] In this embodiment, first, according to the deviation between the current head position detected in S5 and the predicted head position, the deviation is directly used as the adjustment distance.

[0126] Then, based on the calculated adjustment distance, the previously previewed focal plane is fine-tuned. Specifically, the camera control system responds quickly to the instructions and adjusts the focal length and depth of focus to ensure that the focal plane position matches the actual head position.

[0127] Finally, after the focal plane is adjusted, the front camera refocuses according to the new focal plane depth.

[0128] The working principle of a focal plane positioning method provided by the present invention is as follows: the present invention collects a first depth image through a depth camera and filters out an area containing pedestrians; then uses a target detection method to identify the heads of pedestrians, and tracks the heads of each pedestrian through a tracking method; then, based on the tracking data, uses a pre-trained prediction model to predict the position of the pedestrian's head in the prediction frame; finally, adjusts the focal plane of the front camera according to the predicted position to achieve preview and refocusing of the pedestrian's head, thereby obtaining a clear facial image, achieving accurate recognition and tracking of the pedestrian's head, and improving the accuracy of facial recognition.

[0129] Embodiment 2

[0130] The present invention also provides a focal plane positioning system, which is applied to the focal plane positioning method, referring to Figure 2 As shown, the positioning system includes:

[0131] An area screening module, configured to collect a first depth image through a depth camera, and screen out at least one area containing a pedestrian based on the first depth image;

[0132] A tracking module, configured to perform pedestrian head recognition on at least one area containing pedestrians in the first depth image using a target detection method, and to track each identified pedestrian head using a tracking method;

[0133] A prediction module, configured to predict the head position of at least one pedestrian in a prediction frame using a pre-trained prediction model based on the tracking data of at least one pedestrian's head, wherein the prediction model is a neural network model trained according to historical trajectory data;

[0134] A focal plane adjustment module, used to adjust the focal plane of the front camera based on the predicted head position to achieve preview of at least one pedestrian's head;

[0135] A comparison module, configured to collect a second depth image when the predicted frame is reached using a front camera based on the preview focal plane, and compare the current head position corresponding to the second depth image with the predicted head position based on a preset deviation threshold;

[0136] The focal plane calibration module is used to calibrate the focal plane where the head position is located according to the comparison result, so as to refocus the front camera on the adjusted focal plane to obtain a corresponding face image.

[0137] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0138] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, the storage medium including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically-erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0139] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or includes elements that are inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.

Claims

1. A focal plane positioning method, characterized in that: The positioning method includes the following steps: S1: collecting a first depth image through a depth camera, and screening out at least one area containing a pedestrian based on the first depth image; S2: using a target detection method to perform pedestrian head recognition on at least one area containing pedestrians in the first depth image, and tracking each recognized pedestrian head using a tracking method; S3: Based on the tracking data of at least one pedestrian's head, predict the head position of at least one pedestrian's head in the prediction frame using a pre-trained prediction model, wherein the prediction model is a neural network model trained according to historical trajectory data; Step S3 specifically includes: S301: collecting historical trajectory data including position information, moving speed and acceleration of the pedestrian's head in previous frames, and extracting associated features from the collected historical trajectory data, wherein the associated features include motion trend, direction angle change rate and environmental impact factors; S302: converting the historical trajectory data into a feature vector, and inputting the feature vector into the neural network model for forward propagation training to obtain a trained prediction model; S303: inputting the tracking data of the pedestrian's head into the trained prediction model to perform forward propagation calculation to obtain the prediction result of each pedestrian's head in the prediction frame; S304: Decoding the depth information of the head position from the prediction result output by the prediction model, and converting it into a preview depth in the camera coordinate system of the front camera; S4: adjusting the focal plane of the front camera based on the predicted head position to achieve preview of at least one pedestrian's head; Step S4 specifically includes: S401: Convert the two-dimensional coordinates of the head position into three-dimensional world coordinates based on the preview depth and the depth camera internal parameters. The specific conversion formula is: Z w =D pred Among them, (u p , v p ) is the two-dimensional coordinate of the head position, D pred is the current depth of the depth camera, (f x , f y ) are the focal length scaling factors along the X-axis and Y-axis in the camera intrinsic parameters, respectively. (c x , c y ) is the optical center coordinate of the head position, (X w , Y w , Z w ) is the 3D world coordinate of the head position; S402: Using the acquired preview depth as the focal plane depth, and converting the focal plane depth from the world coordinate system to the coordinate system of the front camera. The specific conversion formula is: P cam =R -1 ×(P world -t) Among them, P world is the focal plane depth in the world coordinate system, R is the rotation matrix, t is the translation vector, P cam is the focal plane depth in the coordinate system of the front camera; S403: Calculating the focal length to be adjusted according to the focal plane depth in the coordinate system of the front camera, and adjusting the focal plane of the front camera according to the focal length to be adjusted, so that the focal plane of the front camera is located at the depth of the predicted head position; S5: using the front camera to collect a second depth image when the predicted frame is reached based on the preview focal plane, and comparing the current head position corresponding to the second depth image with the predicted head position based on a preset deviation threshold; S6: Calibrate the focal plane where the head position is located according to the comparison result, so as to refocus the front camera on the adjusted focal plane to obtain a corresponding face image.

2. A focal plane positioning method according to claim 1, characterized in that: Step S1 specifically includes: S101: Based on a pre-arranged depth camera, collect three-dimensional depth information of a current scene and generate a first depth image; S102: Preprocessing the first depth image, wherein the preprocessing includes noise filtering, correction, and image enhancement; S103: performing preliminary division on the preprocessed first depth image using a preset depth threshold to obtain a foreground image and a background image; S104: Filter out regions whose heights meet a preset value from the foreground image to obtain at least one region containing a pedestrian.

3. A focal plane positioning method according to claim 2, characterized in that: Step S2 specifically includes the following steps: S201: identifying a candidate frame containing a pedestrian's head based on at least one region containing a pedestrian, and confirming a head region according to features of the candidate frame; S202: Allocate a unique ID for the confirmed head region, and initialize the displacement attributes of the head region in the current frame, wherein the displacement attributes include position, size, and speed; S203: configuring a Kalman filter for each head region based on the displacement attribute of the head region after initialization to track the head region.

4. A focal plane positioning method according to claim 3, characterized in that: Step S5 specifically includes the following steps: S501: using a front camera to obtain a second depth image at a predicted frame, and obtaining a current head position corresponding to the predicted head position in the second depth image; S502: Compare the current head position with the predicted head position, and calculate the deviation according to a deviation formula, wherein the deviation formula is: D P =P2-P1 Among them, Δ P is the deviation, P2 is the current head position, and P1 is the predicted head position; S503: Compare the calculated deviation with a preset deviation threshold. If the absolute value Δ P < the deviation threshold, the execution stops and the focal plane of the front camera is no longer adjusted; otherwise, step S6 is executed.

5. A focal plane positioning method according to claim 4, characterized in that: Step S6 includes the following steps: The deviation Δ P As the adjustment distance, the focal plane where the head position is located is shifted according to the adjustment distance, and finally the front camera is refocused on the focal plane shifted according to the adjustment distance to obtain a corresponding face image.

6. A focal plane positioning system, applied to the focal plane positioning method according to any one of claims 1 to 5, characterized in that: The positioning system includes: An area screening module, configured to collect a first depth image through a depth camera, and screen out at least one area containing a pedestrian based on the first depth image; A tracking module, configured to perform pedestrian head recognition on at least one area containing pedestrians in the first depth image using a target detection method, and to track each identified pedestrian head using a tracking method; A prediction module, configured to predict the head position of at least one pedestrian in a prediction frame using a pre-trained prediction model based on the tracking data of at least one pedestrian's head, wherein the prediction model is a neural network model trained according to historical trajectory data; A focal plane adjustment module, used to adjust the focal plane of the front camera based on the predicted head position to achieve preview of at least one pedestrian's head; A comparison module, configured to collect a second depth image when the predicted frame is reached using a front camera based on the preview focal plane, and compare the current head position corresponding to the second depth image with the predicted head position based on a preset deviation threshold; The focal plane calibration module is used to calibrate the focal plane where the head position is located according to the comparison result, so as to refocus the front camera on the adjusted focal plane to obtain a corresponding face image.