Control method and equipment of pan-tilt camera for patrol and medium
Through data preprocessing and coordinate system construction, combined with response ratio calculation and model optimization, the problem of instability of gimbal cameras in wind and sand environments is solved, and the equipment's long life and efficient monitoring effect is achieved.
Patent Information
- Application Number
- CN202411799801.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The existing gimbal camera control method for patrols is insufficient in wind and sand resistance in wind and sand environments, resulting in a decrease in monitoring stability and clarity, intensified mechanical wear, unreasonable rotation frequency, affecting the service life and working continuity of the equipment.
By obtaining the internal and external data of the gimbal camera for preprocessing, a spatial three-dimensional coordinate system is constructed, the response ratio is calculated, the angle rotation recognition and prediction model is constructed, a closed-loop control system is formed, the rotation angle is optimized, and the Kalman model and threshold segmentation method is used for Dynamic adjustment, regular verification and adjustment.
It realizes precise control of gimbal cameras in wind and sand environments, reduces wear, extends equipment life, improves monitoring efficiency and system stability, and ensures continuous and stable monitoring work.
Smart Images

Figure CN119270933A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pan / tilt camera control, and in particular to a control method, equipment and medium for a patrol pan / tilt camera. Background Art
[0002] The advantage of the existing control method of the PTZ camera for patrol is that it can realize remote and flexible monitoring, and improve the monitoring efficiency and coverage. However, the control method in the windy and sandy environment has obvious defects, mainly manifested in insufficient resistance to wind and sand, resulting in reduced monitoring stability and clarity. When faced with the problem of wind and sand, the existing control method is difficult to ensure continuous and stable operation. The invasion of wind and sand will accelerate mechanical wear and reduce image quality, thus affecting the detailed observation and recording of the scene.
[0003] Specifically, the problems of existing control methods in windy and sandy environments include: 1. Inaccurate judgment of the impact of wind and sand: In windy and sandy environments, existing sensors and data processing methods are difficult to accurately judge the impact of wind and sand on pan-tilt cameras, resulting in inaccurate control strategies. 2. Increased wear: Due to the lack of effective wear control strategies, wind and sand invasion will accelerate the wear of mechanical parts, affecting the service life and working stability of the equipment. 3. Unreasonable rotation frequency: The existing control method does not optimize the rotation frequency, resulting in frequent rotation of the equipment, increasing the risk of wear and affecting monitoring efficiency. In addition, in a windy and sandy environment, on-site maintenance is inconvenient, which directly affects the continuity of work and the integrity of the data. Therefore, the control and maintenance difficulties on-site in a windy and sandy environment seriously restrict the real-time and accuracy of the work. Summary of the invention
[0004] In order to overcome the shortcomings of the control and maintenance problems of a pan-tilt camera in a sandstorm environment, the present invention provides a control method, device and medium for a patrol pan-tilt camera.
[0005] The technical implementation scheme of the present invention is: a control method for a patrol pan-tilt camera, comprising the following steps: S1: Obtain the internal and external data of the PTZ camera and perform preprocessing, build a spatial stereo coordinate system based on the PTZ camera, and use the coordinate system to obtain the rotation data of the PTZ camera; S2: Control the initial rotation angle of the PTZ camera according to the internal data, and adjust the control rotation angle of the PTZ camera in combination with the external data; S3: constructing a pan-tilt camera angle rotation recognition model, and constructing a prediction model to calibrate the angle rotation model, and forming a closed loop of the pan-tilt camera rotation control system according to the calibration result; S4: Build a verification model for the pan-tilt camera control system, extract the rotation angle of the pan-tilt camera at regular intervals and make adjustments.
[0006] Preferably, the internal data and external data of the pan-tilt camera are obtained and preprocessed, a spatial stereo coordinate system is constructed based on the pan-tilt camera, and the rotation data of the pan-tilt camera is obtained using the coordinate system, including: the internal data of the pan-tilt camera includes the working cycle of the pan-tilt camera, the execution cycle of each rotation position of the pan-tilt camera, the execution time, and the waiting time; the external data of the pan-tilt camera includes the wind speed, wind and sand content, and wind and sand cycle in the working environment of the pan-tilt camera; the preprocessing includes cleaning the data, unifying the format, and performing standardization processing; the spatial stereo coordinate system is a spatial rectangular coordinate system constructed with the pan-tilt camera as the reference, the initial orientation of the pan-tilt camera as the Y-axis, the right side of the initial orientation as the X-axis, and the vertical upward direction as the Z-axis.
[0007] Preferably, the controlling the initial rotation angle of the pan-tilt camera according to the internal data and adjusting the control rotation angle of the pan-tilt camera in combination with the external data include: obtaining the first control rotation angle of the pan-tilt camera according to the waiting time, execution time and wind and sand cycle of each rotation position of the pan-tilt camera, specifically, firstly calculating the response ratio under the waiting time and execution time of the pan-tilt camera by a formula and defining it as the first response ratio, then obtaining the wind and sand cycle data, recalculating the response ratio of the pan-tilt camera by a formula according to the wind and sand cycle data and defining it as the second response ratio, wherein the second response ratio of the pan-tilt camera is calculated by the difference between the execution time, wind and sand cycle and waiting time of the pan-tilt camera, and selecting the rotation angle with the highest response ratio each time according to the calculation result, and if there are multiple rotation angles with the same response ratio, then selecting the rotation angle with the largest rotation angle of the pan-tilt camera; wherein the first response ratio calculation formula is as follows, ,in, is the first response ratio, For waiting time, is the execution time, and the second response ratio is calculated as follows: ,in, is the second response ratio, is the wind and sand cycle time, For waiting time, For execution time.
[0008] Preferably, the method comprises constructing a pan-tilt camera angle rotation recognition model, constructing a prediction model to calibrate the angle rotation model, and forming a closed loop of the pan-tilt camera rotation control system according to the calibration result, including: obtaining the execution cycle of the pan-tilt camera, a training set of wind speed and sand content data in the working environment of the pan-tilt camera, constructing a pan-tilt camera angle rotation recognition model, putting the training set data into the pan-tilt camera angle rotation recognition model, and obtaining a trained pan-tilt camera angle rotation recognition model, wherein the pan-tilt camera angle rotation recognition model comprises a Kalman model and a threshold segmentation method.
[0009] Preferably, the pan-tilt camera angle rotation recognition model includes a Kalman model and a threshold segmentation method, including: first predicting the rotation angle of the pan-tilt camera, and then performing threshold segmentation on the captured image during the rotation angle of the pan-tilt camera. If the prediction result meets the rotation angle within the execution cycle of the pan-tilt camera, and the threshold segmentation result of the captured image meets the image quality requirements of the pan-tilt camera under the current wind speed and wind and sand content conditions, then extracting the first response ratio data that has been adjusted according to the second response ratio, and controlling the rotation angle of the pan-tilt camera according to the rotation angle formula. The evaluation calculation formula is as follows: ,in, is the degree of reduction of the PTZ camera angle, is the first response ratio, is the wind speed, It is the wind sand content.
[0010] Preferably, the prediction model is constructed to calibrate the angle rotation model, and the rotation control system of the pan-tilt camera is formed into a closed loop according to the calibration result, including: obtaining a training set of rotation angle data of the pan-tilt camera, constructing a prediction model, inputting the training set data into the prediction model, and obtaining a trained prediction model; the prediction model includes a fuzzy reasoning model and an angle intervention time judgment method, wherein the prediction model is first used to perform fuzzy reasoning on the rotation angle of the pan-tilt camera, and if the operating angle of the pan-tilt camera meets the expectation, the angle intervention judgment is used to correct the rotation angle of the pan-tilt camera, and at the same time the entire control system is formed into a closed loop; wherein the angle intervention time judgment method is to obtain the pan-tilt camera using a spatial stereo coordinate system The direction of the PTZ camera’s operation. If the PTZ camera has no downward operation process within a cycle starting from time t, the image within the shooting range of the PTZ camera is extracted, and after analysis using the threshold segmentation method, the impact of wind and sand in the working environment of the PTZ camera is predicted based on the RNN model, and the intervention time of the evaluation calculation formula is determined based on the prediction result. If the PTZ camera has a downward operation process within a cycle starting from time t, the data of adjusting the angle according to the evaluation calculation formula during the historical downward operation process is extracted, the data is arranged in a phased decreasing number, and the first k moments of the operating angle that causes the greatest harm to the PTZ camera in the arranged data are extracted as the intervention time of the evaluation calculation formula.
[0011] Preferably, the verification model of the pan-tilt camera control system is constructed, and the angle rotation of the pan-tilt camera is periodically extracted and adjusted, including: obtaining a training set of rotation angle data of each pan-tilt camera in a spatial stereo coordinate system, constructing a verification model, inputting the training set data into the verification model, and obtaining a trained verification model; using the verification model to verify the angle rotation data during the rotation of the pan-tilt camera, and periodically extracting the angle rotation of the pan-tilt camera for adjustment.
[0012] Preferably, the verification model is used to verify various types of data during the rotation of the pan-tilt camera, and the angle rotation of the pan-tilt camera is periodically extracted for adjustment, including: various types of data include the initial position point, rotation terminal position point, and rotation execution time of the pan-tilt camera; the initial position point, rotation terminal position point, and rotation execution time constitute a data set, the data set is classified according to the number of repetitions from large to small, the time is randomly extracted according to the number from small to large, and then the rotation angle of the pan-tilt camera is adjusted again according to the verification and extraction results.
[0013] A terminal device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a control method for a patrol pan-tilt camera described in any one of the above technical solutions is implemented.
[0014] A computer-readable storage medium stores a computer program, which, when executed by a processor, is used to implement a control method for a patrol pan-tilt camera according to any one of the above technical solutions.
[0015] Beneficial effects: The present invention eliminates noise and inconsistency in the data through data preprocessing and coordinate system construction, provides a clean and standardized data source for subsequent steps, and constructs a spatial rectangular coordinate system based on the pan-tilt camera, clarifies the position of the pan-tilt camera in three-dimensional space, and ensures the precise control of the rotation angle of the pan-tilt camera; through response ratio calculation and rotation optimization, it avoids rotation operation during the wind and sand cycle, reduces equipment wear and extends the service life of the equipment; uses the Kalman model and threshold segmentation method to achieve dynamic adjustment of the rotation angle, ensures the best monitoring effect of the pan-tilt camera in different wind and sand environments, and realizes the fuzzy reasoning model through the fuzzy reasoning model. An intelligent control strategy was implemented to improve the robustness and adaptability of the system; the stability and accuracy of the control system were ensured through regular verification and adjustment, and the working efficiency of the PTZ camera was further improved; the evaluation calculation formula was used to realize the change of the rotation angle of the PTZ camera as the wind and sand changed in a windy and sandy environment; the angle intervention time judgment method was used to avoid unnecessary angle reduction when the wind and sand had a small impact, ensuring the normal operation of the equipment under initial conditions; finally, the present invention not only improved the monitoring efficiency, optimized the performance of the equipment, and ensured the best monitoring effect in a windy and sandy environment, but also extended the service life of the equipment, and realized continuous and stable monitoring work. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart of a control method, device and medium for a patrol pan-tilt camera of the present invention; Figure 2 It is a logic diagram of a first control method for controlling a rotation angle of the present invention; Figure 3 A logical schematic diagram of the pan / tilt camera angle adjustment based on the evaluation calculation formula of the present invention; Figure 4 It is a logical schematic diagram of the angle intervention time judgment method of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] A control method for a patrol pan-tilt camera, such as Figure 1 As shown, the following steps are included: S1: Obtain the internal and external data of the PTZ camera and perform preprocessing, build a spatial stereo coordinate system based on the PTZ camera, and use the coordinate system to obtain the rotation data of the PTZ camera; S2: Control the initial rotation angle of the PTZ camera according to the internal data, and adjust the control rotation angle of the PTZ camera in combination with the external data; S3: constructing a pan-tilt camera angle rotation recognition model, and constructing a prediction model to calibrate the angle rotation model, and forming a closed loop of the pan-tilt camera rotation control system according to the calibration result; S4: Build a verification model for the pan-tilt camera control system, extract the rotation angle of the pan-tilt camera at regular intervals and make adjustments.
[0019] The internal and external data of the pan-tilt camera are obtained and preprocessed, a spatial stereo coordinate system is constructed based on the pan-tilt camera, and the rotation data of the pan-tilt camera is obtained using the coordinate system, including: the internal data of the pan-tilt camera includes the working cycle of the pan-tilt camera, the execution cycle of each rotation position of the pan-tilt camera, the execution time, and the waiting time; the external data of the pan-tilt camera includes the wind speed, wind and sand content, and wind and sand cycle in the working environment of the pan-tilt camera; the preprocessing includes cleaning the data, unifying the format, and performing standardization processing; the spatial stereo coordinate system is a spatial rectangular coordinate system constructed with the pan-tilt camera as the reference, the initial orientation of the pan-tilt camera as the Y-axis, the right side of the initial orientation as the X-axis, and the vertical upward direction as the Z-axis.
[0020] Further explanation is, data cleaning and standardization: the data preprocessing stage includes cleaning, unified format and standardization processing, which ensures the reliability and accuracy of subsequent processing. This helps to eliminate noise and inconsistency in the data and provide a clean and standardized data source for subsequent steps. Three-dimensional spatial positioning: the spatial rectangular coordinate system is constructed to clarify the three-dimensional spatial position of the PTZ camera, which is convenient for subsequent precise control. This makes the control more intuitive and effective, ensuring the precise movement of the PTZ camera in different environments. Data integration: combining internal data (such as working cycle, execution cycle, execution time and waiting time) with external data (such as wind speed, wind sand content, wind sand cycle) provides comprehensive data support for subsequent response ratio calculation. Coordinate system construction: the spatial rectangular coordinate system is constructed based on the PTZ camera, which clarifies the position of the PTZ camera in three-dimensional space, which is convenient for subsequent precise control and dynamic adjustment. This makes the control of the PTZ camera in different environments more accurate. System reliability: through data preprocessing and coordinate system construction, the reliability and stability of the system are improved, ensuring the continuous and stable operation of the PTZ camera in different environments. This helps to extend the service life of the equipment and reduce the number of repairs.
[0021] The initial rotation angle of the pan-tilt camera is controlled according to internal data, and the control rotation angle of the pan-tilt camera is adjusted in combination with external data, including: obtaining the first control rotation angle of the pan-tilt camera according to the waiting time, execution time and wind and sand cycle of each rotation position of the pan-tilt camera, specifically, firstly calculating the response ratio under the waiting time and execution time of the pan-tilt camera by a formula and defining it as the first response ratio, then obtaining the wind and sand cycle data, recalculating the response ratio of the pan-tilt camera by a formula according to the wind and sand cycle data and defining it as the second response ratio, wherein the second response ratio of the pan-tilt camera is calculated by the difference between the execution time, wind and sand cycle and waiting time of the pan-tilt camera, and selecting the rotation angle with the highest response ratio each time according to the calculation result, if there are multiple rotation angles with the same response ratio, then selecting the rotation angle with the largest rotation angle of the pan-tilt camera; wherein the first response ratio calculation formula is as follows, ,in, is the first response ratio, For waiting time, is the execution time, and the second response ratio is calculated as follows: ,in, is the second response ratio, is the wind and sand cycle time, For waiting time, For execution time.
[0022] A further explanation is that, through the second response ratio, when the waiting time of the PTZ camera coincides with the wind and sand cycle time, the waiting time of the PTZ camera is shortened or delayed, thereby achieving the purpose of early rotation or delayed rotation of the PTZ camera. For example, assuming that the wind and sand cycle is 1-8, 9-11 in the morning, 2-3, 6-8 in the afternoon, and the waiting execution time of the PTZ camera is 8-9, 10-11 in the morning, 3-4, 6-7 in the afternoon, then the coincidence time in the morning is 10-11, and the coincidence time in the afternoon is 6-7. The waiting execution time of the coincidence time is shortened by the second response ratio. Advance or delay execution to avoid operating the PTZ camera during the wind and sand cycle; at the same time, assuming that there are N second response ratio data of 1, 2, and 3 respectively, they are executed in advance in descending order; if it is assumed that there are N identical second response ratio data of 2, 2, and 2 respectively, the waiting execution time with the largest rotation angle is prioritized for early execution; the execution cycle of the PTZ camera that coincides with the wind and sand cycle is regulated by the second response ratio, and the specific rotation priority is classified to avoid damage to the PTZ camera caused by the operation of the PTZ camera during the wind and sand cycle.
[0023] Further explanation is that the waiting time of the second response ratio is the absolute value of the difference between the waiting time for the pan-tilt camera to perform the operation and the wind and sand cycle. The second response ratio is used to advance or delay the operating time of the pan-tilt camera with the same wind and sand cycle, thereby avoiding damage to the pan-tilt camera.
[0024] A pan-tilt camera angle rotation recognition model is constructed, and a prediction model is constructed to calibrate the angle rotation model. According to the calibration result, the rotation control system of the pan-tilt camera forms a closed loop, including: obtaining the execution cycle of the pan-tilt camera, the wind speed and sand content data training set in the working environment of the pan-tilt camera, constructing the pan-tilt camera angle rotation recognition model, putting the training set data into the pan-tilt camera angle rotation recognition model, and obtaining the trained pan-tilt camera angle rotation recognition model. The pan-tilt camera angle rotation recognition model includes a Kalman model and a threshold segmentation method.
[0025] Further explanation is that the rotation angle of the PTZ camera is predicted by the Kalman model, the image captured by the PTZ camera is analyzed by the threshold segmentation method, and the quality analysis of the image captured by the PTZ camera is obtained by the threshold segmentation method; the formulas used in the Kalman model include: the state prediction formula is as follows, , the error covariance prediction formula is as follows, , the Kalman gain formula is as follows, , the state update formula is as follows, , the error covariance update formula is as follows, ,in, Prediction of the pan / tilt camera rotation angle based on the previous moment information, : The prediction error covariance based on the information of the previous moment, : PTZ camera state transfer matrix, and : Control input matrix and control vector (such as the influence of wind and sand cycle), : Process noise covariance matrix (such as mechanical error of PTZ camera), : Kalman gain, : Observed value (such as the actual rotation angle detected by the sensor), : observation matrix (converts the state into observable form), : the observation noise covariance matrix (such as the noise level of the sensor), : Unit matrix; The threshold segmentation method is used to analyze the image quality taken by the PTZ camera. By setting a suitable threshold, the image is segmented into foreground and background to facilitate the evaluation of image quality; The Kalman model is used to predict the rotation angle of the PTZ camera to avoid misjudgment of the rotation change of the PTZ camera under the influence of vibration. The actual shooting effect of the PTZ camera is taken into account through the threshold segmentation calculation.
[0026] The PTZ camera angle rotation recognition model includes a Kalman model and a threshold segmentation method, including: first predicting the rotation angle of the PTZ camera, then performing threshold segmentation on the captured image during the rotation angle of the PTZ camera. If the prediction result is consistent with the rotation angle within the execution cycle of the PTZ camera and the threshold segmentation is consistent with the wind speed and sand content in the working environment of the PTZ camera, then extracting the first response ratio data modified by the second response ratio, and controlling the rotation angle of the PTZ camera according to the rotation angle formula. The evaluation calculation formula is as follows: ,in, is the degree of reduction of the PTZ camera angle, is the first response ratio, is the wind speed, It is the wind sand content.
[0027] A further explanation is that as the product of wind speed and wind sand content increases, the rotation angle of the pan-tilt camera continues to decrease until it reaches 0, thus preventing the pan-tilt camera from working in an environment with excessive wind and sand, and achieving the purpose of judging the degree of gradual reduction of the rotation angle of the pan-tilt camera under the influence of wind and sand; at the same time, it also achieves the purpose of gradually reducing the rotation angle of the pan-tilt camera as the product of wind speed and wind sand content increases; the evaluation calculation formula solves the problem of how the pan-tilt camera should adjust the angle under the influence of wind and sand cycle; by introducing the first response ratio formula, the effect of faster change of the rotation angle of the pan-tilt camera is achieved when the operation time of the pan-tilt camera is later and the execution time is shorter. The specific conclusion is that the later the rotation operation time (that is, the longer the waiting time) and the shorter the execution time, the smaller the change in the rotation angle.
[0028] A prediction model is constructed to calibrate the angle rotation model, and the rotation control system of the pan-tilt camera is closed-loop according to the calibration result, including: obtaining a training set of rotation angle data of the pan-tilt camera, constructing a prediction model, inputting the training set data into the prediction model, and obtaining a trained prediction model; the prediction model includes a fuzzy reasoning model and an angle intervention time judgment method, wherein the prediction model is first used to perform fuzzy reasoning on the rotation angle of the pan-tilt camera. If the operating angle of the pan-tilt camera meets the expectation, the angle intervention judgment is used to correct the rotation angle of the pan-tilt camera, and the entire control system is closed-loop; wherein the angle intervention time judgment method is to obtain the pan-tilt camera using the spatial stereo coordinate system If the PTZ camera has no downward operation process within a period starting from time t, the image within the shooting range of the PTZ camera is extracted, and after analysis using the threshold segmentation method, the impact of wind and sand in the working environment of the PTZ camera is predicted based on the RNN model, and the intervention time of the evaluation calculation formula is determined based on the prediction result; if the PTZ camera has a downward operation process within the period of time t, the data of adjusting the angle according to the evaluation calculation formula during the historical downward operation process is extracted, the data is arranged in a phased decreasing number, and the first k moments of the operating angle that causes the greatest harm to the PTZ camera in the arranged data are extracted as the intervention time of the evaluation calculation formula.
[0029] To further explain, the fuzzy reasoning model has the following benefits: 1. Nonlinear mapping capability: The fuzzy reasoning model can handle nonlinear relationships, such as the impact of wind speed and wind and sand content on the rotation angle of the PTZ camera. This nonlinear relationship is difficult to accurately model using traditional methods. 2. Strong fault tolerance: Even if there is a certain degree of error in the input data, accurate output results can be obtained. 3. High flexibility: The fuzzy reasoning model adjusts the fuzzy rules according to actual conditions, making the model more flexible and able to adapt to different environments and task requirements. 4. Easy to understand and maintain: The rules of the fuzzy reasoning model are expressed in the form of natural language, which is easy for humans to understand and is also convenient for maintenance and adjustment. 5. Dynamic adjustment: The fuzzy reasoning model dynamically adjusts the rotation angle of the PTZ camera based on real-time data to ensure the best monitoring effect in different wind and sand environments.
[0030] Further explanation is that the role of the angle intervention time judgment method is to avoid adjusting the angle of the gimbal camera when the influence of wind and sand is small. The control methods of the gimbal camera are divided into two categories, that is, when the gimbal camera is not working downward, the quality of the image captured by the gimbal camera is utilized and predicted according to the RNN model, thereby achieving the purpose of accurately intervening the time of the gimbal camera when the angle changes.
[0031] A verification model of the pan-tilt camera control system is constructed, and the angle rotation of the pan-tilt camera is extracted and adjusted at regular intervals, including: obtaining a training set of rotation angle data of each pan-tilt camera in a spatial stereo coordinate system, constructing a verification model, inputting the training set data into the verification model, and obtaining a trained verification model; using the verification model to verify the angle rotation data during the rotation of the pan-tilt camera, and regularly extracting the angle rotation of the pan-tilt camera for adjustment.
[0032] The verification model is used to verify various types of data during the rotation of the pan-tilt camera, and the angle rotation of the pan-tilt camera is periodically extracted for adjustment, including: various types of data include the initial position point, rotation terminal position point, and rotation execution time of the pan-tilt camera; the initial position point, rotation terminal position point, and rotation execution time constitute a data set, and the data set is classified according to the number of repetitions from large to small. The time is randomly extracted from small to large according to the number, and then the rotation angle of the pan-tilt camera is adjusted again according to the verification and extraction results.
[0033] A terminal device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements a control method for a patrol pan-tilt camera as described in any one of the above technical solutions when executing the computer program.
[0034] A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, it is used to implement a control method for a patrol pan-tilt camera described in any one of the above technical solutions.
[0035] The above is a detailed introduction to the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A control method for a patrol pan-tilt camera, characterized in that: The following steps are involved: S1: Obtain the internal and external data of the PTZ camera and perform preprocessing, build a spatial stereo coordinate system based on the PTZ camera, and use the coordinate system to obtain the rotation data of the PTZ camera; S2: Control the initial rotation angle of the PTZ camera according to the internal data, and adjust the control rotation angle of the PTZ camera in combination with the external data; S3: constructing a pan-tilt camera angle rotation recognition model, and constructing a prediction model to calibrate the angle rotation model, and forming a closed loop of the pan-tilt camera rotation control system according to the calibration result; S4: Build a verification model for the pan-tilt camera control system, extract the rotation angle of the pan-tilt camera at regular intervals and make adjustments.
2. The control method of a patrol pan-tilt camera according to claim 1, characterized in that: The method obtains the internal data and external data of the pan-tilt camera and performs preprocessing, constructs a spatial stereo coordinate system based on the pan-tilt camera, and uses the coordinate system to obtain the rotation data of the pan-tilt camera, including: the internal data of the pan-tilt camera includes the working cycle of the pan-tilt camera and the execution cycle, execution time, and waiting time of each rotation position of the pan-tilt camera; the external data of the pan-tilt camera includes the wind speed, wind and sand content, and wind and sand cycle in the working environment of the pan-tilt camera; the preprocessing includes cleaning the data, unifying the format, and performing standardization processing; the spatial stereo coordinate system is a spatial rectangular coordinate system constructed with the pan-tilt camera as the reference, the initial orientation of the pan-tilt camera as the Y axis, the right side of the initial orientation as the X axis, and the vertical upward direction as the Z axis.
3. The control method of a patrol pan-tilt camera according to claim 1, characterized in that: The method of controlling the initial rotation angle of the pan-tilt camera according to internal data and adjusting the control rotation angle of the pan-tilt camera in combination with external data includes: obtaining the first control rotation angle of the pan-tilt camera according to the waiting time, execution time and wind and sand cycle of each rotation position of the pan-tilt camera, specifically, firstly calculating the response ratio under the waiting time and execution time of the pan-tilt camera by a formula and defining it as the first response ratio, then obtaining the wind and sand cycle data, recalculating the response ratio of the pan-tilt camera by a formula according to the wind and sand cycle data and defining it as the second response ratio, wherein the second response ratio of the pan-tilt camera is calculated by the difference between the execution time, wind and sand cycle and waiting time of the pan-tilt camera, and selecting the rotation angle with the highest response ratio each time according to the calculation result, if there are multiple rotation angles with the same response ratio, then selecting the rotation angle with the largest rotation angle of the pan-tilt camera; wherein the first response ratio calculation formula is as follows, ,in, is the first response ratio, For waiting time, is the execution time, and the second response ratio is calculated as follows: ,in, is the second response ratio, is the wind and sand cycle time, For waiting time, For execution time.
4. The control method of a patrol pan-tilt camera according to claim 1, characterized in that: The method comprises: constructing a pan-tilt camera angle rotation recognition model, constructing a prediction model to calibrate the angle rotation model, and forming a closed loop of the pan-tilt camera rotation control system according to the calibration result, including: obtaining an execution cycle of the pan-tilt camera, a training set of wind speed and sand content data in the working environment of the pan-tilt camera, constructing a pan-tilt camera angle rotation recognition model, putting the training set data into the pan-tilt camera angle rotation recognition model, and obtaining a trained pan-tilt camera angle rotation recognition model, wherein the pan-tilt camera angle rotation recognition model comprises a Kalman model and a threshold segmentation method.
5. The control method of a patrol pan-tilt camera according to claim 4, characterized in that: The pan-tilt camera angle rotation recognition model includes a Kalman model and a threshold segmentation method, including: first predicting the rotation angle of the pan-tilt camera, and then performing threshold segmentation on the captured image during the rotation angle of the pan-tilt camera. If the prediction result meets the rotation angle within the execution cycle of the pan-tilt camera, and the threshold segmentation result of the captured image meets the image quality requirements of the pan-tilt camera under the current wind speed and wind and sand content conditions, then extracting the first response ratio data that has been adjusted according to the second response ratio, and controlling the rotation angle of the pan-tilt camera according to the rotation angle formula. The evaluation calculation formula is as follows: ,in, is the degree of reduction of the PTZ camera angle, is the first response ratio, is the wind speed, It is the wind sand content.
6. The control method of a patrol pan-tilt camera according to claim 4, characterized in that: The prediction model is constructed to calibrate the angle rotation model, and the rotation control system of the pan-tilt camera is formed into a closed loop according to the calibration result, including: obtaining a training set of rotation angle data of the pan-tilt camera, constructing a prediction model, inputting the training set data into the prediction model, and obtaining a trained prediction model; the prediction model includes a fuzzy reasoning model and an angle intervention time judgment method, wherein the prediction model is first used to perform fuzzy reasoning on the rotation angle of the pan-tilt camera, and if the operating angle of the pan-tilt camera meets the expectation, the rotation angle of the pan-tilt camera is corrected by using the angle intervention judgment, and the entire control system is formed into a closed loop; wherein the angle intervention time judgment method is to obtain the pan-tilt camera using the spatial stereo coordinate system Camera operation direction: If the PTZ camera has no downward operation process within a cycle starting from time t, the image within the shooting range of the PTZ camera is extracted, and after analysis using the threshold segmentation method, the impact of wind and sand in the working environment of the PTZ camera is predicted based on the RNN model, and the intervention time of the evaluation calculation formula is determined based on the prediction result; if the PTZ camera has a downward operation process within a cycle starting from time t, the data of adjusting the angle according to the evaluation calculation formula during the historical downward operation process is extracted, and the data is arranged in a phased manner. The first k moments of the operating angle that causes the greatest harm to the PTZ camera in the arranged data are extracted as the intervention time of the evaluation calculation formula.
7. The control method of a patrol pan-tilt camera according to claim 1, characterized in that: The method of constructing a verification model of a pan-tilt camera control system and regularly extracting and adjusting the angle rotation of the pan-tilt camera includes: obtaining a training set of rotation angle data of each pan-tilt camera in a spatial stereo coordinate system, constructing a verification model, inputting the training set data into the verification model, and obtaining a trained verification model; using the verification model to verify the angle rotation data of the pan-tilt camera during rotation, and regularly extracting and adjusting the angle rotation of the pan-tilt camera.
8. The control method of a patrol pan-tilt camera according to claim 7, characterized in that: The verification model is used to verify various types of data during the rotation of the pan-tilt camera, and the angle rotation of the pan-tilt camera is periodically extracted for adjustment, including: various types of data include the initial position point, rotation terminal position point, and rotation execution time of the pan-tilt camera; the initial position point, rotation terminal position point, and rotation execution time constitute a data set, the data set is classified according to the number of repetitions from large to small equal amounts of data, the time is randomly extracted according to the number from small to large, and then the rotation angle of the pan-tilt camera is adjusted again according to the verification and extraction results.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the control method of a patrol pan-tilt camera as described in any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement a control method for a patrol pan-tilt camera as described in any one of claims 1 to 8.
Citation Information
Patent Citations
PTZ correction method
CN105513072A
Pan-tilt calibration method and device of valve hall equipment inspection robot and storage medium
CN111932609A
Transformer substation inspection robot meter image recognition dynamic correction method
CN113342061A
Control method and device for photovoltaic panel group
CN117111643A
Pan-tilt control system for actual combat application of unmanned aerial vehicle
CN117331379A