Fire monitoring holder control method and device, electronic equipment and storage medium
Through the improved Black-winged Kite optimization algorithm and discretized PID algorithm, the pose control amount of the pan/tilt rotating to the fire position is calculated, which solves the problem of inaccurate pan/tilt control and achieves accurate monitoring and efficient identification of fires.
Patent Information
- Application Number
- CN202411229152.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing PTZ control method cannot accurately and quickly control the rotation direction and angle of the PTZ, resulting in the inability to accurately monitor the fire location.
The improved black-winged kite optimization algorithm and discretized PID algorithm are used to calculate the pose control amount of the pan/tilt when it rotates to the fire position, so that the shooting center of the telephoto camera is aligned with the fire position.
It achieves accurate and rapid identification of fire and improves fire monitoring efficiency.
Smart Images

Figure CN118760239A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of pan / tilt control, and in particular to a fire monitoring pan / tilt control method, device, electronic device and storage medium. Background Art
[0002] Fires can bring serious disasters to nature, animals, plants, and humans. Therefore, how to monitor fires efficiently and quickly has always been a pursuit of mankind.
[0003] There are many methods for monitoring fires, including ground and near-ground monitoring, aerial monitoring, radar monitoring, satellite remote sensing combined with geographic information systems and wireless sensor network monitoring. Among these monitoring technologies, aerial monitoring has the characteristics of a larger monitoring range and lower cost compared to other monitoring methods. When a fire occurs, the gimbal needs to be adjusted to point to a certain longitude, latitude and altitude or rotate according to a certain heading angle, roll angle and pitch angle according to the location of the fire point. However, the current gimbal control method cannot accurately and quickly control the rotation direction and angle of the gimbal, resulting in the gimbal being unable to accurately monitor the fire location.
[0004] Therefore, in order to solve the technical problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire location, a fire monitoring pan-tilt control method, device, electronic device and storage medium are urgently needed. Summary of the invention
[0005] The purpose of the present application is to provide a fire monitoring pan-tilt control method, device, electronic device and storage medium. By using an improved black kite optimization algorithm and a discretized PID algorithm, the posture control amount of the pan-tilt rotation to the fire position is calculated to control the rotation of the pan-tilt so that the shooting center of the telephoto camera is aligned with the fire position. This solves the problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire position. The fire position can be accurately and quickly identified and fire information can be accurately monitored, thereby improving the fire monitoring efficiency.
[0006] In a first aspect, the present application provides a fire monitoring pan-tilt control method for controlling a pan-tilt to monitor a fire; the pan-tilt is provided with a wide-angle camera and a telephoto camera; the fire monitoring pan-tilt control method comprises: S101, acquiring the shooting content of the wide-angle camera in real time; S102, identifying a fire location from the captured content; S103, calculating a target Euler angle that the shooting center of the telephoto camera needs to reach when it is rotated to aim at the fire position; S104, calculating the position and attitude control value of the gimbal according to the target Euler angle by using an improved black kite optimization algorithm and a discretized PID algorithm; S105: Based on the posture control amount, control the pan / tilt head so that the shooting center of the telephoto camera is aligned with the fire location.
[0007] The fire monitoring pan-tilt control method provided in the present application can realize fire monitoring. Through the improved black kite optimization algorithm and the discretized PID algorithm, the posture control amount of the pan-tilt rotation to the fire location is calculated to control the rotation of the pan-tilt so that the shooting center of the telephoto camera is aligned with the fire location. This solves the problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire location. The method can accurately and quickly identify the fire location and accurately monitor the fire information, thereby improving the fire monitoring efficiency.
[0008] Optionally, identifying the fire location from the photographed content includes: Determining whether a fire phenomenon occurs in the captured content; If yes, then identify the location where the fire occurs to obtain the fire location; If not, it is determined that no fire phenomenon occurs in the current shooting content, and the process returns to step S101.
[0009] Optionally, calculating a target Euler angle that the shooting center of the telephoto camera needs to reach when it is rotated to aim at the fire position includes: Acquire the current posture information of the gimbal, the transformation matrix between the gimbal and the wide-angle camera, and the transformation matrix between the gimbal and the telephoto camera, so as to calculate the rotation matrix between the fire position and the telephoto camera; The rotation matrix is converted into a target Euler angle that needs to be reached when the shooting center of the telephoto camera is rotated to aim at the fire position.
[0010] The fire monitoring pan-tilt control method provided in the present application can realize fire monitoring. Through the transformation matrix between the pan-tilt and the wide-angle camera and the telephoto camera, the rotation matrix of the fire position and the telephoto camera is calculated, thereby determining the target Euler angle of the shooting center of the telephoto camera rotated to the fire position. The target Euler angle can be used to control the pan-tilt to quickly rotate to the fire position and monitor the fire, which is beneficial to improving the efficiency of fire monitoring.
[0011] Optionally, obtaining the current posture information of the gimbal, the transformation matrix between the gimbal and the wide-angle camera, and the transformation matrix between the gimbal and the telephoto camera to calculate the rotation matrix of the fire position and the telephoto camera includes: Acquire the current position information of the gimbal, and acquire the conversion matrix between the gimbal and the wide-angle camera and the conversion matrix between the gimbal and the telephoto camera, which are respectively recorded as a first conversion matrix and a second conversion matrix; Calculate the camera pose information of the wide-angle camera and the camera pose information of the telephoto camera according to the current pose information, the first transformation matrix and the second transformation matrix; A rotation matrix of the fire position and the telephoto camera is calculated according to the camera pose information of the wide-angle camera, the camera pose information of the telephoto camera and the fire position.
[0012] Optionally, the posture control amount of the gimbal is calculated according to the target Euler angle by using an improved black kite optimization algorithm and a discretized PID algorithm, including: Based on the improved black-winged kite optimization algorithm and the discretized PID algorithm, a PID controller optimized based on the improved black-winged kite optimization algorithm is constructed; The PID controller optimized based on the improved black kite optimization algorithm is used to calculate the position and posture control value of the gimbal according to the target Euler angle.
[0013] The fire monitoring pan-tilt control method provided in the present application can realize fire monitoring. Through the improved Black Kite optimization algorithm and the discretized PID algorithm, a PID controller optimized based on the improved Black Kite optimization algorithm is constructed. The PID controller optimized based on the improved Black Kite optimization algorithm is used to calculate the posture control quantity of the pan-tilt rotation to the fire location, so that the shooting center of the telephoto camera is aligned with the fire location, which is beneficial to improving the fire monitoring efficiency.
[0014] Optionally, based on the improved black kite optimization algorithm and the discretized PID algorithm, a PID controller optimized based on the improved black kite optimization algorithm is constructed, comprising: Constructing a PID controller according to the discretized PID algorithm; The PID controller is optimized by the improved black-winged kite optimization algorithm to obtain the PID controller optimized based on the improved black-winged kite optimization algorithm.
[0015] Optionally, based on the posture control amount, controlling the pan / tilt head so that the shooting center of the telephoto camera is aligned with the fire location includes: Based on the posture control amount, controlling the rotation of the gimbal to obtain a preliminary rotation position of the shooting center of the telephoto camera; Calculating a deviation between the preliminary rotation position and the fire position; Determine whether the deviation is greater than a preset deviation threshold; if so, adjust the initial rotation position of the telephoto camera shooting center so that the adjusted deviation is less than or equal to the preset deviation threshold; if not, determine that the telephoto camera shooting center can accurately capture the fire location, and there is no need to adjust the initial rotation position of the telephoto camera shooting center.
[0016] In a second aspect, the present application provides a fire monitoring pan-tilt control device, which is used to control the pan-tilt to monitor a fire, wherein a wide-angle camera and a telephoto camera are arranged on the pan-tilt; the fire monitoring pan-tilt control device comprises: An acquisition module, used for acquiring the shooting content of the wide-angle camera in real time; An identification module, used to identify the fire location from the photographed content; A first calculation module is used to calculate the target Euler angle that the shooting center of the telephoto camera needs to reach when it is rotated to aim at the fire position; The second calculation module is used to calculate the posture control value of the gimbal according to the target Euler angle by using an improved black kite optimization algorithm and a discretized PID algorithm; A control module is used to control the pan / tilt head based on the posture control amount so that the shooting center of the telephoto camera is aligned with the fire location.
[0017] The fire monitoring pan-tilt control device calculates the posture control amount of the pan-tilt rotation to the fire position through the improved black kite optimization algorithm and the discretized PID algorithm, so as to control the pan-tilt rotation so that the shooting center of the telephoto camera is aimed at the fire position, thereby solving the problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire position. The fire position can be accurately and quickly identified and fire information can be accurately monitored, thereby improving the fire monitoring efficiency.
[0018] In a third aspect, the present application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, it runs the steps in the fire monitoring pan-tilt control method described above.
[0019] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the fire monitoring pan-tilt control method described above are executed.
[0020] Beneficial effects: The fire monitoring pan-tilt control method, device, electronic device and storage medium provided in the present application calculate the posture control amount of the pan-tilt rotation to the fire location through the improved black kite optimization algorithm and the discretized PID algorithm, so as to control the rotation of the pan-tilt so that the shooting center of the telephoto camera is aligned with the fire location, thereby solving the problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire location. The fire location can be accurately and quickly identified and fire information can be accurately monitored, thereby improving the fire monitoring efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flow chart of a fire monitoring PTZ control method provided in an embodiment of the present application.
[0022] Figure 2 A schematic diagram of the structure of a fire monitoring pan-tilt control device provided in an embodiment of the present application.
[0023] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0024] Explanation of reference numerals: 1. Acquisition module; 2. Identification module; 3. First calculation module; 4. Second calculation module; 5. Control module; 301. Processor; 302. Memory; 303. Communication bus. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0026] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0027] Please refer to Figure 1 , Figure 1A fire monitoring pan-tilt control method in some embodiments of the present application is used to control the pan-tilt to monitor a fire. The pan-tilt is provided with a wide-angle camera and a telephoto camera. The fire monitoring pan-tilt control method comprises the following steps: Step S101, acquiring the shooting content of the wide-angle camera in real time; Step S102, identifying the fire location from the captured content; Step S103, calculating the target Euler angle that the shooting center of the telephoto camera needs to reach when it is rotated to aim at the fire position; Step S104, calculating the posture control value of the gimbal according to the target Euler angle by using the improved black kite optimization algorithm and the discretized PID algorithm; Step S105, based on the posture control amount, the pan / tilt is controlled so that the shooting center of the telephoto camera is aligned with the fire location.
[0028] The fire monitoring pan-tilt control method calculates the posture control amount of the pan-tilt rotation to the fire position through an improved black kite optimization algorithm and a discretized PID algorithm, so as to control the pan-tilt rotation so that the shooting center of the telephoto camera is aimed at the fire position. The problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire position, can be accurately and quickly identified The fire position and accurately monitor fire information, and the fire monitoring efficiency is improved.
[0029] Specifically, in step S101, the shooting content of the wide-angle camera is obtained in real time. A wide-angle camera and a telephoto camera are arranged on the gimbal. The wide-angle camera has the advantages of short focal length and large visual field, and is suitable for shooting a wide range of scenes at a relatively close distance. The telephoto camera has a long focal length and a small viewing angle, and is suitable for shooting scenes at a farther distance. The wide-angle camera is used to expand the area of fire monitoring, while the telephoto camera is used to take clearer photos or videos of the fire point. In daily fire monitoring, a wide-angle camera will be used to shoot, thereby expanding the monitoring range. After a fire is identified, a telephoto camera will be used to shoot, thereby capturing a clear fire scene.
[0030] Specifically, in step S102, identifying the fire location from the captured content includes: Determine whether there is fire in the captured content; If yes, identify the location where the fire occurs to obtain the fire location; If not, it is determined that no fire phenomenon occurs in the current shooting content, and the process returns to step S101.
[0031] In step S102, the existing image recognition technology is used to determine whether a fire phenomenon occurs in the captured content, such as identifying whether there is flame in the captured content, identifying whether there is smoke when there is flame, and identifying the color of the smoke, so as to determine whether a fire phenomenon occurs in the captured content.
[0032] When the occurrence of a fire phenomenon is confirmed, the location where the fire phenomenon is identified is determined as the fire location.
[0033] When it is confirmed that there is no fire phenomenon, the process returns to step S101 to continue acquiring the shooting content of the wide-angle camera.
[0034] Specifically, in step S103, the target Euler angle that the shooting center of the telephoto camera needs to reach when it is rotated to aim at the fire position is calculated, including: Obtain the current position information of the gimbal, the transformation matrix between the gimbal and the wide-angle camera, and the transformation matrix between the gimbal and the telephoto camera to calculate the rotation matrix of the fire position and the telephoto camera; Convert the rotation matrix into the target Euler angle that the telephoto camera's shooting center needs to reach when it rotates to the fire position.
[0035] Specifically, in step S103, the current posture information of the gimbal, the conversion matrix between the gimbal and the wide-angle camera, and the conversion matrix between the gimbal and the telephoto camera are obtained to calculate the rotation matrix of the fire position and the telephoto camera, including: Obtain the current posture information of the gimbal, and obtain the conversion matrix between the gimbal and the wide-angle camera and the conversion matrix between the gimbal and the telephoto camera, which are respectively recorded as the first conversion matrix and the second conversion matrix; Calculate the camera pose information of the wide-angle camera and the camera pose information of the telephoto camera according to the current pose information, the first conversion matrix and the second conversion matrix; According to the camera pose information of the wide-angle camera, the camera pose information of the telephoto camera and the fire position, the rotation matrix of the fire position and the telephoto camera is calculated.
[0036] In step S103, the current posture information of the gimbal, the conversion matrix between the gimbal and the wide-angle camera, and the conversion matrix between the gimbal and the telephoto camera are obtained from the settings of the gimbal. According to the two conversion matrices and the current posture information, the camera posture information of the two cameras is calculated (the two conversion matrices are multiplied by the current posture information respectively to obtain the camera posture information of the two cameras). According to the two camera posture information and the fire position, the rotation matrix between the fire position and the telephoto camera is calculated (because the fire position is the posture information relative to the wide-angle camera, the relative posture information of the camera posture information of the telephoto camera relative to the camera posture information of the wide-angle camera is calculated, and then the fire position and the relative posture information are used to calculate the posture information of the fire position relative to the telephoto camera. Since the posture information includes the position matrix and the posture matrix, the posture matrix is extracted therefrom as the rotation matrix between the fire position and the telephoto camera). According to the eigenvalue of the rotation matrix and the corresponding eigenvector, the rotation matrix is converted into the target Euler angle that needs to be reached when the shooting center of the telephoto camera is rotated to align with the fire position. The calculation process of the transformation matrix, camera pose information, rotation matrix and target Euler angle can all be calculated by existing technologies, which will not be described in detail here. The target Euler angle refers to the roll angle, pitch angle and heading angle reached when the shooting center of the telephoto camera is rotated to the fire position.
[0037] Specifically, in step S104, the posture control value of the gimbal is calculated based on the target Euler angle by using the improved black kite optimization algorithm and the discretized PID algorithm, including: Based on the improved black-winged kite optimization algorithm and the discretized PID algorithm, a PID controller optimized by the improved black-winged kite optimization algorithm is constructed; The PID controller optimized by the improved black kite optimization algorithm is used to calculate the posture control value of the gimbal based on the target Euler angle.
[0038] Specifically, in step S104, based on the improved black kite optimization algorithm and the discretized PID algorithm, a PID controller optimized based on the improved black kite optimization algorithm is constructed, including: According to the discretized PID algorithm, a PID controller is constructed; The PID controller is optimized by using the improved black-winged kite optimization algorithm, and a PID controller optimized based on the improved black-winged kite optimization algorithm is obtained.
[0039] In step S104, a PID controller is constructed according to the discretized PID algorithm. The outputs (roll angle, pitch angle and yaw angle) of the three axes (roll axis, pitch axis and yaw axis) of the gimbal are controlled by the PID controller. The specific control conditions are as follows: 1) Assuming that the time interval used is M, then at the Kth Mth moment, the deviation err(K) = rin(K)-rout(K), where err(K) is the deviation between the reference value (target Euler angle) and the actual value (the actual Euler angle of the telephoto camera after the gimbal rotates) at the Kth Mth moment, rin(K) is the target Euler angle at the Kth Mth moment, and rout(K) is the actual Euler angle of the telephoto camera after the gimbal rotates at the Kth Mth moment; K represents the Kth Mth moment, K≥0, and when K=0, K represents the 0th Mth moment, i.e., the initial moment.
[0040] 2) Assume that the integral link is represented by the form of addition, that is, err(K)+err(K+1)+...; Assume that the differential link is represented by the form of slope, that is, [err(K)-err(K-1)] / T; then the PID discrete representation should be: u1(K)= K p *err1(K) + K i Σerr1(j) + K d (err1(K)-err1(K-1)); u2(K)= K p *err2(K) + K i Σerr2(j) + K d (err2(K)-err2(K-1)); u3(K)= K p *err3(K) + K i Σerr3(j) + K d (err3(K)-err3(K-1)); Among them, u1(K) is the roll angle, u2(K) is the pitch angle, u3(K) is the heading angle, K p is the proportionality coefficient, K i is the integration constant, K dis a differential constant, err1(K) is the deviation of the target Euler angle at the K-th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates in terms of roll angle, Σerr1(j) represents the cumulative sum of all deviations in roll angle from the beginning to the current moment (the K-th M moment), err1(K-1) is the deviation of the target Euler angle at the K-1th M moment (the previous moment, when K is equal to 1, the previous moment is the initial moment) and the actual Euler angle of the telephoto camera after the gimbal rotates in terms of roll angle, err2(K) is the deviation of the target Euler angle at the K-th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates in terms of pitch angle The difference, Σerr2(j) represents the cumulative sum of all deviations in pitch angle from the beginning to the current moment, err2(K-1) is the deviation of the pitch angle between the target Euler angle at the K-1th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates, err3(K) is the deviation of the heading angle between the target Euler angle at the K-1th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates, Σerr3(j) represents the cumulative sum of all deviations in heading angle from the beginning to the current moment, err3(K-1) is the deviation of the heading angle between the target Euler angle at the K-1th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates. Among them, K p , K i and K d The roll angle, pitch angle and heading angle can be set according to actual needs.
[0041] 3) The discretized PID algorithm is used to calculate the differences between the three-axis target values (target Euler angles) and the measured values (the actual Euler angles of the telephoto camera after the gimbal rotates). These differences are then converted into control quantities for the gimbal and input into the gimbal to rotate it. After multiple cycles, the gimbal is moved to the position corresponding to the target Euler angles.
[0042] In addition, since the range of the PTZ control quantity is limited, and in order to better accelerate the convergence of the control and reduce the failure of the PTZ control, restrictions are added when using the PID algorithm, as follows: 1) If u(K)>P max , then u(K)=P max ; 2) If u(K) <P min , then u(K)=P min ; 3) If the absolute value of u(K) is less than 0.5, then u(K)=0; where u(K) is the attitude control variable, that is, one of the roll angle u1(K), pitch angle u2(K) and heading angle u3(K), P max is the maximum value of the PTZ control amount, P min is the minimum value of the PTZ control amount. When u(K) is u1(K), P max and P minThey represent the maximum and minimum values of the gimbal control quantity on the roll angle. When u(K) is u2(K), P max and P min They represent the maximum and minimum values of the gimbal control quantity at the pitch angle. When u(K) is u3(K), P max and P min They represent the maximum and minimum values of the gimbal control amount on the heading angle. Through the above processing, the rotation fluctuation of the gimbal is reduced, and the gimbal can quickly stabilize the pointing. Among them, the maximum and minimum values of the gimbal control amount can be obtained from the gimbal settings.
[0043] The black kite optimization algorithm is a new type of meta-heuristic algorithm. When the algorithm is initialized, the position of each black kite is randomly generated within the upper and lower bounds. This may make the positions of the black kites unevenly distributed in space, causing the algorithm to fall into premature maturity and local optimal solutions. In order to solve this problem, an initialization form using Kent chaotic mapping function is proposed to improve the black kite optimization algorithm.
[0044] The chaotic mapping function has the properties of randomness and ergodicity. The chaotic mapping function is used to generate a sequence between [0,1], and then the black-winged kite population is initialized according to the chaotic factor. This can control the distribution of black-winged kites in the initial position to be more reasonable and avoid falling into premature maturity. The mathematical model of Kent's chaotic mapping function is as follows: ; Among them, X d is the independent variable of the dth change, d is the number of the dth change, when d=0, X d is the initial value of the independent variable; As the control parameter, = 0.5, the Kent chaotic mapping function will show a short-period state, so The value range is (0.01,0.5).
[0045] The model initialized by Kent chaos mapping function is as follows: ; Among them, X min With X max They represent the lower and upper limits of the independent variable X respectively, and Chaos is the chaotic factor generated by the Kent chaotic mapping function.
[0046] In addition, in order to comprehensively search the entire position space, a dynamic convergence factor F is introduced into the attack mechanism. Under the action of the dynamic convergence factor F, the attack range will gradually decrease with the increase of the number of iterations. This allows the black kite population to comprehensively search the entire space in the early stage of iteration, and at the same time, it can carry out refined search and optimization around the optimal solution in the later stage of iteration.
[0047] Most intelligent optimization algorithms tend to fall into local optimal situations when solving complex problems. When the algorithm falls into the local optimal solution and cannot jump out, it will lead to low accuracy in solving the problem and premature convergence. In order to enhance the ability of the black kite algorithm to jump out of the local optimal solution, the Levy flight strategy is introduced when updating the position. The movement trajectory of the Levy flight strategy is an alternation of short-distance exploratory local search and low-frequency long-distance walking. It has the characteristics of random walks and can help the population of the black kite optimization algorithm jump out of the local optimal solution in time. The following is the improved mathematical model of the black kite attack behavior: ; (1) ; (2) ; (3) ; (4) ; (5) ; (6) ; (7) Among them, formula (1) and formula (2) are the improved mathematical models of the attack behavior of black-winged kites. represents the position of the i-th black-winged kite in the j-th dimension at the t-th iteration step, represents the position of the i-th black-winged kite in the j-th dimension at the t+1-th iteration step. When t=0, represents the initial position of the i-th black-winged kite in the j-th dimension; r is a random number between 0 and 1; p is a constant, generally set to 0.9; T is the total number of iterations, t is the number of iterations so far; e is the natural constant e; L is a random number vector based on the Levy flight strategy; Formula (3) to Formula (7) are mathematical models generated based on the Levy flight strategy; is the Levy flight strategy function, is a parameter, which is generally set to 1.5; r1 and r2 are the standard deviations of and The normally distributed random function is is a normally distributed random function, , is the standard deviation; is the Gamma function, , express The factorial of .
[0048] The improved black kite optimization algorithm is applied to optimize the parameters of the PID controller. Each black kite can be represented by K p (proportional coefficient), K i (integration constant), K d (differential constant) 3 parameters, initialize the population through the improved black kite optimization algorithm, calculate the fitness, continuously iterate to find the optimal value, and finally find the global optimal value in the population, and then assign the optimal value to K p , K i , K d , and then the optimal value K p , K i , K d Applied to the PID controller so that the PID controller outputs the optimal solution (i.e., the posture control quantity).
[0049] In order to obtain satisfactory results through the black kite optimization algorithm, the absolute value of the error time integral performance index is used as the minimum objective function for parameter selection during the parameter optimization process. At the same time, in order to prevent the control energy from being too large, the square term of the posture control amount is added to the objective function, as shown below: ; in, is the objective function, e(K) is the abbreviation of err(K), , is the weight, + =1, and It can be set according to actual needs. Generally, is 0.999. Set is 0.001.
[0050] In addition, in order to avoid overshoot (i.e. the actual Euler angle of the telephoto camera exceeds the target Euler angle after the gimbal rotates), a penalty function is set. If overshoot occurs, the overshoot amount is used as one of the optimal indicators, and the objective function becomes: ; in, is the objective function when overshoot occurs; m is the control parameter, which can be set according to actual needs, and the value of m is generally 100.
[0051] In summary, the PID controller is optimized through the improved Black Kite optimization algorithm, and the PID controller optimized based on the improved Black Kite optimization algorithm is obtained. The target Euler angle is input into the PID controller optimized based on the improved Black Kite optimization algorithm to obtain the position and attitude control value of the gimbal.
[0052] Among them, the PID controller optimized based on the improved Black Kite optimization algorithm can be pre-constructed, so that step S104 is correspondingly replaced by: inputting the target Euler angle into the preset PID controller constructed based on the improved Black Kite optimization algorithm to calculate the posture control value of the gimbal.
[0053] Specifically, in step S105, based on the posture control amount, the pan / tilt is controlled so that the shooting center of the telephoto camera is aligned with the fire position, including: Based on the posture control quantity, the gimbal is controlled to rotate and the initial rotation position of the telephoto camera shooting center is obtained; Calculate the deviation between the initial rotation position and the fire position; Determine whether the deviation is greater than a preset deviation threshold; if so, adjust the initial rotation position of the telephoto camera shooting center so that the adjusted deviation is less than or equal to the preset deviation threshold; if not, determine that the telephoto camera shooting center can accurately capture the fire location, and there is no need to adjust the initial rotation position of the telephoto camera shooting center.
[0054] In step S105, according to the calculated posture control amount, the gimbal is controlled to rotate to a corresponding position, the initial rotation position of the telephoto camera shooting center is obtained, and the deviation between the initial rotation position and the fire position is calculated.
[0055] When the deviation is greater than the preset deviation threshold, it means that the shooting center of the telephoto camera is not aimed at the fire location. It is necessary to use the PID controller built based on the improved Black Kite optimization algorithm to calculate the adjustment amount of the gimbal to adjust the shooting center of the telephoto camera so that the adjusted deviation is less than or equal to the preset deviation threshold.
[0056] When the deviation is less than or equal to a preset deviation threshold, it is determined that the shooting center of the telephoto camera can accurately capture the fire location, and there is no need to adjust the position of the shooting center of the telephoto camera.
[0057] As can be seen from the above, the fire monitoring pan-tilt control method obtains the shooting content of the wide-angle camera in real time, identifies the fire position from the shooting content, calculates the target Euler angle that the shooting center of the telephoto camera needs to reach when it rotates to aim at the fire position, and calculates the posture control amount of the pan-tilt according to the target Euler angle through the improved black-winged kite optimization algorithm and the discretized PID algorithm. Based on the posture control amount, the pan-tilt is controlled to make the shooting center of the telephoto camera aim at the fire position; thus, the posture control amount of the pan-tilt rotated to the fire position is calculated through the improved black-winged kite optimization algorithm and the discretized PID algorithm, so as to control the rotation of the pan-tilt to make the shooting center of the telephoto camera aim at the fire position, thereby solving the problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire position, and can accurately and quickly identify the fire position and accurately monitor fire information, thereby improving the fire monitoring efficiency.
[0058] refer to Figure 2 The present application provides a fire monitoring pan-tilt control device, which is used to control the pan-tilt to monitor fire, including: Acquisition module 1, used to acquire the shooting content of the wide-angle camera in real time; Identification module 2, used to identify the fire location from the captured content; The first calculation module 3 is used to calculate the target Euler angle that the shooting center of the telephoto camera needs to reach when it rotates to aim at the fire position; The second calculation module 4 is used to calculate the posture control value of the gimbal according to the target Euler angle by using the improved black kite optimization algorithm and the discretized PID algorithm.
[0059] The control module 5 is used to control the pan / tilt head based on the posture control amount so that the shooting center of the telephoto camera is aligned with the fire location.
[0060] The fire monitoring pan-tilt control device calculates the posture control amount of the pan-tilt rotation to the fire position through the improved black kite optimization algorithm and the discretized PID algorithm, so as to control the pan-tilt rotation so that the shooting center of the telephoto camera is aimed at the fire position, thereby solving the problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire position. The fire position can be accurately and quickly identified and fire information can be accurately monitored, thereby improving the fire monitoring efficiency.
[0061] Specifically, when the acquisition module 1 is executed, the shooting content of the wide-angle camera is obtained in real time. A wide-angle camera and a telephoto camera are arranged on the gimbal. The wide-angle camera has the advantages of short focal length and large visual field, and is suitable for shooting a wide range of scenes at a relatively close distance. The telephoto camera has a long focal length and a small viewing angle, and is suitable for shooting scenes at a farther distance. The wide-angle camera is used to expand the area of fire monitoring, while the telephoto camera is used to take clearer photos or videos of the fire point. In daily fire monitoring, a wide-angle camera will be used to shoot, thereby expanding the monitoring range. After the fire is identified, a telephoto camera will be used to shoot, thereby capturing a clear fire scene.
[0062] Specifically, when the identification module 2 identifies the fire location from the captured content, it includes: Determine whether there is fire in the captured content; If yes, identify the location where the fire occurs to obtain the fire location; If not, it is determined that no fire phenomenon occurs in the current shooting content, and the control acquisition module 1 executes corresponding steps.
[0063] When the recognition module 2 is executed, it uses existing image recognition technology to determine whether a fire phenomenon occurs in the captured content, such as whether there is fire in the captured content, whether there is smoke when there is fire, and the color of the smoke, etc., so as to determine whether a fire phenomenon occurs in the captured content.
[0064] When the occurrence of a fire phenomenon is confirmed, the location where the fire phenomenon is identified is determined as the fire location.
[0065] When it is confirmed that there is no fire phenomenon, the control acquisition module 1 executes corresponding steps to continue to acquire the shooting content of the wide-angle camera.
[0066] Specifically, when the first calculation module 3 calculates the target Euler angle that the shooting center of the telephoto camera needs to reach when it rotates to aim at the fire position, it executes: Obtain the current position information of the gimbal, the transformation matrix between the gimbal and the wide-angle camera, and the transformation matrix between the gimbal and the telephoto camera to calculate the rotation matrix of the fire position and the telephoto camera; Convert the rotation matrix into the target Euler angle that the telephoto camera's shooting center needs to reach when it rotates to the fire position.
[0067] Specifically, when the first calculation module 3 obtains the current posture information of the gimbal, the conversion matrix between the gimbal and the wide-angle camera, and the conversion matrix between the gimbal and the telephoto camera to calculate the rotation matrix of the fire position and the telephoto camera, it executes: Obtain the current posture information of the gimbal, and obtain the conversion matrix between the gimbal and the wide-angle camera and the conversion matrix between the gimbal and the telephoto camera, which are respectively recorded as the first conversion matrix and the second conversion matrix; Calculate the camera pose information of the wide-angle camera and the camera pose information of the telephoto camera according to the current pose information, the first conversion matrix and the second conversion matrix; According to the camera pose information of the wide-angle camera, the camera pose information of the telephoto camera and the fire position, the rotation matrix of the fire position and the telephoto camera is calculated.
[0068] When the first calculation module 3 is executed, it obtains the current posture information of the gimbal, the conversion matrix between the gimbal and the wide-angle camera, and the conversion matrix between the gimbal and the telephoto camera from the settings of the gimbal, and calculates the camera posture information of the two cameras according to the two conversion matrices and the current posture information (the two conversion matrices are multiplied by the current posture information respectively to obtain the camera posture information of the two cameras), and calculates the rotation matrix between the fire position and the telephoto camera according to the two camera posture information and the fire position (since the fire position is the posture information relative to the wide-angle camera, the relative posture information of the camera posture information of the telephoto camera relative to the camera posture information of the wide-angle camera is calculated, and then the fire position and the relative posture information are used to calculate the posture information of the fire position relative to the telephoto camera. Since the posture information includes the position matrix and the posture matrix, the posture matrix is extracted therefrom as the rotation matrix between the fire position and the telephoto camera), and according to the eigenvalues of the rotation matrix and the corresponding eigenvectors, the rotation matrix is converted into the target Euler angle that needs to be reached when the shooting center of the telephoto camera is rotated to align with the fire position. The calculation process of the transformation matrix, camera pose information, rotation matrix and target Euler angle can all be calculated by existing technologies, which will not be described in detail here. The target Euler angle refers to the roll angle, pitch angle and heading angle reached when the shooting center of the telephoto camera is rotated to the fire position.
[0069] Specifically, when the second calculation module 4 calculates the posture control amount of the gimbal based on the target Euler angle by using the improved black kite optimization algorithm and the discretized PID algorithm, it executes: Based on the improved black-winged kite optimization algorithm and the discretized PID algorithm, a PID controller optimized by the improved black-winged kite optimization algorithm is constructed; The PID controller optimized by the improved black kite optimization algorithm is used to calculate the posture control value of the gimbal based on the target Euler angle.
[0070] Specifically, when the second calculation module 4 constructs a PID controller optimized based on the improved Black Kite optimization algorithm based on the improved Black Kite optimization algorithm and the discretized PID algorithm, it executes: According to the discretized PID algorithm, a PID controller is constructed; The PID controller is optimized by using the improved black-winged kite optimization algorithm, and a PID controller optimized based on the improved black-winged kite optimization algorithm is obtained.
[0071] When the second calculation module 4 is executed, a PID controller is constructed according to the discretized PID algorithm. The output (roll angle, pitch angle and heading angle) of the three axes (roll axis, pitch axis and heading axis) of the gimbal is controlled by the PID controller. The specific control conditions are as follows: 1) Assuming that the time interval used is M, then at the Kth Mth moment, the deviation err(K) = rin(K)-rout(K), where err(K) is the deviation between the reference value (target Euler angle) and the actual value (the actual Euler angle of the telephoto camera after the gimbal rotates) at the Kth Mth moment, rin(K) is the target Euler angle at the Kth Mth moment, and rout(K) is the actual Euler angle of the telephoto camera after the gimbal rotates at the Kth Mth moment; K represents the Kth Mth moment, K≥0, and when K=0, K represents the 0th Mth moment, i.e., the initial moment.
[0072] 2) Assume that the integral link is represented by the form of addition, that is, err(K)+err(K+1)+...; Assume that the differential link is represented by the form of slope, that is, [err(K)-err(K-1)] / T; then the PID discrete representation should be: u1(K)= K p *err1(K) + K i Σerr1(j) + K d (err1(K)-err1(K-1)); u2(K)= K p *err2(K) + K i Σerr2(j) + K d (err2(K)-err2(K-1)); u3(K)= K p *err3(K) + K i Σerr3(j) + K d (err3(K)-err3(K-1)); Among them, u1(K) is the roll angle, u2(K) is the pitch angle, u3(K) is the heading angle, K p is the proportionality coefficient, K i is the integration constant, K dis a differential constant, err1(K) is the deviation of the target Euler angle at the K-th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates in terms of roll angle, Σerr1(j) represents the cumulative sum of all deviations in roll angle from the beginning to the current moment (the K-th M moment), err1(K-1) is the deviation of the target Euler angle at the K-1th M moment (the previous moment, when K is equal to 1, the previous moment is the initial moment) and the actual Euler angle of the telephoto camera after the gimbal rotates in terms of roll angle, err2(K) is the deviation of the target Euler angle at the K-th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates in terms of pitch angle The difference, Σerr2(j) represents the cumulative sum of all deviations in pitch angle from the beginning to the current moment, err2(K-1) is the deviation of the pitch angle between the target Euler angle at the K-1th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates, err3(K) is the deviation of the heading angle between the target Euler angle at the K-1th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates, Σerr3(j) represents the cumulative sum of all deviations in heading angle from the beginning to the current moment, err3(K-1) is the deviation of the heading angle between the target Euler angle at the K-1th M moment and the actual Euler angle of the telephoto camera after the gimbal rotates. Among them, K p , K i and K d The roll angle, pitch angle and heading angle can be set according to actual needs.
[0073] 3) The discretized PID algorithm is used to calculate the differences between the three-axis target values (target Euler angles) and the measured values (the actual Euler angles of the telephoto camera after the gimbal rotates). These differences are then converted into control quantities for the gimbal and input into the gimbal to rotate it. After multiple cycles, the gimbal is moved to the position corresponding to the target Euler angles.
[0074] In addition, since the range of the PTZ control quantity is limited, and in order to better accelerate the convergence of the control and reduce the failure of the PTZ control, restrictions are added when using the PID algorithm, as follows: 1) If u(K)>P max , then u(K)=P max ; 2) If u(K) <P min , then u(K)=P min ; 3) If the absolute value of u(K) is less than 0.5, then u(K)=0; where u(K) is the attitude control variable, that is, one of the roll angle u1(K), pitch angle u2(K) and heading angle u3(K), P max is the maximum value of the PTZ control amount, P min is the minimum value of the PTZ control amount. When u(K) is u1(K), P max and P minThey represent the maximum and minimum values of the gimbal control quantity on the roll angle. When u(K) is u2(K), P max and P min They represent the maximum and minimum values of the gimbal control quantity at the pitch angle. When u(K) is u3(K), P max and P min Respectively represent the maximum and minimum values of the gimbal control amount on the heading angle. Through the above processing, the rotation fluctuation of the gimbal is reduced, and the gimbal can quickly and stably point. Among them, the maximum and minimum values of the gimbal control amount can be obtained from the gimbal settings.
[0075] The black kite optimization algorithm is a new type of meta-heuristic algorithm. When the algorithm is initialized, the position of each black kite is randomly generated within the upper and lower bounds. This may make the positions of the black kites unevenly distributed in space, causing the algorithm to fall into premature maturity and local optimal solutions. In order to solve this problem, an initialization form using Kent chaotic mapping function is proposed to improve the black kite optimization algorithm.
[0076] The chaotic mapping function has the properties of randomness and ergodicity. The chaotic mapping function is used to generate a sequence between [0,1], and then the black-winged kite population is initialized according to the chaotic factor. This can control the distribution of black-winged kites in the initial position to be more reasonable and avoid falling into premature maturity. The mathematical model of Kent's chaotic mapping function is as follows: ; Among them, X d is the independent variable of the dth change, d is the number of the dth change, when d=0, X d is the initial value of the independent variable; As the control parameter, = 0.5, the Kent chaotic mapping function will show a short-period state, so The value range is (0.01,0.5).
[0077] The model initialized by Kent chaos mapping function is as follows: ; Among them, X min With X max They represent the lower and upper limits of the independent variable X respectively, and Chaos is the chaotic factor generated by the Kent chaotic mapping function.
[0078] In addition, in order to comprehensively search the entire position space, a dynamic convergence factor F is introduced in the attack mechanism. Under the action of the dynamic convergence factor F, the attack range will gradually decrease with the increase of the number of iterations. This allows the black kite population to comprehensively search the entire space in the early stage of iteration, and at the same time, it can carry out refined search and optimization around the optimal solution in the later stage of iteration.
[0079] Most intelligent optimization algorithms tend to fall into local optimal situations when solving complex problems. When the algorithm falls into the local optimal solution and cannot jump out, it will lead to low accuracy in solving the problem and premature convergence. In order to enhance the ability of the black kite algorithm to jump out of the local optimal solution, the Levy flight strategy is introduced when updating the position. The movement trajectory of the Levy flight strategy is an alternation of short-distance exploratory local search and low-frequency long-distance walking. It has the characteristics of random walks and can help the population of the black kite optimization algorithm jump out of the local optimal solution in time. The following is the improved mathematical model of the black kite attack behavior: ; (1) ; (2) ; (3) ; (4) ; (5) ; (6) ; (7) Among them, formula (1) and formula (2) are the improved mathematical models of the attack behavior of black-winged kites. represents the position of the i-th black-winged kite in the j-th dimension at the t-th iteration step, represents the position of the i-th black-winged kite in the j-th dimension at the t+1-th iteration step. When t=0, represents the initial position of the i-th black-winged kite in the j-th dimension; r is a random number between 0 and 1; p is a constant, generally set to 0.9; T is the total number of iterations, t is the number of iterations so far; e is the natural constant e; L is a random number vector based on the Levy flight strategy; Formula (3) to Formula (7) are mathematical models generated based on the Levy flight strategy; is the Levy flight strategy function, are parameters, r1 and r2 are the standard deviations and The normally distributed random function is is a normally distributed random function, , is the standard deviation; is the Gamma function, , express The factorial of .
[0080] The improved black kite optimization algorithm is applied to optimize the parameters of the PID controller. Each black kite can be represented by K p (proportional coefficient), K i (integration constant), K d (differential constant) 3 parameters, initialize the population through the improved black kite optimization algorithm, calculate the fitness, continuously iterate to find the optimal value, and finally find the global optimal value in the population, and then assign the optimal value to K p , K i , K d , and then the optimal value K p , K i , K d Applied to the PID controller so that the PID controller outputs the optimal solution (i.e., the posture control quantity).
[0081] In order to obtain satisfactory results through the black kite optimization algorithm, the absolute value of the error time integral performance index is used as the minimum objective function for parameter selection during the parameter optimization process. At the same time, in order to prevent the control energy from being too large, the square term of the posture control amount is added to the objective function, as shown below: ; in, is the objective function, e(K) is the abbreviation of err(K), , is the weight, + =1, and It can be set according to actual needs. Generally, is 0.999. Set is 0.001.
[0082] In addition, in order to avoid overshoot (i.e. the actual Euler angle of the telephoto camera exceeds the target Euler angle after the gimbal rotates), a penalty function is set. If overshoot occurs, the overshoot amount is used as one of the optimal indicators, and the objective function becomes: ; in, is the objective function when overshoot occurs; m is the control parameter, which can be set according to actual needs, and the value of m is generally 100.
[0083] In summary, the PID controller is optimized through the improved Black Kite optimization algorithm, and the PID controller optimized based on the improved Black Kite optimization algorithm is obtained. The target Euler angle is input into the PID controller optimized based on the improved Black Kite optimization algorithm to obtain the position and attitude control value of the gimbal.
[0084] Among them, a PID controller optimized based on an improved Black Kite optimization algorithm can be pre-constructed, so that the steps executed by the second calculation module 4 are correspondingly replaced by: inputting the target Euler angle into a preset PID controller constructed based on an improved Black Kite optimization algorithm, and calculating the posture control value of the gimbal.
[0085] Specifically, when the control module 5 controls the pan / tilt head based on the posture control amount so that the shooting center of the telephoto camera is aligned with the fire position, the control module 5 executes: Based on the posture control quantity, the gimbal is controlled to rotate and the initial rotation position of the telephoto camera shooting center is obtained; Calculate the deviation between the initial rotation position and the fire position; Determine whether the deviation is greater than a preset deviation threshold; if so, adjust the initial rotation position of the telephoto camera shooting center so that the adjusted deviation is less than or equal to the preset deviation threshold; if not, determine that the telephoto camera shooting center can accurately capture the fire location, and there is no need to adjust the initial rotation position of the telephoto camera shooting center.
[0086] When the control module 5 is executed, it controls the pan / tilt head to rotate to a corresponding position according to the calculated posture control amount, obtains the initial rotation position of the telephoto camera shooting center, and calculates the deviation between the initial rotation position and the fire position.
[0087] When the deviation is greater than the preset deviation threshold, it means that the shooting center of the telephoto camera is not aimed at the fire location. It is necessary to use the PID controller built based on the improved Black Kite optimization algorithm to calculate the adjustment amount of the gimbal to adjust the shooting center of the telephoto camera so that the adjusted deviation is less than or equal to the preset deviation threshold.
[0088] When the deviation is less than or equal to a preset deviation threshold, it is determined that the shooting center of the telephoto camera can accurately capture the fire location, and there is no need to adjust the position of the shooting center of the telephoto camera.
[0089] As can be seen from the above, the fire monitoring pan-tilt control device obtains the shooting content of the wide-angle camera in real time, identifies the fire position from the shooting content, calculates the target Euler angle that the shooting center of the telephoto camera needs to reach when it rotates to aim at the fire position, and calculates the posture control amount of the pan-tilt according to the target Euler angle through the improved black-winged kite optimization algorithm and the discretized PID algorithm. Based on the posture control amount, the pan-tilt is controlled to align the shooting center of the telephoto camera with the fire position; thus, the posture control amount of the pan-tilt rotation to the fire position is calculated through the improved black-winged kite optimization algorithm and the discretized PID algorithm, so as to control the rotation of the pan-tilt to align the shooting center of the telephoto camera with the fire position, thereby solving the problem that the existing pan-tilt control method cannot accurately and quickly control the rotation direction and angle of the pan-tilt, resulting in the pan-tilt being unable to accurately monitor the fire position, and can accurately and quickly identify the fire position and accurately monitor fire information, thereby improving the fire monitoring efficiency.
[0090] Please refer to Figure 3 , Figure 3 This is a structural schematic diagram of an electronic device provided in an embodiment of the present application. The present application provides an electronic device, including: a processor 301 and a memory 302. The processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanisms (not marked). The memory 302 stores a computer program executable by the processor 301. When the electronic device is running, the processor 301 executes the computer program to execute the fire monitoring pan-tilt control method in any optional implementation of the above embodiment to achieve the following functions: acquiring the shooting content of the wide-angle camera in real time, identifying the fire location from the shooting content, calculating the target Euler angle that the shooting center of the telephoto camera needs to reach when it is rotated to align with the fire location, calculating the position and posture control amount of the pan-tilt according to the target Euler angle through an improved black kite optimization algorithm and a discretized PID algorithm, and controlling the pan-tilt based on the position and posture control amount so that the shooting center of the telephoto camera is aligned with the fire location.
[0091] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the fire monitoring pan-tilt control method in any optional implementation of the above-mentioned embodiment is executed to achieve the following functions: acquiring the shooting content of a wide-angle camera in real time, identifying the fire location from the shooting content, calculating the target Euler angle that needs to be reached when the shooting center of the telephoto camera is rotated to align with the fire location, calculating the position control amount of the pan-tilt according to the target Euler angle through an improved black kite optimization algorithm and a discretized PID algorithm, and controlling the pan-tilt based on the position control amount so that the shooting center of the telephoto camera is aligned with the fire location. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0092] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0093] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0094] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0095] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0096] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A fire monitoring PTZ control method, used to control the PTZ to monitor fire, characterized in that: The pan-tilt is provided with a wide-angle camera and a telephoto camera; the fire monitoring pan-tilt control method comprises the following steps: S101, real-time acquisition of the shooting content of the wide-angle camera; S102, identifying a fire location from the captured content; S103, calculating a target Euler angle that the shooting center of the telephoto camera needs to reach when it is rotated to aim at the fire position; S104, calculating the position and attitude control value of the gimbal according to the target Euler angle by using an improved black kite optimization algorithm and a discretized PID algorithm; S105: Based on the posture control amount, control the pan / tilt head so that the shooting center of the telephoto camera is aligned with the fire location.
2. The fire monitoring PTZ control method according to claim 1, characterized in that: The fire location is identified from the photographed content, including: Determining whether a fire phenomenon occurs in the captured content; If yes, then identify the location where the fire occurs to obtain the fire location; If not, it is determined that no fire phenomenon occurs in the current shooting content, and the process returns to step S101.
3. The fire monitoring PTZ control method according to claim 1, characterized in that: Calculating the target Euler angle that the shooting center of the telephoto camera needs to reach when it is rotated to aim at the fire position includes: Acquire the current posture information of the gimbal, the transformation matrix between the gimbal and the wide-angle camera, and the transformation matrix between the gimbal and the telephoto camera, so as to calculate the rotation matrix between the fire position and the telephoto camera; The rotation matrix is converted into a target Euler angle that needs to be reached when the shooting center of the telephoto camera rotates to the fire position.
4. The fire monitoring PTZ control method according to claim 3, characterized in that: Acquiring the current posture information of the gimbal, the transformation matrix between the gimbal and the wide-angle camera, and the transformation matrix between the gimbal and the telephoto camera to calculate the rotation matrix of the fire position and the telephoto camera, including: Acquire the current posture information of the gimbal, and acquire the conversion matrix between the gimbal and the wide-angle camera and the conversion matrix between the gimbal and the telephoto camera, which are respectively recorded as a first conversion matrix and a second conversion matrix; Calculate the camera pose information of the wide-angle camera and the camera pose information of the telephoto camera according to the current pose information, the first transformation matrix and the second transformation matrix; A rotation matrix of the fire position and the telephoto camera is calculated according to the camera pose information of the wide-angle camera, the camera pose information of the telephoto camera and the fire position.
5. The fire monitoring PTZ control method according to claim 1, characterized in that Through the improved black kite optimization algorithm and the discretized PID algorithm, the gimbal's posture control quantity is calculated according to the target Euler angle, including: Based on the improved black-winged kite optimization algorithm and the discretized PID algorithm, a PID controller optimized based on the improved black-winged kite optimization algorithm is constructed; The PID controller optimized based on the improved black kite optimization algorithm is used to calculate the position and posture control value of the gimbal according to the target Euler angle.
6. The fire monitoring PTZ control method according to claim 5, characterized in that: Based on the improved black-winged kite optimization algorithm and the discretized PID algorithm, a PID controller optimized based on the improved black-winged kite optimization algorithm is constructed, including: Constructing a PID controller according to the discretized PID algorithm; The PID controller is optimized by the improved black-winged kite optimization algorithm to obtain the PID controller optimized based on the improved black-winged kite optimization algorithm.
7. The fire monitoring PTZ control method according to claim 1, characterized in that: Based on the posture control amount, the pan / tilt is controlled so that the shooting center of the telephoto camera is aligned with the fire location, including: Based on the posture control amount, controlling the rotation of the gimbal to obtain a preliminary rotation position of the shooting center of the telephoto camera; Calculating a deviation between the preliminary rotation position and the fire position; Determine whether the deviation is greater than a preset deviation threshold; if so, adjust the initial rotation position of the telephoto camera shooting center so that the adjusted deviation is less than or equal to the preset deviation threshold; if not, determine that the telephoto camera shooting center can accurately capture the fire location, and there is no need to adjust the initial rotation position of the telephoto camera shooting center.
8. A fire monitoring PTZ control device, used to control the PTZ to monitor fire, characterized in that: The pan-tilt is provided with a wide-angle camera and a telephoto camera; The fire monitoring PTZ control device comprises: An acquisition module, used for acquiring the shooting content of the wide-angle camera in real time; An identification module, used to identify the fire location from the photographed content; A first calculation module is used to calculate the target Euler angle that needs to be reached when the shooting center of the telephoto camera is rotated to aim at the fire position; The second calculation module is used to calculate the posture control amount of the gimbal according to the target Euler angle by using an improved black kite optimization algorithm and a discretized PID algorithm; A control module is used to control the pan / tilt head based on the posture control amount so that the shooting center of the telephoto camera is aligned with the fire location.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, it runs the steps in the fire monitoring pan-tilt control method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps in the fire monitoring PTZ control method as described in any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Unmanned aerial vehicle shooting method and device, computer equipment and storage medium
CN111683204A
Forestry fire prevention monocular positioning method and system
CN112556655A
Automatic acquisition method and device for fire eye video of aluminum electrolysis cell
CN115314609A
Permanent magnet synchronous motor parameter identification method based on improved black wing plinary algorithm, electronic equipment and storage medium
CN118399818A
Cited By
Lightweight operation method for agricultural phenotype acquisition holder system
CN122018291A
