PTZ position control method, device, equipment and storage medium

Through real-time facial feature point recognition and three-dimensional coordinate system analysis, the PTZ orientation control is optimized, solving the problems of low efficiency and low accuracy of traditional PTZ control, and achieving high-precision and fast-response face tracking effects.

CN118474542BActive Publication Date: 2024-09-17HOHEM TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410940731.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-17
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

Traditional gimbal orientation control methods have low efficiency and low accuracy, making it difficult to meet complex application requirements. Especially in face detection and tracking scenarios, it is difficult to achieve high-precision tracking and rapid response.

Method used

Real-time face tracking and recognition through the camera, using facial feature points to perform affine geometric correction, constructing a three-dimensional face coordinate system, analyzing dynamic movement trajectories and trends, calculating gimbal posture correction parameters, optimizing orientation adjustment strategies, and constructing gimbal orientation predictions Control the model for precise tracking.

Benefits of technology

It improves the accuracy and stability of face analysis and tracking, reduces the PTZ control delay, ensures timely and accurate tracking of the face center, and enhances the system's adaptability to changes in head posture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118474542B
    Figure CN118474542B
Patent Text Reader

Abstract

The present invention relates to the field of pan-tilt control technology, and in particular to a pan-tilt orientation control method, device, equipment and storage medium. The method comprises the following steps: performing real-time face tracking and recognition based on a camera to obtain a real-time multi-directional face image; performing face feature point recognition on the real-time multi-directional face image to obtain face feature points; performing affine geometric correction processing on the real-time multi-directional face image according to the face feature points to obtain a corrected multi-directional face image; obtaining a target positioning coordinate system based on the corrected multi-directional face image; performing multi-directional pixel point inverse calculation on the face feature points to obtain pixel point matching relationship data; performing feature point positioning mapping processing on the target positioning coordinate system based on the pixel point matching relationship data to construct a three-dimensional face coordinate system; performing movement trajectory analysis based on the three-dimensional face coordinate system to obtain a dynamic movement trajectory of the face. The present invention realizes efficient and accurate pan-tilt control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pan / tilt control, and in particular to a pan / tilt position control method, device, equipment and storage medium. Background Art

[0002] With the continuous development of artificial intelligence technology, face detection and tracking technology has been widely used in many application scenarios. As a key device for realizing image capture and object tracking, the precise position control of the gimbal has become a technical problem that needs to be solved urgently. The traditional gimbal position control mainly relies on manual control or simple feedback control algorithms, which has the problems of low control efficiency and low precision, and it is difficult to meet the increasingly complex application requirements. Therefore, an intelligent gimbal position control method is urgently needed to achieve high-precision tracking and rapid response to the target object. Summary of the invention

[0003] In order to solve the above technical problems, the present invention proposes a pan / tilt position control method, device, equipment and storage medium to solve at least one of the above technical problems.

[0004] To achieve the above object, the present invention provides a pan / tilt position control method, comprising the following steps:

[0005] Step S1: performing real-time face tracking and recognition based on a camera to obtain a real-time multi-directional face image; performing facial feature point recognition on the real-time multi-directional face image to obtain facial feature points; performing affine geometric correction processing on the real-time multi-directional face image according to the facial feature points to obtain a corrected multi-directional face image;

[0006] Step S2: obtaining a target positioning coordinate system based on the corrected multi-directional face image; performing multi-directional pixel point inverse calculation on the face feature points to obtain pixel point matching relationship data; performing feature point positioning mapping processing on the target positioning coordinate system based on the pixel point matching relationship data to construct a three-dimensional face coordinate system;

[0007] Step S3: performing movement trajectory analysis based on the three-dimensional face coordinate system to obtain the dynamic movement trajectory of the face; performing movement trend prediction on the dynamic movement trajectory of the face to obtain face movement trend prediction data;

[0008] Step S4: obtaining the current center posture parameters of the gimbal; performing precise position and posture recognition of the face in the three-dimensional face coordinate system, thereby obtaining precise position and posture parameters; performing posture offset difference calculation on the precise position and posture parameters based on the current center posture parameters of the gimbal, and generating a gimbal posture correction range value;

[0009] Step S5: performing posture error calculation on the gimbal posture correction range value to obtain a gimbal posture correction parameter output value; and obtaining face center posture recognition data according to the gimbal posture correction parameter output value;

[0010] Step S6: Dynamically track and adjust the face center posture recognition data to obtain a dynamic adjustment strategy for the gimbal position; dynamically predict and optimize the dynamic adjustment strategy for the gimbal position based on the face movement trend prediction data, thereby constructing a gimbal position prediction control model to perform gimbal position control operations.

[0011] In this specification, a pan / tilt position control device is also provided, comprising:

[0012] The geometric correction module is used to perform real-time face tracking and recognition based on the camera to obtain a real-time multi-directional face image; perform facial feature point recognition on the real-time multi-directional face image to obtain facial feature points; perform affine geometric correction processing on the real-time multi-directional face image according to the facial feature points to obtain a corrected multi-directional face image;

[0013] The feature point positioning module is used to obtain a target positioning coordinate system based on the corrected multi-directional face image; perform multi-directional pixel point inverse calculation on the face feature points to obtain pixel point matching relationship data; perform feature point positioning mapping processing on the target positioning coordinate system based on the pixel point matching relationship data to construct a three-dimensional face coordinate system;

[0014] The trend prediction module is used to analyze the movement trajectory based on the three-dimensional face coordinate system to obtain the dynamic movement trajectory of the face; and to predict the movement trend of the dynamic movement trajectory of the face to obtain the face movement trend prediction data;

[0015] The posture offset calculation module is used to obtain the current center posture parameters of the gimbal; perform precise position and posture recognition on the three-dimensional face coordinate system to obtain precise position and posture parameters; perform posture offset differential calculation on the precise position and posture parameters based on the current center posture parameters of the gimbal to generate the gimbal posture correction range value;

[0016] The posture correction module is used to calculate the posture error of the gimbal posture correction range value to obtain the gimbal posture correction parameter output value; and obtain the face center posture recognition data according to the gimbal posture correction parameter output value;

[0017] The gimbal control module is used to dynamically track and adjust the face center posture recognition data to obtain the gimbal orientation dynamic adjustment strategy; based on the face movement trend prediction data, the gimbal orientation dynamic adjustment strategy is dynamically predicted and optimized, thereby constructing a gimbal orientation prediction control model to perform gimbal orientation control operations.

[0018] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-mentioned gimbal orientation control methods when executing the computer program.

[0019] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned gimbal orientation control methods are implemented.

[0020] The pan / tilt position control method, device, equipment and storage medium provided by the present invention have the following beneficial effects:

[0021] The present invention obtains the user's face image in real time through the camera, and can cover multiple azimuth angles, including different head postures such as the front and side, enhance the system's adaptability to changes in head posture, and use the face key points to perform affine transformation correction, effectively eliminate the geometric distortion of the face image in terms of rotation, translation, etc., improve the accuracy and stability of subsequent face analysis and tracking, and construct a three-dimensional face coordinate system based on the pixel coordinates of the detected face key points in the image by mapping to the target positioning coordinate system. The three-dimensional coordinate system can more accurately express the position and posture information of the face in space, and can better support the tracking of complex movements such as head rotation and translation compared to the two-dimensional plane coordinate system. By analyzing the dynamic movement trajectory of the face in the three-dimensional coordinate system, the future movement trend of the face is predicted, providing a basis for pan / tilt control, and accurately predicting the movement trend of the face. It can make the gimbal control more advanced and proactive, reduce delays, and improve tracking stability. It can compare and analyze the three-dimensional face coordinate system with the current center posture of the gimbal, calculate the posture correction range required for the face, accurately analyze the posture deviation of the face relative to the gimbal, and provide a basis for the subsequent precise adjustment of the gimbal, ensuring that the gimbal can closely track the center of the face. According to the posture error of the face relative to the gimbal, it can calculate the specific correction parameters required by the gimbal, accurately calculate the adjustment amount required for the gimbal, and ensure that the gimbal can track the center posture of the face in a timely and accurate manner, reduce tracking errors, and combine the prediction of the face movement trend to optimize the gimbal orientation adjustment strategy. It can construct a gimbal orientation prediction control model, which can predict the movement of the face in advance, actively adjust the gimbal orientation, realize automatic tracking of the face center, and improve the stability and real-time performance of tracking. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of the steps of a pan / tilt position control method of the present invention;

[0023] Figure 2 Detailed implementation flow chart of step S1;

[0024] Figure 3Detailed implementation flow chart of step S2;

[0025] Figure 4 Detailed implementation flow chart of step S3. DETAILED DESCRIPTION

[0026] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0027] The present application example provides a pan-tilt position control method, device, equipment and storage medium. The execution subjects of the pan-tilt position control method, device, equipment and storage medium include but are not limited to the following: mechanical equipment, data processing platform, cloud server node, network upload equipment, etc. that are equipped with the system can be regarded as the general computing node of the present application, and the data processing platform includes but is not limited to: at least one of an audio and image management system, an information management system, and a cloud data management system.

[0028] See also Figures 1 to 4 The present invention provides a pan-tilt position control method, the pan-tilt position control method comprising the following steps:

[0029] Step S1: performing real-time face tracking and recognition based on a camera to obtain a real-time multi-directional face image; performing facial feature point recognition on the real-time multi-directional face image to obtain facial feature points; performing affine geometric correction processing on the real-time multi-directional face image according to the facial feature points to obtain a corrected multi-directional face image;

[0030] Step S2: obtaining a target positioning coordinate system based on the corrected multi-directional face image; performing multi-directional pixel point inverse calculation on the face feature points to obtain pixel point matching relationship data; performing feature point positioning mapping processing on the target positioning coordinate system based on the pixel point matching relationship data to construct a three-dimensional face coordinate system;

[0031] Step S3: performing movement trajectory analysis based on the three-dimensional face coordinate system to obtain the dynamic movement trajectory of the face; performing movement trend prediction on the dynamic movement trajectory of the face to obtain face movement trend prediction data;

[0032] Step S4: obtaining the current center posture parameters of the gimbal; performing precise position and posture recognition of the face in the three-dimensional face coordinate system, thereby obtaining precise position and posture parameters; performing posture offset difference calculation on the precise position and posture parameters based on the current center posture parameters of the gimbal, and generating a gimbal posture correction range value;

[0033] Step S5: performing posture error calculation on the gimbal posture correction range value to obtain a gimbal posture correction parameter output value; and obtaining face center posture recognition data according to the gimbal posture correction parameter output value;

[0034] Step S6: Dynamically track and adjust the face center posture recognition data to obtain a dynamic adjustment strategy for the gimbal position; dynamically predict and optimize the dynamic adjustment strategy for the gimbal position based on the face movement trend prediction data, thereby constructing a gimbal position prediction control model to perform gimbal position control operations.

[0035] The present invention obtains the user's face image in real time through the camera, and can cover multiple azimuth angles, including different head postures such as the front and side, enhance the system's adaptability to changes in head posture, and use the face key points to perform affine transformation correction, effectively eliminate the geometric distortion of the face image in terms of rotation, translation, etc., improve the accuracy and stability of subsequent face analysis and tracking, and construct a three-dimensional face coordinate system based on the pixel coordinates of the detected face key points in the image by mapping to the target positioning coordinate system. The three-dimensional coordinate system can more accurately express the position and posture information of the face in space, and can better support the tracking of complex movements such as head rotation and translation compared to the two-dimensional plane coordinate system. By analyzing the dynamic movement trajectory of the face in the three-dimensional coordinate system, the future movement trend of the face is predicted, providing a basis for pan / tilt control, and accurately predicting the movement trend of the face. It can make the gimbal control more advanced and proactive, reduce delays, and improve tracking stability. It can compare and analyze the three-dimensional face coordinate system with the current center posture of the gimbal, calculate the posture correction range required for the face, accurately analyze the posture deviation of the face relative to the gimbal, and provide a basis for the subsequent precise adjustment of the gimbal, ensuring that the gimbal can closely track the center of the face. According to the posture error of the face relative to the gimbal, it can calculate the specific correction parameters required by the gimbal, accurately calculate the adjustment amount required for the gimbal, and ensure that the gimbal can track the center posture of the face in a timely and accurate manner, reduce tracking errors, and combine the prediction of the face movement trend to optimize the gimbal orientation adjustment strategy. It can construct a gimbal orientation prediction control model, which can predict the movement of the face in advance, actively adjust the gimbal orientation, realize automatic tracking of the face center, and improve the stability and real-time performance of tracking.

[0036] In the embodiment of the present invention, refer to Figure 1 , is a schematic flow chart of the steps of a pan-tilt position control method of the present invention. In this example, the steps of the pan-tilt position control method include:

[0037] Step S1: performing real-time face tracking and recognition based on a camera to obtain a real-time multi-directional face image; performing facial feature point recognition on the real-time multi-directional face image to obtain facial feature points; performing affine geometric correction processing on the real-time multi-directional face image according to the facial feature points to obtain a corrected multi-directional face image;

[0038] In this embodiment, after obtaining system and user authorization, a camera is used to collect real-time video streams, and a face detection and tracking algorithm is used to perform real-time recognition and tracking of faces in the video. Face detection and tracking are performed based on facial features, color, texture, etc., and the face position and tracking status can be updated in real time in the video. A face key point detection algorithm (such as Dlib, FaceNet, etc.) is used to identify important feature points of the face for the detected face image. These feature points usually include the coordinates of key positions such as the corners of the eyes, eyebrows, nose, and corners of the mouth. The feature point coordinate data of each face image is obtained. According to the coordinate information of the face feature points, the original face image is geometrically corrected using the mathematical method of affine transformation. The affine transformation eliminates geometric distortion caused by factors such as camera angle and face rotation. After geometric correction, a regular and standardized face image is obtained.

[0039] Step S2: obtaining a target positioning coordinate system based on the corrected multi-directional face image; performing multi-directional pixel point inverse calculation on the face feature points to obtain pixel point matching relationship data; performing feature point positioning mapping processing on the target positioning coordinate system based on the pixel point matching relationship data to construct a three-dimensional face coordinate system;

[0040] In this embodiment, a target positioning coordinate system is determined based on the corrected multi-directional face image. This coordinate system is a virtual three-dimensional coordinate system used to represent the position and posture of the face. The face feature points in the corrected multi-directional face image are subjected to pixel point inverse calculation. The pixel position of the feature point in the original image is obtained by inversely calculating the coordinate position of the feature point and the pixel information of the image. The pixel position of the feature point in the original image is obtained by multi-directional pixel point inverse calculation. These pixel position data are saved to form pixel point matching relationship data. These data describe the pixel position relationship of the feature point in different orientations. Using the pixel point matching relationship data, the feature points in the target positioning coordinate system are mapped to the pixel position in the original image. The corresponding position of the feature point in the original image is obtained by interpolating or mapping the pixel position of the feature point in the original image. A three-dimensional face coordinate system is constructed based on the pixel position of the feature point in the original image and the target positioning coordinate system. The position and posture of the face in the three-dimensional coordinate system are determined by mapping the pixel position of the feature point to the three-dimensional space.

[0041] Step S3: performing movement trajectory analysis based on the three-dimensional face coordinate system to obtain the dynamic movement trajectory of the face; performing movement trend prediction on the dynamic movement trajectory of the face to obtain face movement trend prediction data;

[0042] In this embodiment, the dynamic movement trajectory of the face is analyzed using the feature point position data in the three-dimensional face coordinate system. The movement trajectory of the face in the three-dimensional space is obtained by calculating the position changes of the feature points in the time series. The movement trend of the dynamic movement trajectory of the face is predicted to infer the future movement direction and trend of the face. This is achieved by applying a machine learning algorithm or a time series analysis method. The prediction result is the movement trend data such as the position, speed, acceleration, etc. of the face in the three-dimensional space. The face movement trend prediction data is obtained. These data describe the movement trend and possible future position of the face in the three-dimensional space. The prediction result is saved in the form of data for subsequent application and analysis.

[0043] Step S4: obtaining the current center posture parameters of the gimbal; performing precise position and posture recognition of the face in the three-dimensional face coordinate system, thereby obtaining precise position and posture parameters; performing posture offset difference calculation on the precise position and posture parameters based on the current center posture parameters of the gimbal, and generating a gimbal posture correction range value;

[0044] In this embodiment, the current center posture parameters of the gimbal are obtained, and these parameters describe the current orientation and angle of the gimbal. These parameters are obtained by the sensor or control system of the gimbal device. The feature point position data in the three-dimensional face coordinate system is used to perform precise position and posture recognition of the face. The precise position and posture parameters of the face are obtained by analyzing the position and posture of the feature points in the three-dimensional space. The precise position and posture parameters of the face are obtained through precise position and posture recognition of the face. These parameters include the three-dimensional coordinate position, rotation angle, tilt angle, etc. of the face. The current center posture parameters of the gimbal are compared with the precise position and posture parameters of the face, and the difference between them is calculated by calculating the rotation angle difference, tilt angle difference, etc. Based on the result of the posture offset difference calculation, the gimbal posture correction range values ​​are generated. These range values ​​describe the posture range that the gimbal needs to correct so that its orientation and angle match the precise position and posture of the face.

[0045] Step S5: performing posture error calculation on the gimbal posture correction range value to obtain a gimbal posture correction parameter output value; and obtaining face center posture recognition data according to the gimbal posture correction parameter output value;

[0046] In this embodiment, the gimbal posture correction range value is compared with the center posture of the face to calculate the posture error between the two. This involves calculating the rotation angle error, the tilt angle error, etc. Based on the result of the posture error calculation, the gimbal posture correction parameter output value is obtained. These parameters describe the posture correction that the gimbal needs to make to match the center posture of the face. The center posture of the face is identified using the gimbal posture correction parameter output value. By applying the gimbal posture correction parameter to the center posture of the face, the corrected center posture data of the face is obtained.

[0047] Step S6: Dynamically track and adjust the face center posture recognition data to obtain a dynamic adjustment strategy for the gimbal position; dynamically predict and optimize the dynamic adjustment strategy for the gimbal position based on the face movement trend prediction data, thereby constructing a gimbal position prediction control model to perform gimbal position control operations.

[0048] In this embodiment, dynamic orientation tracking and adjustment is performed based on the face center posture recognition data, and the gimbal is adjusted in real time to keep its direction and angle consistent with the face center posture. By continuously tracking the center position and posture changes of the face, the gimbal adjusts its own orientation in real time to always align with the center of the face. The face movement trend prediction data is used to dynamically predict and optimize the gimbal orientation dynamic adjustment strategy. By analyzing the face movement trend, the future position changes of the face are predicted. Based on these prediction results, the gimbal orientation adjustment strategy is optimized to align with the face position in advance to achieve more accurate tracking. Based on the face movement trend prediction data and dynamic adjustment strategy optimization, a gimbal orientation prediction control model is constructed. The model calculates the gimbal orientation control command according to the face movement trend and the optimized adjustment strategy. In this way, the gimbal performs orientation control operations according to the guidance of the model to achieve accurate tracking of the face.

[0049] In this embodiment, refer to Figure 2 , is a flowchart of detailed implementation steps of step S1. In this embodiment, the detailed implementation steps of step S1 include:

[0050] Step S11: performing real-time face tracking and recognition based on the camera to obtain real-time multi-directional face images;

[0051] Step S12: performing histogram brightness enhancement processing on the real-time multi-directional face image to obtain a brightness enhanced multi-directional image;

[0052] Step S13: performing facial feature point recognition on the brightness enhanced multi-directional image to obtain facial feature points;

[0053] Step S14: performing feature point affine transformation calculation on the facial feature points based on a preset standard face model, thereby obtaining an affine transformation matrix;

[0054] Step S15: performing affine geometric correction processing on the brightness enhanced multi-directional image according to the affine transformation matrix to obtain a corrected multi-directional face image.

[0055] In this embodiment, a camera is used to collect a video stream, and a face tracking algorithm is used to perform real-time recognition and tracking of faces in the video. This involves using a facial detection algorithm to locate and recognize faces, and using a face tracking algorithm to track the position and posture changes of faces in the video. During the face tracking process, the recognized faces are extracted from the video stream to obtain real-time multi-directional face images, which contain multiple perspectives of the faces at different angles and postures. Each real-time multi-directional face image is processed by histogram equalization or other brightness enhancement algorithms to improve the contrast and brightness of the image, and obtain better image quality under different lighting conditions. The real-time multi-directional face images that have been subjected to brightness enhancement processing are saved or output to obtain brightness enhanced multi-directional images. These images have better visual effects and image quality, which are beneficial to subsequent facial feature point recognition and affine geometric correction processing. A facial key point detection algorithm or a facial feature point detection algorithm is used to locate feature points of faces in the brightness enhanced multi-directional images. The method comprises the following steps: positioning and identifying feature points, wherein the feature points include the coordinate information of key positions such as eyes, nose, and mouth, extracting the identified facial feature points, and saving or outputting the coordinate information of the feature points. The feature points will be used for subsequent affine transformation calculation and image correction processing. The standard face model and the identified facial feature points are used to perform affine transformation calculation of the feature points, including calculating the affine transformation matrix, which describes how to map the feature points in the standard face model to the positions of the actual facial feature points. The affine transformation matrix is ​​obtained from the feature point affine transformation calculation, which describes the transformation relationship between mapping the feature points in the standard face model to the actual facial feature points. Affine geometric correction processing is performed on the brightness enhanced multi-directional image, and the shape and posture of the image are corrected by applying the affine transformation to each pixel in the image. Each pixel in the brightness enhanced multi-directional image is transformed according to the affine transformation matrix, and the corrected pixel value is calculated by an interpolation algorithm to obtain a corrected multi-directional face image.

[0056] In this embodiment, refer to Figure 3 , is a flowchart of detailed implementation steps of step S2. In this embodiment, the detailed implementation steps of step S2 include:

[0057] Step S21: performing bilinear interpolation resampling on the corrected multi-directional face image to generate a standardized multi-directional face image;

[0058] Step S22: pre-calibrating the facial feature points based on the multi-directional facial images to obtain a target positioning coordinate system;

[0059] Step S23: performing multi-directional pixel point inverse calculation on the facial feature points to obtain pixel point matching relationship data;

[0060] Step S24: performing spatial geometric triangulation reverse projection on the facial feature points based on the pixel point matching relationship data to generate spatial coordinate values ​​of the feature points;

[0061] Step S25: Based on the spatial coordinate values ​​of the feature points, the facial feature points are mapped to the target positioning coordinate system to construct a three-dimensional facial coordinate system.

[0062] In this embodiment, bilinear interpolation resampling is performed on the corrected multi-directional facial image. The size and resolution of the image are adjusted to a fixed standard size by performing interpolation calculation on the pixels of the image. Resampling can maintain the smoothness and details of the image and ensure the consistency between different images. Standardized multi-directional facial images after bilinear interpolation resampling are obtained. These images have a fixed size and resolution, and provide consistent input for subsequent facial feature point pre-calibration and spatial geometry calculation. A preset facial feature point coordinate system is used to perform system pre-calibration on the facial feature points in the multi-directional facial image. This is achieved by calculating the position and posture transformation relationship of the feature points relative to the image. Facial feature points after system pre-calibration and a target positioning coordinate system associated with the system are obtained. The target positioning coordinate system provides a consistent reference frame for subsequent pixel matching relationship calculation and three-dimensional coordinate reconstruction. For each facial feature point, a pixel inverse calculation is performed in the standardized multi-directional facial image. The calculation is achieved by mapping the coordinates of the facial feature points back to the pixel positions in the original multi-directional image, and obtaining pixel matching relationship data, including the pixel position of each feature point in the original multi-directional image. These data will be used for subsequent spatial geometric triangular inverse projection and feature point positioning mapping processing. The spatial geometric triangular inverse projection calculation is performed on the facial feature points using the pixel matching relationship data. This is achieved by converting the pixel matching relationship into coordinate values ​​in three-dimensional space. The triangular inverse projection algorithm calculates the coordinates of the feature points in three-dimensional space based on known pixel points and camera parameters, and maps the spatial coordinate values ​​of the feature points to the target positioning coordinate system to achieve the positioning of the feature points. This is achieved by performing coordinate transformation and mapping calculations on the spatial coordinate values ​​of the feature points, and constructing a three-dimensional face coordinate system, which contains the exact positions of the feature points in the target positioning coordinate system. This three-dimensional face coordinate system provides complete three-dimensional face structure information for further face analysis, recognition or other applications.

[0063] In this embodiment, refer to Figure 4 , is a flowchart of detailed implementation steps of step S3. In this embodiment, the detailed implementation steps of step S3 include:

[0064] Step S31: performing dynamic optical flow tracking processing on the standardized multi-directional face image based on the three-dimensional face coordinate system to obtain the face time series coordinate value;

[0065] Step S32: analyzing the movement trajectory of the face time series coordinate values ​​to obtain the dynamic movement trajectory of the face;

[0066] Step S33: calculating the time series movement speed of the dynamic movement trajectory of the face to obtain a movement speed characteristic parameter;

[0067] Step S34: predicting the movement trend of the dynamic movement trajectory of the face based on the movement speed characteristic parameters, thereby obtaining face movement trend prediction data.

[0068] In this embodiment, the standardized multi-directional face image is subjected to dynamic optical flow tracking processing. Dynamic optical flow tracking is a method for calculating the motion vector of pixel points in an image in a time series. By analyzing the motion pattern in the image, the time series coordinate values ​​of the face between different frames are obtained. The time series coordinate values ​​of the face between different frames are obtained. These time series coordinate values ​​describe the motion trajectory of the face in time, which provides a basis for subsequent movement trajectory analysis and speed calculation. The movement trajectory analysis is performed on the face time series coordinate values ​​by calculating the displacement and direction of the face at different time points. The movement trajectory analysis reveals the movement pattern and path of the face, obtains the dynamic movement trajectory of the face, and describes the movement path of the face in time. These trajectory data are used for subsequent speed calculation and movement trend prediction. The time series movement speed of the dynamic movement trajectory of the face is calculated by calculating the ratio of the displacement of the face at different time points to the time interval. The movement speed reflects the movement rate of the face in time, and the characteristic parameters of the movement speed are obtained, including the average speed, maximum speed, minimum speed, etc. These characteristic parameters provide a quantitative description of the face movement speed and provide a basis for the subsequent movement trend prediction. Based on the movement speed characteristic parameters and the dynamic movement trajectory of the face, the movement trend prediction is performed. By analyzing the speed change trend, acceleration and other parameters, the future movement direction and path of the face are inferred, and the face movement trend prediction data is obtained, which describes the movement trend of the face in the future. These data are used to identify the behavioral characteristics of the face, predict the target position of the face, and other application scenarios.

[0069] In this embodiment, step S4 includes the following steps:

[0070] Step S41: Obtain the current center posture parameters of the gimbal;

[0071] Step S42: performing accurate face position and posture recognition on the three-dimensional face coordinate system, thereby obtaining accurate position and posture parameters;

[0072] Step S43: performing center attitude offset calculation on the precise position attitude parameter based on the current center attitude parameter of the gimbal to obtain the gimbal attitude offset value;

[0073] Step S44: performing attitude offset differential calculation on the current center attitude parameter of the gimbal based on the gimbal attitude offset value to generate a gimbal attitude correction range value.

[0074] In this embodiment, the current center posture parameters of the gimbal are obtained through the gimbal control system or sensor. These parameters describe the current orientation, angle, position and other information of the gimbal. The precise position and posture of the face are recognized in the three-dimensional face coordinate system. By using a face recognition algorithm, a deep learning model or other related technologies, the position and posture of the face are accurately located and recognized from the input image or video, and the precise position and posture parameters of the face are obtained, including information such as position coordinates, rotation angle, and scaling ratio. These parameters describe the precise position and posture of the face in the three-dimensional space. The center posture offset calculation is performed on the current center posture parameters of the gimbal and the precise position posture parameters. By comparing the difference between the two, the posture offset value of the gimbal is calculated to obtain the posture offset value of the gimbal, which describes the difference between the current center posture of the gimbal and the precise position posture of the face. The posture offset difference calculation is performed on the current center posture parameters of the gimbal. By applying the posture offset value to the current center posture parameters of the gimbal, the range of posture correction is obtained.

[0075] In this embodiment, step S5 includes the following steps:

[0076] Step S51: performing optimal posture correction analysis on the gimbal posture correction range value to obtain the gimbal optimal posture correction parameter;

[0077] Step S52: using the optimal posture correction parameters of the gimbal to perform posture adaptive correction simulation on the gimbal to obtain posture parameter correction simulation data;

[0078] Step S53: performing attitude error calculation on the attitude parameter correction simulation data based on the precise position attitude parameter to obtain the gimbal attitude correction parameter output value;

[0079] Step S54: adjusting the central visual recognition posture of the gimbal according to the output value of the gimbal posture correction parameter, thereby obtaining face central posture recognition data.

[0080] In this embodiment, the optimal posture correction analysis is performed on the gimbal posture correction range value, and the optimal posture correction parameters are determined based on predefined rules, algorithms or optimization methods. The posture adaptive correction simulation of the gimbal is performed using the optimal posture correction parameters of the gimbal, and the gimbal is controlled by the movement and adjustment of the gimbal so that the gimbal orientation and posture gradually approach the optimal correction value, and the posture parameter correction simulation data is obtained, which describes the posture change of the gimbal during the correction process. These data are used for subsequent posture error calculation and gimbal posture correction parameter output. The posture error calculation is performed based on the precise position posture parameter and the posture parameter correction simulation data, and the error between the current posture of the gimbal and the optimal correction posture is calculated by comparing the difference between the two, and the gimbal posture correction parameter output value is obtained, which describes the correction parameters that the gimbal needs to perform under the current posture. These values ​​are used to guide the posture adjustment of the gimbal. The gimbal is adjusted for central visual recognition according to the output value of the posture correction parameter of the gimbal, and the gimbal is controlled by the movement and adjustment of the gimbal so that the gimbal orientation and posture gradually approach the corrected target value, and the face center posture recognition data is obtained, which describes the face center posture after the gimbal posture adjustment. These data are used for subsequent applications, such as face tracking, face recognition, etc.

[0081] In this embodiment, step S6 includes the following steps:

[0082] Step S61: Dynamically tracking and adjusting the face center posture recognition data based on the face dynamic movement trajectory to obtain a dynamic adjustment strategy for the pan / tilt position;

[0083] Step S62: performing gimbal posture prediction based on the face movement trend prediction data, thereby obtaining gimbal posture angle adjustment prediction data;

[0084] Step S63: Utilize the gimbal attitude angle adjustment prediction data to dynamically predict and optimize the gimbal orientation dynamic adjustment strategy, thereby constructing a gimbal orientation prediction control model to execute the gimbal orientation control operation.

[0085] In this embodiment, based on the face center posture recognition data, the dynamic movement trajectory of the face is analyzed, and the movement direction and speed of the face in space are calculated by comparing the posture data of consecutive frames. According to the dynamic movement trajectory of the face, the face center posture recognition data is dynamically tracked and adjusted. The rotation angle and speed of the pan-tilt are controlled so that the pan-tilt follows the movement of the face and keeps the face in the center position, and a dynamic adjustment strategy for the pan-tilt orientation is obtained. The rotation strategy and adjustment method of the pan-tilt when tracking the dynamic movement of the face are described. These strategies are used for subsequent pan-tilt orientation control. Based on the face movement trend prediction data, the pan-tilt posture is predicted. The posture angle that the pan-tilt needs to be adjusted is predicted by analyzing information such as the movement direction, speed and acceleration of the face, and the pan-tilt posture angle adjustment prediction data is obtained. The prediction method based on the face movement trend prediction is described. The gimbal attitude adjustment situation is obtained, and these data are used for the subsequent gimbal azimuth prediction control. Based on the gimbal attitude angle adjustment prediction data, the gimbal attitude dynamic adjustment strategy is dynamically predicted and optimized. This is achieved by analyzing the difference between the prediction data and the actual adjustment data, and optimizing the gimbal adjustment strategy and parameters to improve the prediction accuracy and the gimbal tracking performance. Based on the gimbal attitude angle adjustment prediction data, the gimbal attitude dynamic adjustment strategy is dynamically predicted and optimized. This is achieved by comparing the difference between the prediction data and the actual adjustment data, and optimizing the gimbal adjustment strategy and parameters to improve the prediction accuracy and the gimbal tracking performance. According to the optimized gimbal attitude dynamic adjustment strategy and prediction parameters, a gimbal attitude prediction control model is constructed to predict the gimbal azimuth adjustment, and the corresponding control strategy is executed to achieve accurate tracking and adjustment of the gimbal.

[0086] In this embodiment, a pan / tilt position control device is provided, comprising:

[0087] The geometric correction module is used to perform real-time face tracking and recognition based on the camera to obtain a real-time multi-directional face image; perform facial feature point recognition on the real-time multi-directional face image to obtain facial feature points; perform affine geometric correction processing on the real-time multi-directional face image according to the facial feature points to obtain a corrected multi-directional face image;

[0088] The feature point positioning module is used to obtain a target positioning coordinate system based on the corrected multi-directional face image; perform multi-directional pixel point inverse calculation on the face feature points to obtain pixel point matching relationship data; perform feature point positioning mapping processing on the target positioning coordinate system based on the pixel point matching relationship data to construct a three-dimensional face coordinate system;

[0089] The trend prediction module is used to analyze the movement trajectory based on the three-dimensional face coordinate system to obtain the dynamic movement trajectory of the face; and to predict the movement trend of the dynamic movement trajectory of the face to obtain the face movement trend prediction data;

[0090] The posture offset calculation module is used to obtain the current center posture parameters of the gimbal; perform precise position and posture recognition on the three-dimensional face coordinate system to obtain precise position and posture parameters; perform posture offset differential calculation on the precise position and posture parameters based on the current center posture parameters of the gimbal to generate the gimbal posture correction range value;

[0091] The posture correction module is used to calculate the posture error of the gimbal posture correction range value to obtain the gimbal posture correction parameter output value; and obtain the face center posture recognition data according to the gimbal posture correction parameter output value;

[0092] The gimbal control module is used to dynamically track and adjust the face center posture recognition data to obtain the gimbal orientation dynamic adjustment strategy; based on the face movement trend prediction data, the gimbal orientation dynamic adjustment strategy is dynamically predicted and optimized, thereby constructing a gimbal orientation prediction control model to perform gimbal orientation control operations.

[0093] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-mentioned gimbal orientation control methods when executing the computer program.

[0094] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned gimbal orientation control methods are implemented.

[0095] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.

[0096] The above is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A pan / tilt position control method, It is characterized in that The following steps are involved: Step S1: Perform real-time face tracking and recognition based on the camera to obtain a real-time multi-directional face image; perform facial feature point recognition on the real-time multi-directional face image to obtain facial feature points; perform affine geometric correction processing on the real-time multi-directional face image according to the facial feature points to obtain a corrected multi-directional face image; the specific steps of step S1 are: Step S11: performing real-time face tracking and recognition based on the camera to obtain real-time multi-directional face images; Step S12: performing histogram brightness enhancement processing on the real-time multi-directional face image to obtain a brightness enhanced multi-directional image; Step S13: performing facial feature point recognition on the brightness enhanced multi-directional image to obtain facial feature points; Step S14: performing feature point affine transformation calculation on the facial feature points based on a preset standard face model, thereby obtaining an affine transformation matrix; Step S15: performing affine geometric correction processing on the brightness enhanced multi-directional image according to the affine transformation matrix to obtain a corrected multi-directional face image; Step S2: obtaining a target positioning coordinate system based on the corrected multi-directional face image; performing multi-directional pixel point inverse calculation on the face feature points to obtain pixel point matching relationship data; Based on the pixel point matching relationship data, the target positioning coordinate system is mapped to the feature point positioning to construct a three-dimensional face coordinate system; the specific steps of step S2 are: Step S21: performing bilinear interpolation resampling on the corrected multi-directional face image to generate a standardized multi-directional face image; Step S22: pre-calibrating the facial feature points based on the multi-directional facial images to obtain a target positioning coordinate system; Step S23: performing multi-directional pixel point inverse calculation on the facial feature points to obtain pixel point matching relationship data; Step S24: performing spatial geometric triangulation reverse projection on the facial feature points based on the pixel point matching relationship data to generate spatial coordinate values ​​of the feature points; Step S25: performing feature point positioning mapping processing on the facial feature points to the target positioning coordinate system based on the spatial coordinate values ​​of the feature points to construct a three-dimensional facial coordinate system; Step S3: Perform movement trajectory analysis based on the three-dimensional face coordinate system to obtain the dynamic movement trajectory of the face; perform movement trend prediction on the dynamic movement trajectory of the face to obtain face movement trend prediction data; the specific steps of step S3 are: Step S31: performing dynamic optical flow tracking processing on the standardized multi-directional face image based on the three-dimensional face coordinate system to obtain the face time series coordinate value; Step S32: analyzing the movement trajectory of the face time series coordinate values ​​to obtain the dynamic movement trajectory of the face; Step S33: calculating the time series movement speed of the dynamic movement trajectory of the face to obtain a movement speed characteristic parameter; Step S34: predicting the movement trend of the dynamic movement trajectory of the face based on the movement speed characteristic parameter, thereby obtaining face movement trend prediction data; Step S4: obtaining the current center posture parameters of the gimbal; performing accurate face position posture recognition on the three-dimensional face coordinate system to obtain accurate position posture parameters; performing posture offset differential calculation on the accurate position posture parameters based on the current center posture parameters of the gimbal to generate the gimbal posture correction range value; the specific steps of step S4 are: Step S41: Obtain the current center posture parameters of the gimbal; Step S42: performing accurate face position and posture recognition on the three-dimensional face coordinate system, thereby obtaining accurate position and posture parameters; Step S43: performing center attitude offset calculation on the precise position attitude parameter based on the current center attitude parameter of the gimbal to obtain the gimbal attitude offset value; Step S44: performing attitude offset difference calculation on the current center attitude parameter of the gimbal based on the gimbal attitude offset value to generate a gimbal attitude correction range value; Step S5: performing posture error calculation on the gimbal posture correction range value to obtain the gimbal posture correction parameter output value; obtaining the face center posture recognition data according to the gimbal posture correction parameter output value; the specific steps of step S5 are: Step S51: performing optimal posture correction analysis on the gimbal posture correction range value to obtain the gimbal optimal posture correction parameter; Step S52: using the optimal posture correction parameters of the gimbal to perform posture adaptive correction simulation on the gimbal to obtain posture parameter correction simulation data; Step S53: performing attitude error calculation on the attitude parameter correction simulation data based on the precise position attitude parameter to obtain the gimbal attitude correction parameter output value; Step S54: adjusting the central visual recognition posture of the gimbal according to the output value of the gimbal posture correction parameter, thereby obtaining the central posture recognition data of the face; Step S6: Dynamically tracking and adjusting the face center posture recognition data to obtain a dynamic adjustment strategy for the pan / tilt position; Based on the face movement trend prediction data, the dynamic adjustment strategy of the gimbal position is dynamically predicted and optimized, so as to build a gimbal position prediction control model to perform gimbal position control operations.

2. The pan / tilt position control method according to claim 1, It is characterized in that The specific steps of step S6 are: Step S61: Dynamically tracking and adjusting the face center posture recognition data based on the face dynamic movement trajectory to obtain a dynamic adjustment strategy for the pan / tilt position; Step S62: performing gimbal posture prediction based on the face movement trend prediction data, thereby obtaining gimbal posture angle adjustment prediction data; Step S63: Utilize the gimbal attitude angle adjustment prediction data to dynamically predict and optimize the gimbal orientation dynamic adjustment strategy, thereby constructing a gimbal orientation prediction control model to execute the gimbal orientation control operation.

3. A pan / tilt position control device, It is characterized in that Used to execute the pan / tilt position control method as claimed in claim 1, comprising: The geometric correction module is used to perform real-time face tracking and recognition based on the camera to obtain a real-time multi-directional face image; perform facial feature point recognition on the real-time multi-directional face image to obtain facial feature points; perform affine geometric correction processing on the real-time multi-directional face image according to the facial feature points to obtain a corrected multi-directional face image; The feature point positioning module is used to obtain a target positioning coordinate system based on the corrected multi-directional face image; perform multi-directional pixel point inverse calculation on the face feature points to obtain pixel point matching relationship data; perform feature point positioning mapping processing on the target positioning coordinate system based on the pixel point matching relationship data to construct a three-dimensional face coordinate system; The trend prediction module is used to analyze the movement trajectory based on the three-dimensional face coordinate system to obtain the dynamic movement trajectory of the face; and to predict the movement trend of the dynamic movement trajectory of the face to obtain the face movement trend prediction data; The posture offset calculation module is used to obtain the current center posture parameters of the gimbal; perform precise position and posture recognition on the three-dimensional face coordinate system to obtain precise position and posture parameters; perform posture offset differential calculation on the precise position and posture parameters based on the current center posture parameters of the gimbal to generate the gimbal posture correction range value; The posture correction module is used to calculate the posture error of the gimbal posture correction range value to obtain the gimbal posture correction parameter output value; and obtain the face center posture recognition data according to the gimbal posture correction parameter output value; The gimbal control module is used to dynamically track and adjust the face center posture recognition data to obtain the gimbal orientation dynamic adjustment strategy; based on the face movement trend prediction data, the gimbal orientation dynamic adjustment strategy is dynamically predicted and optimized, thereby constructing a gimbal orientation prediction control model to perform gimbal orientation control operations.

4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the gimbal position control method described in any one of claims 1 to 2 are implemented.

5. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the gimbal position control method described in any one of claims 1 to 2 are implemented.