Cloud platform control method, device, storage medium and electronic device
By determining the motion state and maximum rotation speed in the target image, a startup strategy was formulated to control the gimbal rotation, thus solving the tracking failure problem caused by the gimbal control method and improving tracking efficiency.
Patent Information
- Application Number
- CN202211608882.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-12-14
AI Technical Summary
The gimbal control method causes tracking failures, especially when the target is far from the center of the image. The gimbal rotates too fast or too slow, causing tracking failures.
The motion state of the target object is determined by the target image captured by the camera device, the maximum rotation speed of the target and the corresponding number of frames are calculated, the rotation speed of the gimbal is limited, and a start-up strategy is formulated based on these parameters to control the rotation of the gimbal.
This improved the tracking efficiency of the gimbal, avoided tracking failures caused by improper rotation speed, and achieved stable target tracking.
Smart Images

Figure CN116017161B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of gimbal control, in particular to a control method and device of a gimbal, a storage medium and an electronic device. BACKGROUND
[0002] Intelligent security often needs to demarcate key areas or key gates. When pedestrians or vehicles and the like violate rules and cross the warning line, the monitoring system needs to locate the wire tripping intruder, then rotate the gimbal to make the target located in the center of the monitoring picture, and follow the target movement. If the wire tripping trigger point is far from the image center, the gimbal needs to rotate a large angle to make the target located in the picture center. If the gimbal rotates too fast, the target approaches the picture center with a large acceleration. The large acceleration is easy to make the image detection algorithm based on adjacent position search lose the target, thereby causing tracking failure. If the gimbal rotates too slowly, the target is easy to leave the monitoring picture, also causing tracking failure.
[0003] Therefore, the control method of the gimbal in the related art has the problem of causing tracking target failure.
[0004] In view of the above problems in the related art, no effective solution has been proposed so far. SUMMARY
[0005] Embodiments of the present application provide a control method and device of a gimbal, a storage medium and an electronic device to at least solve the problem of the control method of the gimbal in the related art causing tracking target failure.
[0006] According to an embodiment of the present application, a control method of a gimbal is provided, including: determining a target motion state of a target object included in a target image collected by a camera device based on the target image, determining a target maximum rotation speed of a target gimbal based on the target motion state, and determining a target frame number corresponding to the target maximum rotation speed, wherein the camera device is installed on the target gimbal and rotates with rotation of the target gimbal, the target frame number is a frame number of images continuously collected by the camera device after collecting the target image, and the target maximum rotation speed of the target gimbal is constrained within the target frame number; determining a start strategy of the target gimbal based on the target frame number and the target maximum rotation speed; and controlling the target gimbal to start according to the start strategy.
[0007] According to another embodiment of the present application, a control device of a holder is provided, comprising: a first determining module configured to determine a target motion state of a target object included in a target image based on the target image collected by a camera device; a second determining module configured to determine a target maximum rotation speed of a target holder based on the target motion state, and determine a target frame number corresponding to the target maximum rotation speed, wherein the camera device is installed on the target holder and rotates with rotation of the target holder, the target frame number is a frame number of images continuously collected by the camera device after collecting the target image, and the target maximum rotation speed of the target holder is constrained within the target frame number; a third determining module configured to determine a starting strategy of the target holder based on the target frame number and the target maximum rotation speed; and a control module configured to control the target holder to start according to the starting strategy.
[0008] According to still another embodiment of the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program, wherein the computer program is configured to execute the steps in any of the method embodiments when running.
[0009] According to still another embodiment of the present application, an electronic device is also provided, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to execute the steps in any of the method embodiments.
[0010] According to the present application, the target motion state of a target object included in a target image is determined based on the target image collected by a camera device, the target maximum rotation speed of a target holder is determined based on the target motion state, and the target frame number corresponding to the target maximum rotation speed is determined, wherein the target frame number is a frame number of images continuously collected by the camera device after collecting the target image, the target maximum rotation speed of the target holder is constrained within the target frame number, the starting strategy of the target holder is determined based on the target frame number and the target maximum rotation speed, and the target holder is controlled to start according to the starting strategy. Since the maximum rotation speed of the target holder and the target frame number in which the target maximum rotation speed is constrained can be determined based on the target motion state of the target object, the starting strategy of the target holder is determined based on the maximum rotation speed and the target frame number, and the target holder is controlled to start according to the starting strategy, the problem that the control method of the holder in the related art causes tracking failure can be solved, and the tracking efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0011] Figure 1 is a hardware structure block diagram of a mobile terminal of a control method of a holder according to an embodiment of the present application;
[0012] Figure 2is a flow chart of a control method of a gimbal according to an embodiment of the present application;
[0013] Figure 3 is a flow chart of a control method of a gimbal according to an embodiment of the present application;
[0014] Figure 4 is a structural block diagram of a control device of a gimbal according to an embodiment of the present application. DETAILED DESCRIPTION
[0015] Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.
[0016] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence.
[0017] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or the like. Taking the case of running on a mobile terminal, Figure 1 is a hardware structural block diagram of a mobile terminal of a control method of a gimbal according to an embodiment of the present application. As shown in Figure 1 , the mobile terminal can include one or more (only one is shown in Figure 1 ) processors 102 (the processor 102 can include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned mobile terminal can further include a transmission device 106 for communication function and an input / output device 108. Those skilled in the art can understand that Figure 1 the structure shown is only schematic, which does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal can further include more or less components than those shown in Figure 1 , or have a different configuration from Figure 1 .
[0018] The memory 104 can be used to store computer programs, for example, software programs of application software and modules, such as the computer program corresponding to the control method of the gimbal in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the mobile terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0019] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network interface controller (NIC) that is configured to connect to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module that is configured to communicate with the Internet through a wireless manner.
[0020] In the embodiment, a control method of a gimbal is provided, Figure 2 is a flowchart of the control method of the gimbal according to the embodiment of the present application, as shown in the figure, the flow includes the following steps: Figure 2
[0021] In step S202, a target motion state of a target object included in a target image collected by a camera device is determined based on the target image.
[0022] In step S204, a target maximum rotation speed of a target gimbal and a target frame number corresponding to the target maximum rotation speed are determined based on the target motion state, wherein the camera device is installed on the target gimbal and rotates with the rotation of the target gimbal, the target frame number is the frame number of images collected by the camera device continuously after collecting the target image, and the target maximum rotation speed of the target gimbal is constrained within the target frame number.
[0023] In step S206, a start strategy of the target gimbal is determined based on the target frame number and the target maximum rotation speed.
[0024] In step S208, the target gimbal is controlled to start according to the start strategy.
[0025] In the above embodiments, the camera device can be a ball machine, a gun machine or the like, and the camera device is installed on the target holder and rotates with the target holder. The camera device can monitor the field of view in real time, and when the target object enters the pre-defined area, the camera device can capture and track the target object. The target motion state of the target object can be determined according to the target image captured by the camera device. The target motion state can include the motion speed type of the target object and the motion direction of the target object, etc. After determining the target motion state, the target maximum rotation speed of the target holder and the target frame number constrained by the target maximum rotation speed can be determined according to the target motion state. The target frame number can be the frame number of the images captured continuously by the camera device after capturing the target image, and the first image in the continuously captured images is adjacent to the target image. The target maximum rotation speed of the target holder is constrained in the process of capturing the target frame number of images by the camera device. The target maximum rotation speed of the target holder is constrained, including determining that the rotation speed of the target holder is greater than the target maximum rotation speed, and determining the rotation speed of the target holder as the target maximum rotation speed.
[0026] In the above embodiments, after determining the target frame number and the target maximum rotation speed, the start strategy of the target holder is determined according to the target frame number and the target maximum rotation speed, wherein the start strategy can include the determination method of the rotation speed of the target holder, and the rotation speed of the target holder is determined according to the determination method of the rotation speed of the target holder. After determining the rotation speed, the target holder can be controlled to rotate at the rotation speed to realize tracking of the target object.
[0027] The execution subject of the above steps can be a processor, but is not limited thereto.
[0028] According to the present application, the target motion state of the target object included in the target image captured by the camera device is determined, the target maximum rotation speed of the target holder is determined according to the target motion state, and the target frame number corresponding to the target maximum rotation speed is determined, wherein the target frame number is the frame number of the images continuously captured by the camera device after capturing the target image, the target maximum rotation speed of the target holder is constrained within the target frame number, the start strategy of the target holder is determined according to the target frame number and the target maximum rotation speed, and the target holder is controlled to start according to the start strategy. Since the maximum rotation speed of the target holder and the target frame number constrained by the target maximum rotation speed can be determined according to the target motion state of the target object, the start strategy of the target holder is determined according to the maximum rotation speed and the target frame number, and the target holder is controlled to start according to the start strategy, the problem that the control method of the holder in the related art can cause tracking failure can be solved, and the tracking efficiency is improved.
[0029] In an example embodiment, determining the target motion state of the target object included in the target image based on the target image collected by the camera device comprises: determining a first image and a second image included in the target image, wherein the first image is an image collected at a current time, and the second image is a historical frame image collected before the first image; determining a first parameter value of the target holder when the camera device captures the first image; determining a second parameter value of the target holder when a detection box of the target object included in the first image is located at the center of the field of view of the camera device; determining a first difference value between the first parameter value and the second parameter value; determining a third parameter value of the target holder when the camera device captures the second image; determining a fourth parameter value of the target holder when a detection box of the target object included in the second image is located at the center of the field of view of the camera device; determining a second difference value between the fourth parameter value and the third parameter value; and determining the target motion state based on the first difference value and the second difference value. In this embodiment, the motion state of the target object can be determined according to two images collected by the camera device in sequence. The two images collected in sequence can be two consecutive images, or can be two non-consecutive images. Whether the two images collected in sequence are consecutive images can be determined according to the frame rate of the camera device. When the first image and the second image are consecutive images, the second image can be a frame of image before the first image. When the first image and the second image are non-consecutive images, the second image can be an image collected before the first image, and the target object is included in both the first image and the second image. The first parameter value of the target holder corresponding to the detection box of the target object in the first image can be determined, and the second parameter value of the target holder corresponding to the center of the picture can be determined. The first parameter value and the second parameter value can be PT values.
[0030] In the above embodiment, the target motion state can include the motion direction and the motion speed type of the target object. When determining the target motion state of the target object, the PT values of the holder corresponding to the center of the target box and the PT values of the holder corresponding to the center of the picture can be continuously sampled. Taking the P-axis as an example, the first difference value ΔP 当前帧 = position 目标中心1 - position 画面中心1 , wherein position 目标中心 is the P-axis position value of the holder corresponding to the center of the target box, position 画面中心 is the P-axis position value of the holder corresponding to the center of the picture, ΔP is the absolute value of the difference between the two, ΔP 当前帧 and ΔP 上一帧 are the absolute values of the position difference corresponding to the current frame time and the previous frame time, respectively. That is, position 目标中心1 represents the first parameter value, and position画面中心1 represents a second parameter value. The second difference value can be represented as ΔP 上一帧 = position 目标中心2 - position 画面中心2 , position 目标中心2 represents a third parameter value, position 画面中心2 represents a fourth parameter value. The target motion state can be determined according to the first difference value and the second difference value.
[0031] In an example embodiment, determining the target motion state based on the first difference value and the second difference value comprises: determining that a motion direction included in the target motion state is towards a picture center when the first difference value is greater than or equal to the second difference value; and determining that the motion direction included in the target motion state is away from the picture center when the first difference value is less than the second difference value. In this embodiment, when ΔP 当前帧 ≤ ΔP 上一帧 , it can be considered that the motion direction of the target object is towards the picture center, and when ΔP 当前帧 > ΔP 上一帧 , it can be considered that the motion direction of the target object is away from the picture center.
[0032] In an example embodiment, determining the target motion state based on the first difference value and the second difference value comprises: determining a third difference value of the first difference value and the second difference value; determining that a motion speed type included in the target motion state is a low-speed motion type when the third difference value is less than or equal to a first preset threshold value; and determining that the motion speed type included in the target motion state is a high-speed motion type when the third difference value is greater than the first preset threshold value. In this embodiment, when determining the motion speed type of the target object, a third difference value of the first difference value and the second difference value can be determined, and when the third difference value is less than or equal to the first preset threshold value, it is determined that the target object is in low-speed motion, i.e., the motion speed type is a low-speed motion type, and when the third difference value is greater than the first preset threshold value, it is determined that the target object is in high-speed motion, i.e., the motion speed type is a high-speed motion type.
[0033] In the above embodiment, taking the P-axis as an example, the third difference value ΔP′ = ΔP 当前帧 - ΔP 上一帧 may be determined. wherein ΔP′ is an absolute value of a difference between ΔP 当前帧 at a current frame time and ΔP 上一帧 at a previous frame time. SetVal is a first preset threshold value set in advance.
[0034] In an example embodiment, determining the target maximum rotation speed of the target holder based on the target motion state, and determining the target frame number corresponding to the target maximum rotation speed include: determining a first correspondence relationship between the maximum rotation speed of the target holder and the motion state, and determining a second correspondence relationship between the frame number of the target holder rotating at the maximum rotation speed and the motion state; determining the target maximum rotation speed corresponding to the target motion state based on the first correspondence relationship; and determining the target frame number corresponding to the target motion state based on the second correspondence relationship. In this embodiment, the target maximum rotation speed of the target holder can be limited according to the target motion state. The first correspondence relationship and the second correspondence relationship can be pre-determined correspondence relationships, and both the first correspondence relationship and the second correspondence relationship can be two-dimensional look-up tables. A two-dimensional look-up table of the target motion state corresponding to the maximum rotation speed of the holder can be set, and the corresponding target maximum rotation speed can be selected in combination with the target motion direction and the target motion speed. Taking the P-axis as an example, the two-dimensional look-up table of the maximum speed of the holder established, i.e., the first correspondence relationship, can be seen in Table 1, and V max1~4
[0035] Table 1
[0036]
[0037] In the above embodiment, a two-dimensional look-up table of the target motion state corresponding to the maximum speed of the holder can be set to obtain the second correspondence relationship. The corresponding frame number can be selected in combination with the target motion direction and the target motion speed. Taking the P-axis as an example, the two-dimensional look-up table of the maximum speed of the holder established, i.e., the second correspondence relationship, can be seen in Table 2, where FrmCnt_1 to FrmCnt_4 in Table 2 are pre-calibrated values.
[0038] Table 2
[0039]
[0040] In an example embodiment, determining the starting strategy of the target holder based on the target frame number and the target maximum rotation speed comprises: in a case where the target frame number is less than or equal to a second preset threshold, the starting strategy comprises: in a target time period, closing integral calculation of a target algorithm for controlling starting of the target holder, to determine a first initial rotation speed of the target holder, after the target time period, opening the integral calculation, to determine a second initial rotation speed of the target holder, determining a first target rotation speed of the target holder in the target time period based on the first initial rotation speed and the target maximum rotation speed, determining a second target rotation speed of the target holder after the target time period based on the second initial rotation speed and the target maximum rotation speed, wherein the target time period is a time period corresponding to the target holder collecting images of the target frame number; in a case where the target frame number is greater than the second preset threshold, the starting strategy comprises: opening integral calculation of the target algorithm, to determine a third initial rotation speed of the target holder, determining a third target rotation speed of the target holder based on the third initial rotation speed and the target maximum rotation speed. In this embodiment, the target algorithm can be a PID algorithm, and when the target frame number corresponding to the current frame is less than or equal to a pre-set constraint frame number, i.e. the second preset threshold, the maximum starting speed limiting strategy is executed. The holder control usually adopts the PID algorithm, and due to the limitation of the speed in the starting stage, the integral term in the PID algorithm is easily accumulated too large, resulting in a sharp increase in the holder movement speed after the starting strategy ends. Therefore, the integral term is cleared in the holder starting stage, and the integral calculation is started again after the starting stage.
[0041] In the above embodiment, taking the P-axis as an example, the integral calculation of the target algorithm can be controlled by When the target frame number is less than or equal to the second preset threshold, the integral term of the PID algorithm is cleared in the holder starting stage, i.e. the integral calculation of the PID algorithm is closed, and the first initial rotation speed in the target time period is calculated by the PID algorithm with the cleared integral term in the holder starting stage. After the holder starting stage, the integral calculation is started again, and the second initial rotation speed is calculated by the PID algorithm with the started integral calculation.
[0042] In the above embodiment, taking the P-axis as an example, when the target frame number is greater than the second preset threshold, the third initial rotation speed is directly calculated by the PID algorithm.
[0043] In the above embodiment, after the target image is collected by the camera device, the camera device will continue to collect images of the target frame number, and the time period corresponding to the camera device collecting images of the target frame number can be determined as the target time period.
[0044] In an example embodiment, determining the first target rotation speed of the target gimbal in the target time period based on the first initial rotation speed and the target maximum rotation speed comprises: in a case where the first initial rotation speed is less than or equal to the target maximum rotation speed, determining the first initial rotation speed as the first target rotation speed, and in a case where the first initial rotation speed is greater than the target maximum rotation speed, determining the target maximum rotation speed as the first target rotation speed; determining the second target rotation speed of the target gimbal after the target time period based on the second initial rotation speed and the target maximum rotation speed comprises: in a case where the second initial rotation speed is less than or equal to the target maximum rotation speed, determining the second initial rotation speed as the second target rotation speed, and in a case where the second initial rotation speed is greater than the target maximum rotation speed, determining the target maximum rotation speed as the second target rotation speed; determining the third target rotation speed of the target gimbal based on the third initial rotation speed and the target maximum rotation speed comprises: in a case where the third initial rotation speed is less than or equal to the target maximum rotation speed, determining the third initial rotation speed as the third target rotation speed, and in a case where the third initial rotation speed is greater than the target maximum rotation speed, determining the target maximum rotation speed as the third target rotation speed. In this embodiment, after the initial rotation speed is determined, the size relationship between the initial rotation speed and the target maximum rotation speed can be compared. When the initial rotation speed is greater than the target maximum rotation speed, the target gimbal is controlled to rotate at the target maximum rotation speed, and when the initial rotation speed is less than or equal to the target maximum rotation speed, the target gimbal is controlled to rotate at the initial rotation speed.
[0045] The control method of the gimbal will be described below in combination with the specific embodiments:
[0046] Figure 3 is a flowchart of the control method of the gimbal according to the specific embodiments of the present application, as shown in Figure 3 , the flowchart comprises:
[0047] Step S302, the target (corresponding to the above target object) starts to trip the line.
[0048] Step S304, the gimbal starts motion tracking.
[0049] Step S306, the target motion direction is judged and the target motion speed is judged.
[0050] Step S308, maximum speed two-dimensional lookup table.
[0051] Step S310, constraint frame number two-dimensional lookup table.
[0052] Step S312, judging whether or not FrmCnt 当前 ≤FrmCnt 设定 If the result is yes, step S314 is executed, and if the result is no, step S316 is executed.
[0053] Step S314, closing the integration: modifying the maximum speed.
[0054] Step S316, opening the integration.
[0055] In the foregoing embodiments, the gimbal starting maximum speed and the corresponding constraint frame number are selected according to the motion state of the tripping target, a gimbal starting strategy is constructed, the demarcation of the tripping area can be expanded, and the gimbal rotation speed limit can be released without being limited to only low-speed moving targets. The starting strategy can adapt to tripping targets in different tripping areas and different motion states, so that the gimbal can be started stably, the tripping target is prevented from being lost during the starting phase, and a smooth transition to the normal motion tracking state is achieved.
[0056] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software and a general hardware platform as required, and of course, it can also be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to execute the method described in each embodiment of the present application.
[0057] In this embodiment, a gimbal control device is also provided, which is used to implement the above embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware or a combination of software and hardware is also possible and is contemplated.
[0058] Figure 4 is a structural block diagram of a gimbal control device according to an embodiment of the present application, as shown in Figure 4 , the device includes:
[0059] A first determination module 42 is configured to determine a target motion state of a target object included in a target image collected by the image capture device based on the target image.
[0060] The second determining module 44 is configured to determine a target maximum rotation speed of a target holder based on the target motion state, and determine a target frame number corresponding to the target maximum rotation speed, wherein the camera device is installed on the target holder and rotates with the rotation of the target holder, the target frame number is a frame number of images continuously captured by the camera device after capturing the target image, and the target maximum rotation speed of the target holder is constrained within the target frame number.
[0061] The third determining module 46 is configured to determine a starting strategy of the target holder based on the target frame number and the target maximum rotation speed.
[0062] The control module 48 is configured to control the target holder to start according to the starting strategy.
[0063] In an example embodiment, the first determining module 42 can determine the target motion state of the target object included in the target image captured by the camera device by the following manner: determining a first image and a second image included in the target image, wherein the first image is an image captured at a current time, and the second image is a historical frame image captured before the first image; determining a first parameter value of the target holder when the camera device captures the first image; determining a second parameter value of the target holder when a detection box of the target object included in the first image is located at a center of a field of view of the camera device; determining a first difference value between the first parameter value and the second parameter value; determining a third parameter value of the target holder when the camera device captures the second image; determining a fourth parameter value of the target holder when a detection box of the target object included in the second image is located at the center of the field of view of the camera device; determining a second difference value between the fourth parameter value and the third parameter value; and determining the target motion state based on the first difference value and the second difference value.
[0064] In an example embodiment, the first determining module 42 can determine the target motion state based on the first difference value and the second difference value by the following manner: determining that a motion direction included in the target motion state is approaching a center of a picture in a case that the first difference value is greater than or equal to the second difference value; and determining that the target motion state includes a motion direction away from the center of the picture in a case that the first difference value is less than the second difference value.
[0065] In an example embodiment, the first determining module 42 can determine the target motion state based on the first difference value and the second difference value by: determining a third difference value of the first difference value and the second difference value; determining that a motion speed type included in the target motion state is a low-speed motion type if the third difference value is less than or equal to a first preset threshold; and determining that the motion speed type included in the target motion state is a high-speed motion type if the third difference value is greater than the first preset threshold.
[0066] In an example embodiment, the second determining module 44 can determine a target maximum rotation speed of a target gimbal based on the target motion state and determine a target frame number corresponding to the target maximum rotation speed by: determining a first correspondence relationship between a maximum rotation speed of the target gimbal and a motion state, and determining a second correspondence relationship between a frame number at which the target gimbal rotates at the maximum rotation speed and a motion state; determining the target maximum rotation speed corresponding to the target motion state based on the first correspondence relationship; and determining the target frame number corresponding to the target motion state based on the second correspondence relationship.
[0067] In an example embodiment, the third determining module 46 can determine a start strategy of a target gimbal based on the target frame number and the target maximum rotation speed by: in a case where the target frame number is less than or equal to a second preset threshold, the start strategy includes: in a target time period, closing integral calculation of a target algorithm for controlling start of the target gimbal to determine a first initial rotation speed of the target gimbal, after the target time period, opening the integral calculation to determine a second initial rotation speed of the target gimbal, determining a first target rotation speed of the target gimbal in the target time period based on the first initial rotation speed and the target maximum rotation speed, and determining a second target rotation speed of the target gimbal after the target time period based on the second initial rotation speed and the target maximum rotation speed, wherein the target time period is a time period corresponding to the target gimbal capturing images of the target frame number; and in a case where the target frame number is greater than the second preset threshold, the start strategy includes: opening integral calculation of the target algorithm to determine a third initial rotation speed of the target gimbal, and determining a third target rotation speed of the target gimbal based on the third initial rotation speed and the target maximum rotation speed.
[0068] In an example embodiment, the third determining module 46 can determine the first target rotating speed of the target holder in the target time period based on the first initial rotating speed and the target maximum rotating speed in the following manner: in the case that the first initial rotating speed is less than or equal to the target maximum rotating speed, the first initial rotating speed is determined as the first target rotating speed; in the case that the first initial rotating speed is greater than the target maximum rotating speed, the target maximum rotating speed is determined as the first target rotating speed; the third determining module 46 can determine the second target rotating speed of the target holder after the target time period based on the second initial rotating speed and the target maximum rotating speed in the following manner: in the case that the second initial rotating speed is less than or equal to the target maximum rotating speed, the second initial rotating speed is determined as the second target rotating speed; in the case that the second initial rotating speed is greater than the target maximum rotating speed, the target maximum rotating speed is determined as the second target rotating speed; the third determining module 46 can determine the third target rotating speed of the target holder based on the third initial rotating speed and the target maximum rotating speed in the following manner: in the case that the third initial rotating speed is less than or equal to the target maximum rotating speed, the third initial rotating speed is determined as the third target rotating speed; in the case that the third initial rotating speed is greater than the target maximum rotating speed, the target maximum rotating speed is determined as the third target rotating speed.
[0069] It should be noted that the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all the modules are located in the same processor; or the modules are located in different processors in any combination.
[0070] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the above method embodiments when running.
[0071] In an example embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0072] The embodiment of the present application also provides an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor is arranged to run the computer program to execute the steps in any of the above method embodiments.
[0073] In an exemplary embodiment, the electronic device described above can further comprise a transmission device connected with the processor and an input and output device connected with the processor.
[0074] The specific examples in the embodiment can refer to the examples described in the above embodiments and exemplary implementation manners, and the embodiment will not be described here again.
[0075] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices, which can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps among them can be manufactured into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
[0076] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for controlling a gimbal, characterized in that, include: Based on the target image captured by the camera equipment, determine the target motion state of the target object included in the target image; The target maximum rotation speed of the target gimbal is determined based on the target motion state, and the target number of frames corresponding to the target maximum rotation speed is determined. The camera device is mounted on the target gimbal and rotates with the rotation of the target gimbal. The target number of frames is the number of frames of images continuously captured by the camera device after capturing the target image. Within the target number of frames, the target maximum rotation speed of the target gimbal is constrained. The constraint on the target maximum rotation speed includes determining the rotation speed of the target gimbal as the target maximum rotation speed when it is determined that the rotation speed of the target gimbal is greater than the target maximum rotation speed. The target gimbal activation strategy is determined based on the target frame count and the target maximum rotation speed; Control the target gimbal to start according to the startup strategy; The activation strategy for determining the target gimbal based on the target frame count and the target maximum rotation speed includes: when the target frame count is less than or equal to a second preset threshold, the activation strategy includes: during a target time period, disabling the integral calculation of the target algorithm controlling the activation of the target gimbal to determine a first initial rotation speed of the target gimbal; after the target time period, enabling the integral calculation to determine a second initial rotation speed of the target gimbal; determining a first target rotation speed of the target gimbal during the target time period based on the first initial rotation speed and the target maximum rotation speed; and determining a second target rotation speed of the target gimbal after the target time period based on the second initial rotation speed and the target maximum rotation speed, wherein the target time period is the time period corresponding to the image of the target frame count captured by the camera device; when the target frame count is greater than the second preset threshold, the activation strategy includes: enabling the integral calculation of the target algorithm to determine a third initial rotation speed of the target gimbal; and determining a third target rotation speed of the target gimbal based on the third initial rotation speed and the target maximum rotation speed.
2. The method according to claim 1, characterized in that, Based on the target image captured by the camera device, determining the target motion state of the target object included in the target image includes: The target image includes a first image and a second image, wherein the first image is an image acquired at the current moment, and the second image is a historical frame image acquired before the first image; Determine the first parameter value of the target gimbal when the camera device captures the first image; The second parameter value of the target gimbal when the detection box of the target object included in the first image is located at the center of the field of view of the camera device; Determine the first difference between the first parameter value and the second parameter value; Determine the third parameter value of the target gimbal when the camera device captures the second image; The fourth parameter value of the target gimbal when the detection box of the target object included in the second image is located at the center of the field of view of the camera device; Determine the second difference between the fourth parameter value and the third parameter value; The target motion state is determined based on the first difference and the second difference.
3. The method according to claim 2, characterized in that, Determining the target motion state based on the first difference and the second difference includes: If the first difference is greater than or equal to the second difference, the direction of motion included in the target motion state is determined to be closer to the center of the screen; If the first difference is less than the second difference, the target motion state is determined to include a motion direction away from the center of the screen.
4. The method according to claim 2, characterized in that, Determining the target motion state based on the first difference and the second difference includes: Determine a third difference between the first difference and the second difference; If the third difference is less than or equal to the first preset threshold, the motion speed type included in the target motion state is determined to be a low-speed motion type. If the third difference is greater than the first preset threshold, the motion speed type included in the target motion state is determined to be a high-speed motion type.
5. The method according to claim 1, characterized in that, Determining the target gimbal's maximum rotation speed based on the target's motion state, and determining the target frame number corresponding to the target's maximum rotation speed, includes: Determine a first correspondence between the maximum rotation speed of the target gimbal and its motion state, and determine a second correspondence between the number of frames in which the target gimbal rotates at its maximum rotation speed and its motion state; Based on the first correspondence, determine the maximum rotational speed of the target corresponding to the target's motion state; The target frame number corresponding to the target motion state is determined based on the second correspondence.
6. The method according to claim 1, characterized in that, Determining the first target rotation speed of the target gimbal within the target time period based on the first initial rotation speed and the target maximum rotation speed includes: when the first initial rotation speed is less than or equal to the target maximum rotation speed, determining the first initial rotation speed as the first target rotation speed; when the first initial rotation speed is greater than the target maximum rotation speed, determining the target maximum rotation speed as the first target rotation speed. Determining the second target rotation speed of the target gimbal after the target time period based on the second initial rotation speed and the target maximum rotation speed includes: when the second initial rotation speed is less than or equal to the target maximum rotation speed, determining the second initial rotation speed as the second target rotation speed; when the second initial rotation speed is greater than the target maximum rotation speed, determining the target maximum rotation speed as the second target rotation speed. Determining the third target rotation speed of the target gimbal based on the third initial rotation speed and the target maximum rotation speed includes: if the third initial rotation speed is less than or equal to the target maximum rotation speed, determining the third initial rotation speed as the third target rotation speed; if the third initial rotation speed is greater than the target maximum rotation speed, determining the target maximum rotation speed as the third target rotation speed.
7. A control device for a gimbal, characterized in that, include: The first determining module is used to determine the target motion state of the target object included in the target image based on the target image acquired by the camera device. The second determining module is used to determine the target maximum rotation speed of the target gimbal based on the target motion state, and to determine the target frame number corresponding to the target maximum rotation speed. The camera device is mounted on the target gimbal and rotates with the target gimbal. The target frame number is the number of frames continuously captured by the camera device after capturing the target image. Within the target frame number, the target maximum rotation speed of the target gimbal is constrained. The constraint on the target maximum rotation speed includes determining the target gimbal's rotation speed as the target maximum rotation speed when it is determined that the target gimbal's rotation speed is greater than the target maximum rotation speed. The third determining module is used to determine the launch strategy of the target gimbal based on the target frame number and the target maximum rotation speed; The control module is used to control the target gimbal to start according to the startup strategy; The third determining module implements the target gimbal activation strategy based on the target frame number and the target maximum rotation speed in the following manner: When the target frame number is less than or equal to a second preset threshold, the activation strategy includes: during the target time period, disabling the integral calculation of the target algorithm controlling the activation of the target gimbal to determine the first initial rotation speed of the target gimbal; after the target time period, enabling the integral calculation to determine the second initial rotation speed of the target gimbal; determining the first target rotation speed of the target gimbal during the target time period based on the first initial rotation speed and the target maximum rotation speed; and determining the second target rotation speed of the target gimbal after the target time period based on the second initial rotation speed and the target maximum rotation speed, wherein the target time period is the time period corresponding to the image of the target frame number captured by the camera device; when the target frame number is greater than the second preset threshold, the activation strategy includes: enabling the integral calculation of the target algorithm to determine the third initial rotation speed of the target gimbal; and determining the third target rotation speed of the target gimbal based on the third initial rotation speed and the target maximum rotation speed.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is executed by a computer to perform the method described in any one of claims 1 to 6.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for controlling pan-tilt tracking camera shooting
CN111314609A