Control methods, devices, equipment and storage media for pan-tilt cameras

By generating and correcting the PWM control algorithm, the problem of jitter during operation of the gimbal camera is solved, and effective anti-shake is achieved without the need for complex hardware equipment and the effect of reducing manufacturing costs.

CN118018849BActive Publication Date: 2024-11-19SHENZHEN HANHUI VISION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410360974.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2024-11-19
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

Existing gimbal cameras are prone to jitter during operation, affecting shooting quality and shooting effects. The existing anti-shake methods require complex hardware equipment, which increases manufacturing costs.

Method used

By obtaining the shooting instructions of the gimbal camera, the target operation mode is generated, and the initial PWM control algorithm is generated based on this, the jitter state analysis model is input to obtain the jitter state information, and the PWM compensation control algorithm is further generated, the initial algorithm is corrected, and the target PWM control algorithm is obtained. , used to control the operation of the gimbal camera and realize anti-shake control.

Benefits of technology

Without the need for complex hardware equipment, effectively prevent the gimbal camera from shaking, reduce manufacturing costs, and improve the effect of anti-shake control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118018849B_ABST
    Figure CN118018849B_ABST
Patent Text Reader

Abstract

The present application relates to the field of pan-tilt technology, and provides a control method, device, equipment and storage medium for a pan-tilt camera. The method includes: obtaining a shooting instruction of a pan-tilt camera, and generating a target operating mode of the pan-tilt camera based on the shooting instruction; generating an initial PWM control algorithm of the motor of the pan-tilt camera based on the target operating mode, and inputting the target operating mode into a preset jitter state analysis model to obtain the jitter state information of the pan-tilt camera under the target operating mode; generating a PWM compensation control algorithm of the motor based on the jitter state information, and correcting the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm; and controlling the operation of the pan-tilt camera based on the target PWM control algorithm. The method realizes anti-shake control of the pan-tilt camera during operation without complex anti-shake hardware equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of pan / tilt technology, and in particular to a control method, device, equipment and storage medium for a pan / tilt camera. Background Art

[0002] As a device widely used in monitoring, security, video recording and other fields, the PTZ camera usually needs to control its posture. Existing PTZ camera control methods usually control the movement of the PTZ camera, such as rotation and tilt, by receiving instructions input by the user. However, in actual application, the PTZ camera often shakes during operation, which affects the shooting quality and effect of the PTZ camera.

[0003] At present, there are some methods and technologies to solve the problem of shaking of PTZ cameras. For example, sensors are used to detect the posture changes and environmental vibrations of the camera, and feedback control is performed based on the detection results to reduce the shaking, and the shutter speed is increased by increasing the sensitivity to prevent the shaking of the PTZ camera. However, these methods often require more complex hardware equipment, which increases the manufacturing cost of the PTZ camera. Summary of the invention

[0004] The present application provides a control method, device, equipment and storage medium for a pan-tilt camera to solve the problems raised by the above-mentioned background technology.

[0005] In a first aspect, the present application provides a method for controlling a pan-tilt camera, the method comprising:

[0006] Obtaining a shooting instruction of a pan-tilt camera, and generating a target operating mode of the pan-tilt camera based on the shooting instruction;

[0007] Generate an initial PWM control algorithm for the motor of the pan-tilt camera based on the target operating mode, and input the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan-tilt camera under the target operating mode;

[0008] generating a PWM compensation control algorithm for the motor based on the jitter state information, and modifying the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm;

[0009] The operation of the pan / tilt camera is controlled based on the target PWM control algorithm.

[0010] In a second aspect, the present application provides a control device for a pan / tilt camera, comprising:

[0011] An acquisition module, used to acquire a shooting instruction of a pan-tilt camera, and generate a target operation mode of the pan-tilt camera based on the shooting instruction;

[0012] A first generating module is used to generate an initial PWM control algorithm of the motor of the pan-tilt camera based on the target operating mode, and input the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan-tilt camera under the target operating mode;

[0013] A second generating module, configured to generate a PWM compensation control algorithm of the motor based on the jitter state information, and to modify the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm;

[0014] A control module is used to control the operation of the pan-tilt camera based on the target PWM control algorithm.

[0015] In a third aspect, the present application provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the control method of the pan-tilt camera as described above is implemented.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the control method of the pan-tilt camera as described above is implemented.

[0017] The present application provides a control method, device, equipment and storage medium for a pan-tilt camera, wherein the method includes: obtaining a shooting instruction of a pan-tilt camera, and generating a target operating mode of the pan-tilt camera based on the shooting instruction; generating an initial PWM control algorithm of the motor of the pan-tilt camera based on the target operating mode, and inputting the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan-tilt camera under the target operating mode; generating a PWM compensation control algorithm of the motor based on the jitter state information, and correcting the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm; and controlling the operation of the pan-tilt camera based on the target PWM control algorithm. On the one hand, the method realizes anti-shake control of the pan-tilt camera during operation without complex anti-shake hardware equipment, thereby reducing the manufacturing cost of the pan-tilt camera. On the other hand, before the pan-tilt camera is operated, the initial PWM control algorithm is corrected based on the PWM compensation control algorithm to obtain a target PWM control algorithm, and the operation of the pan-tilt camera is controlled based on the target PWM control algorithm during the operation of the pan-tilt camera, which can timely prevent the jitter of the pan-tilt camera during operation and improve the effect of anti-shake control. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0019] Figure 1 A schematic diagram of a process for controlling a pan-tilt camera according to an embodiment of the present application;

[0020] Figure 2 A schematic block diagram of the structure of a control device for a pan-tilt camera provided in an embodiment of the present application;

[0021] Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] 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 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.

[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0024] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0025] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0026] As a device widely used in monitoring, security, video recording and other fields, the PTZ camera usually needs to control its posture. Existing PTZ camera control methods usually control the movement of the PTZ camera, such as rotation and tilt, by receiving instructions input by the user. However, in actual application, the PTZ camera often shakes during operation, which affects the shooting quality and effect of the PTZ camera.

[0027] At present, there are some methods and technologies for the shaking problem of the pan-tilt camera. For example, the camera posture change and environmental vibration are detected by sensors, and then feedback control is performed according to the detection results to reduce the shaking, and the shutter speed is increased by increasing the sensitivity to prevent the shaking of the pan-tilt camera. However, these methods often require more complex hardware equipment, which increases the manufacturing cost of the pan-tilt camera. To this end, the present application provides a control method, device, equipment and storage medium for a pan-tilt camera to solve the above problems.

[0028] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0029] See also Figure 1 , Figure 1 A flow chart of a method for controlling a pan-tilt camera provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the control method of the pan-tilt camera provided in the embodiment of the present application includes steps S100 to S400.

[0030] Step S100: obtaining a shooting instruction of a pan-tilt camera, and generating a target operating mode of the pan-tilt camera based on the shooting instruction.

[0031] Step S200, generating an initial PWM control algorithm for the motor of the pan-tilt camera based on the target operating mode, and inputting the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan-tilt camera under the target operating mode.

[0032] Step S300: generating a PWM compensation control algorithm for the motor based on the jitter state information, and modifying the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm.

[0033] Step S400: Controlling the operation of the PTZ camera based on the target PWM control algorithm.

[0034] In this embodiment, as described in step S100 above, the shooting instruction of the pan-tilt camera is obtained, and the target operation mode of the pan-tilt camera is generated based on the shooting instruction. Specifically, the user inputs the shooting instruction through the user interface, and in response to the user's input of the shooting instruction, the shooting instruction is obtained from the user interface, and then the target operation mode of the pan-tilt camera is generated based on the shooting instruction. The shooting instruction can be selected by the user in the shooting instruction selection column provided by the user interface, or can be input by the user in the shooting instruction input box of the user interface according to his own shooting needs. The shooting instruction includes the target object, shooting mode, shooting angle of the target object, and shooting position of the target object.

[0035] As described in the above step S200, after the target operation mode of the pan-tilt camera is generated based on the shooting instruction, an initial PWM control algorithm of the motor of the pan-tilt camera is generated based on the target operation mode, and the target operation mode is input into a preset jitter state analysis model to obtain the jitter state information of the pan-tilt camera in the target operation mode. The target operation mode includes multiple operation states, and different operation states correspond to different jitter states. The operation state includes the rotation angle, rotation speed, tilt angle, driving path and driving speed of the pan-tilt camera, and each jitter state includes the tangential vibration amplitude and frequency, normal vibration amplitude and frequency, and axial vibration amplitude and frequency of the pan-tilt camera.

[0036] As described in the above step S300, after obtaining the jitter state information, a PWM compensation control algorithm of the motor is generated based on the jitter state information, and the initial PWM control algorithm is corrected based on the PWM compensation control algorithm to obtain a target PWM control algorithm. It can be understood that when the operation of the pan-tilt camera is controlled based on the initial PWM control algorithm, the pan-tilt camera will vibrate, and the PWM compensation control algorithm is used to offset the vibration generated by this situation. The initial PWM control algorithm is corrected by using the PWM compensation control algorithm, and the target PWM control algorithm obtained can prevent the pan-tilt camera from vibrating during operation.

[0037] As described in step S400, after obtaining the target PWM control algorithm, the operation of the pan-tilt camera is controlled based on the target PWM control algorithm. Specifically, the target PWM control algorithm is input into the motor controller of the pan-tilt camera, so that the motor controller controls the operation of the pan-tilt camera based on the target PWM control algorithm.

[0038] The method provided in this embodiment, on the one hand, realizes anti-shake control of the pan-tilt camera during operation without complex anti-shake hardware equipment, thereby reducing the manufacturing cost of the pan-tilt camera. On the other hand, before the pan-tilt camera is operated, the initial PWM control algorithm is corrected based on the PWM compensation control algorithm to obtain a target PWM control algorithm, and the operation of the pan-tilt camera is controlled based on the target PWM control algorithm during the operation of the pan-tilt camera, which can timely prevent the shaking phenomenon of the pan-tilt camera during operation and improve the effect of anti-shake control.

[0039] In some embodiments, before generating an initial PWM control algorithm for the motor of the pan-tilt camera based on the target operating mode, the method further includes the following steps:

[0040] Traverse the preset operation mode-PWM control algorithm mapping relationship table;

[0041] If there is no operating mode consistent with the target operating mode in the operating mode-PWM control algorithm mapping relationship table, the initial PWM control algorithm for generating the motor of the pan-tilt camera based on the target operating mode is executed.

[0042] In this embodiment, first, the preset operation mode-PWM control algorithm mapping relationship table is traversed. Specifically, first, the operation mode-PWM control algorithm mapping relationship table is obtained in a preset database, and then the operation mode-PWM control algorithm mapping relationship table is checked to see whether there is an operation mode consistent with the target operation mode.

[0043] Then, when there is no operation mode consistent with the target operation mode in the operation mode-PWM control algorithm mapping relationship table, the step of generating the initial PWM control algorithm of the motor of the pan-tilt camera based on the target operation mode is performed. It can be understood that when there is an operation mode consistent with the target operation mode in the operation mode-PWM control algorithm mapping relationship table, the operation of the pan-tilt camera is controlled by the PWM control algorithm corresponding to the operation mode consistent with the target operation mode in the operation mode-PWM control algorithm mapping relationship table.

[0044] The method provided in this embodiment controls the operation of the gimbal camera based on the PWM control algorithm corresponding to the operating mode in the operating mode-PWM control algorithm mapping relationship table when there is an operating mode consistent with the target operating mode in the operating mode-PWM control algorithm mapping relationship table, which helps to save the computing power of the system and improve the service life of the system.

[0045] In some embodiments, generating an initial PWM control algorithm for the motor of the pan-tilt camera based on the target operating mode comprises the following steps:

[0046] Performing an operation state analysis on the target operation mode to obtain an operation state sequence corresponding to the target operation mode; wherein each operation state of the operation state sequence is provided with a corresponding operation time;

[0047] Inputting each operating state of the operating state sequence into a preset PWM control signal generation model in sequence to obtain a plurality of PWM control signals, and arranging each PWM control signal in sequence based on the order of the operating state corresponding to each PWM control signal in the operating state sequence to obtain a PWM control signal sequence;

[0048] The initial PWM control algorithm is obtained by setting a duration for each PWM control signal in the PWM control signal sequence based on the operation duration corresponding to the operation state corresponding to each PWM control signal.

[0049] In this embodiment, first, the target operating mode is analyzed for operating status, and the operating status sequence corresponding to the target operating mode is obtained. Specifically, first, the target operating mode is analyzed to obtain multiple operating states corresponding to the target operating mode, and then, based on the corresponding order of each operating state in the target operating mode, each operating state is arranged to obtain an initial operating state sequence, and finally, based on the corresponding operating time of each operating state in the target operating mode, the corresponding operating time is set for each operating state of the initial operating state sequence to obtain the operating state sequence. It can be understood that the operating mode is a combination of multiple operating states of the pan-tilt camera within a period of time.

[0050] Then, each operating state of the operating state sequence is sequentially input into a preset PWM control signal generation model to obtain a plurality of PWM control signals, and based on the order of the operating states corresponding to each of the PWM control signals in the operating state sequence, each of the PWM control signals is arranged in sequence to obtain a PWM control signal sequence; wherein, the PWM control signal generation model is obtained based on training of a neural network model, and the PWM control signal generation model includes an input layer, a deep network learning layer and an output layer, the input layer is used to receive the operating state, the deep network learning layer is used to perform deep learning on the operating state to obtain the PWM control signal corresponding to the operating state, and the output layer is used to output the PWM control signal corresponding to the operating state.

[0051] Finally, a duration is set for each PWM control signal in the PWM control signal sequence based on the operation duration corresponding to the operation state corresponding to each PWM control signal, so as to obtain the initial PWM control algorithm.

[0052] The method provided in this embodiment obtains the operating state sequence corresponding to the target operating mode by performing operating state analysis on the target operating mode, obtains the PWM control signal sequence based on the operating state sequence, and sets the duration for each PWM control signal of the PWM control signal sequence based on the operating duration corresponding to the operating state corresponding to each PWM control signal to obtain the initial PWM control algorithm, which helps to achieve refined control of the target operating mode and improve the operating stability and shooting effect of the gimbal camera.

[0053] In some embodiments, the step of inputting the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan / tilt camera in the target operating mode includes:

[0054] Inputting the target operation mode into the jitter state analysis model through an input layer of the jitter state analysis model;

[0055] Performing state analysis on the target operation mode through the operation state analysis layer of the jitter state analysis model to obtain an operation state sequence corresponding to the target operation mode; wherein each operation state of the operation state sequence is provided with a corresponding operation duration;

[0056] Performing feature extraction on each operating state of the operating state sequence through the feature extraction layer of the jitter state analysis model to obtain a plurality of one-dimensional vectors; wherein one of the one-dimensional vectors corresponds to one operating state of the operating state sequence;

[0057] The characteristic matrix generation layer of the jitter state analysis model arranges the one-dimensional vectors in sequence from left to right based on the order of the operating states corresponding to the one-dimensional vectors in the operating state sequence to obtain a characteristic matrix;

[0058] The feature matrix analysis layer of the jitter state analysis model performs self-attention analysis on the feature matrix based on a self-attention mechanism to obtain an attention matrix corresponding to the feature matrix;

[0059] The target operating state generation layer of the jitter state analysis model uses, for each column vector of the attention matrix, the sum of the elements of the column vector as the importance coefficient of the operating state corresponding to the column vector, compares the importance coefficient with a preset importance coefficient, and when the importance coefficient is greater than the preset importance coefficient, uses the operating state corresponding to the column vector as the target operating state;

[0060] The target operating state sequence generation layer of the jitter state analysis model sets a label for each target operating state in the operating state sequence to obtain a target operating state sequence;

[0061] The deep network learning layer of the jitter state analysis model generates the jitter state information based on the target operating state sequence.

[0062] It should be noted that when the PTZ camera is in the target operating state, the PTZ camera will shoot the target object or is about to shoot the target object. In order to improve the calculation efficiency of the jitter state analysis model, the target operating state is marked in the operating state sequence to obtain the target operating state sequence, so that when the deep network learning layer receives the target operating state sequence, it generates the jitter state corresponding to each target operating state, and no jitter state analysis is performed on the non-target operating state in the target operating state sequence. This is because the jitter of the non-target operating state will not affect the shooting effect of the PTZ camera.

[0063] The method provided in this embodiment, on the one hand, can accurately obtain the jitter state information under the target operating mode, thereby improving the accuracy and credibility of the jitter state analysis; on the other hand, the target operating state sequence generation layer of the jitter state analysis model sets a label for each target operating state in the operating state sequence to obtain a target operating state sequence, and the deep network learning layer of the jitter state analysis model generates the jitter state information based on the target operating state sequence, which can prevent the existence of redundant information in the jitter state information and hinder the computational efficiency of the system.

[0064] In some embodiments, the jitter state information includes a plurality of jitter states, each of the jitter states is provided with timing information, the timing information includes a sequence and a duration, and the generating of the PWM compensation control algorithm of the motor based on the jitter state information includes the following steps:

[0065] For each of the jitter states, checking whether there is a preset jitter state consistent with the jitter state in a preset jitter state-PWM compensation control signal mapping relationship table;

[0066] If there is a preset shaking state that is consistent with the shaking state, using the PWM compensation control signal corresponding to the preset shaking state that is consistent with the shaking state as the target PWM compensation control signal corresponding to the shaking state;

[0067] If there is no preset shaking state consistent with the shaking state, respectively obtaining similarities between the shaking state and each preset shaking state in the shaking state-PWM compensation control signal mapping relationship table, and comparing each similarity with a preset similarity;

[0068] If the similarity is greater than the preset similarity, taking the PWM compensation control signal corresponding to the similarity as the intermediate target PWM compensation control signal;

[0069] synthesizing the intermediate target PWM compensation control signals to obtain a target PWM compensation control signal corresponding to the jitter state;

[0070] Based on the timing information corresponding to each of the jitter states, the target PWM compensation control signals corresponding to each of the jitter states are integrated to obtain the PWM compensation control algorithm.

[0071] The method provided in this embodiment uses the PWM compensation control signal corresponding to the preset jitter state consistent with the jitter state as the target PWM compensation control signal corresponding to the jitter state when there is a preset jitter state consistent with the jitter state in the jitter state-PWM compensation control signal mapping relationship table; and obtains the similarity between the jitter state and each preset jitter state in the jitter state-PWM compensation control signal mapping relationship table when there is no preset jitter state consistent with the jitter state in the jitter state-PWM compensation control signal mapping relationship table, and compares each similarity with the preset similarity; when the similarity is greater than the preset similarity, uses the PWM compensation control signal corresponding to the similarity as the intermediate target PWM compensation control signal, and synthesizes each intermediate target PWM compensation control signal to obtain the target PWM compensation control signal corresponding to the jitter state, thereby realizing the use of the jitter state-PWM compensation control signal mapping relationship table to generate personalized target PWM compensation control signals for different jitter states, thereby improving the applicability and reliability of the PWM compensation control algorithm.

[0072] In some embodiments, the method further comprises:

[0073] Constructing a mapping relationship between the target operation mode and the target PWM control algorithm;

[0074] Performing an operation state analysis on the target operation mode to obtain an operation state sequence corresponding to the target operation mode;

[0075] Based on a preset coding rule, feature coding is performed on each operating state of the operating state sequence to obtain a plurality of feature coding sequences; wherein the number of characters of each feature coding sequence is the same;

[0076] Constructing a blank table; the number of columns of the blank table is consistent with the number of characters in the feature coding sequence, and the number of rows of the blank table is consistent with the number of all the feature coding sequences;

[0077] Based on the order of the running states corresponding to the feature coding sequences in the running state sequence, inserting the feature coding sequences into the blank table in order from top to bottom to obtain a target table;

[0078] For each column of the target table, extract a target character in the column; wherein the target character does not exist in a column adjacent to the column;

[0079] Based on the arrangement order of each target character in the target table, each target character is arranged in sequence to obtain an encrypted password, and the mapping relationship is encrypted based on the encrypted password; exemplarily, the target table is shown in Table 1, the target characters corresponding to the first column of Table 1 are 2, E, 5, L, C, the target characters corresponding to the second column of Table 1 are 4, D, the target characters corresponding to the third column of Table 1 are M, Q, 6, and the target characters corresponding to the fourth column of Table 1 are 9, L, N, R, 4, then the encrypted password is 249EL5NDMRLQC64.

[0080] The encrypted mapping relationship is added to the operation mode-PWM control algorithm mapping relationship table.

[0081] Table 1

[0082]

[0083] The method provided in this embodiment, on the one hand, adds the mapping relationship between the target operating mode and the target PWM control algorithm to the operating mode-PWM control algorithm mapping relationship table, and can directly use the target PWM control algorithm to control the operation of the gimbal camera when the operating mode of the gimbal camera is the target operating mode, which helps to improve computing efficiency and save computing costs. On the other hand, by encrypting the mapping relationship based on the encryption password, personalized encryption processing of the mapping relationship is achieved, thereby improving the security of the mapping relationship.

[0084] See also Figure 2 , Figure 2 A schematic block diagram of the structure of the control device 100 for the pan-tilt camera provided in the embodiment of the present application is shown in FIG. Figure 2 As shown, the control device 100 of the pan-tilt camera includes:

[0085] The acquisition module 110 is used to acquire a shooting instruction of the pan-tilt camera and generate a target operation mode of the pan-tilt camera based on the shooting instruction;

[0086] A first generating module 120 is used to generate an initial PWM control algorithm of the motor of the pan-tilt camera based on the target operating mode, and input the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan-tilt camera under the target operating mode;

[0087] A second generating module 130 is used to generate a PWM compensation control algorithm of the motor based on the jitter state information, and to modify the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm;

[0088] The control module 140 is used to control the operation of the pan-tilt camera based on the target PWM control algorithm.

[0089] It should be noted that technicians in the relevant technical field can clearly understand that for the convenience and conciseness of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned gimbal camera control method embodiment, and will not be repeated here.

[0090] The control device 100 of the pan / tilt camera provided in the above embodiment can be implemented in the form of a computer program. The computer program can be used in Figure 3 The system is run on the terminal device 200 shown.

[0091] See also Figure 3 , Figure 3 The terminal device 200 provided in the embodiment of the present application is a schematic block diagram of the structure, wherein the terminal device 200 includes a processor 201 and a memory 202, wherein the processor 201 and the memory 202 are connected via a system bus 203, wherein the memory 202 may include a non-volatile storage medium and an internal memory.

[0092] The non-volatile storage medium can store a computer program. The computer program includes program instructions, and when the program instructions are executed by the processor 201, the processor 201 can execute any of the above-mentioned control methods for the pan-tilt camera.

[0093] The processor 201 is used to provide computing and control capabilities to support the operation of the entire terminal device 200.

[0094] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor 201, the processor 201 can execute any of the above-mentioned control methods for the pan-tilt camera.

[0095] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the terminal device 200 involved in the scheme of the present application. The specific terminal device 200 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0096] It should be understood that the processor 201 may be a central processing unit (CPU), and the processor 201 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0097] In some embodiments, the processor 201 is used to run a computer program stored in the memory to implement the following steps:

[0098] Obtaining a shooting instruction of a pan-tilt camera, and generating a target operating mode of the pan-tilt camera based on the shooting instruction;

[0099] Generate an initial PWM control algorithm for the motor of the pan-tilt camera based on the target operating mode, and input the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan-tilt camera under the target operating mode;

[0100] generating a PWM compensation control algorithm for the motor based on the jitter state information, and modifying the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm;

[0101] The operation of the pan / tilt camera is controlled based on the target PWM control algorithm.

[0102] It should be noted that technicians in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working process of the terminal device 200 described above can refer to the corresponding process of the aforementioned pan-tilt camera control method, and will not be repeated here.

[0103] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the one or more processors implement the control method of the pan-tilt camera provided in the embodiment of the present application.

[0104] The computer-readable storage medium may be an internal storage unit of the terminal device 200 in the aforementioned embodiment, such as a hard disk or memory of the terminal device 200. The computer-readable storage medium may also be an external storage device of the terminal device 200, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped with the terminal device 200.

[0105] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A control method for a pan / tilt camera, It is characterized in that The method comprises: Obtaining a shooting instruction of a pan-tilt camera, and generating a target operating mode of the pan-tilt camera based on the shooting instruction; Generate an initial PWM control algorithm for the motor of the pan-tilt camera based on the target operating mode, and input the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan-tilt camera under the target operating mode; generating a PWM compensation control algorithm for the motor based on the jitter state information, and modifying the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm; Controlling the operation of the PTZ camera based on the target PWM control algorithm; Wherein, the initial PWM control algorithm for generating the motor of the pan-tilt camera based on the target operating mode includes: Performing an operation state analysis on the target operation mode to obtain an operation state sequence corresponding to the target operation mode; wherein each operation state of the operation state sequence is provided with a corresponding operation time; Inputting each operating state of the operating state sequence into a preset PWM control signal generation model in sequence to obtain a plurality of PWM control signals, and arranging each PWM control signal in sequence based on the order of the operating state corresponding to each PWM control signal in the operating state sequence to obtain a PWM control signal sequence; The initial PWM control algorithm is obtained by setting a duration for each PWM control signal in the PWM control signal sequence based on the operation duration corresponding to the operation state corresponding to each PWM control signal.

2. The method for controlling a pan / tilt camera according to claim 1, It is characterized in that Before generating an initial PWM control algorithm for the motor of the pan-tilt camera based on the target operating mode, the method further includes: Traverse the preset operation mode-PWM control algorithm mapping relationship table; If there is no operating mode consistent with the target operating mode in the operating mode-PWM control algorithm mapping relationship table, the step of generating an initial PWM control algorithm for the motor of the pan-tilt camera based on the target operating mode is executed.

3. The control method of the PTZ camera according to claim 1, It is characterized in that The step of inputting the target operation mode into a preset jitter state analysis model to obtain jitter state information of the pan / tilt camera in the target operation mode includes: Inputting the target operation mode into the jitter state analysis model through an input layer of the jitter state analysis model; Performing state analysis on the target operation mode through the operation state analysis layer of the jitter state analysis model to obtain an operation state sequence corresponding to the target operation mode; wherein each operation state of the operation state sequence is provided with a corresponding operation duration; Performing feature extraction on each operating state of the operating state sequence through the feature extraction layer of the jitter state analysis model to obtain a plurality of one-dimensional vectors; wherein one of the one-dimensional vectors corresponds to one operating state of the operating state sequence; The characteristic matrix generation layer of the jitter state analysis model arranges the one-dimensional vectors in sequence from left to right based on the order of the operating states corresponding to the one-dimensional vectors in the operating state sequence to obtain a characteristic matrix; The feature matrix analysis layer of the jitter state analysis model performs self-attention analysis on the feature matrix based on a self-attention mechanism to obtain an attention matrix corresponding to the feature matrix; The target operating state generation layer of the jitter state analysis model uses, for each column vector of the attention matrix, the sum of the elements of the column vector as the importance coefficient of the operating state corresponding to the column vector, compares the importance coefficient with a preset importance coefficient, and when the importance coefficient is greater than the preset importance coefficient, uses the operating state corresponding to the column vector as the target operating state; The target operating state sequence generation layer of the jitter state analysis model sets a label for each target operating state in the operating state sequence to obtain a target operating state sequence; The deep network learning layer of the jitter state analysis model generates the jitter state information based on the target operating state sequence.

4. The control method of the PTZ camera according to claim 1, It is characterized in that The jitter state information includes a plurality of jitter states, each of the jitter states is provided with timing information, and the PWM compensation control algorithm of the motor is generated based on the jitter state information, including: For each of the jitter states, checking whether there is a preset jitter state consistent with the jitter state in a preset jitter state-PWM compensation control signal mapping relationship table; If there is a preset shaking state that is consistent with the shaking state, using the PWM compensation control signal corresponding to the preset shaking state that is consistent with the shaking state as the target PWM compensation control signal corresponding to the shaking state; If there is no preset shaking state consistent with the shaking state, respectively obtaining similarities between the shaking state and each preset shaking state in the shaking state-PWM compensation control signal mapping relationship table, and comparing each similarity with a preset similarity; If the similarity is greater than the preset similarity, taking the PWM compensation control signal corresponding to the similarity as the intermediate target PWM compensation control signal; synthesizing the intermediate target PWM compensation control signals to obtain a target PWM compensation control signal corresponding to the jitter state; Based on the timing information corresponding to each of the jitter states, the target PWM compensation control signals corresponding to each of the jitter states are integrated to obtain the PWM compensation control algorithm.

5. The control method of the PTZ camera according to claim 2, It is characterized in that The method further comprises: Constructing a mapping relationship between the target operation mode and the target PWM control algorithm; Performing an operation state analysis on the target operation mode to obtain an operation state sequence corresponding to the target operation mode; Based on a preset coding rule, feature coding is performed on each operating state of the operating state sequence to obtain a plurality of feature coding sequences; wherein the number of characters of each feature coding sequence is the same; Constructing a blank table; the number of columns of the blank table is consistent with the number of characters in the feature coding sequence, and the number of rows of the blank table is consistent with the number of all the feature coding sequences; Based on the order of the running states corresponding to the feature coding sequences in the running state sequence, inserting the feature coding sequences into the blank table in order from top to bottom to obtain a target table; For each column of the target table, extract a target character in the column; wherein the target character does not exist in a column adjacent to the column; Arrange the target characters in order based on the arrangement order of the target characters in the target table to obtain an encrypted password, and encrypt the mapping relationship based on the encrypted password; The encrypted mapping relationship is added to the operation mode-PWM control algorithm mapping relationship table.

6. A control device for a pan / tilt camera, It is characterized in that include: An acquisition module, used to acquire a shooting instruction of a pan-tilt camera, and generate a target operation mode of the pan-tilt camera based on the shooting instruction; A first generating module is used to generate an initial PWM control algorithm of the motor of the pan-tilt camera based on the target operating mode, and input the target operating mode into a preset jitter state analysis model to obtain jitter state information of the pan-tilt camera under the target operating mode; A second generating module, configured to generate a PWM compensation control algorithm of the motor based on the jitter state information, and to modify the initial PWM control algorithm based on the PWM compensation control algorithm to obtain a target PWM control algorithm; A control module, used for controlling the operation of the PTZ camera based on the target PWM control algorithm; Wherein, the initial PWM control algorithm for generating the motor of the pan-tilt camera based on the target operating mode includes: Performing an operation state analysis on the target operation mode to obtain an operation state sequence corresponding to the target operation mode; wherein each operation state of the operation state sequence is provided with a corresponding operation time; Inputting each operating state of the operating state sequence into a preset PWM control signal generation model in sequence to obtain a plurality of PWM control signals, and arranging each PWM control signal in sequence based on the order of the operating state corresponding to each PWM control signal in the operating state sequence to obtain a PWM control signal sequence; The initial PWM control algorithm is obtained by setting a duration for each PWM control signal in the PWM control signal sequence based on the operation duration corresponding to the operation state corresponding to each PWM control signal.

7. A terminal device, It is characterized in that The terminal device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the control method of the pan-tilt camera according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the control method of the pan-tilt camera according to any one of claims 1 to 5 is implemented.