A pan-tilt control method, system and pan-tilt control device
By detecting the rotation command of the gimbal and calculating the estimated position of the motor speed, the problem that network delay affects the accuracy of the gimbal control is solved, and the gimbal position is accurately controlled within a specified time period, which improves the accuracy of gimbal control.
Patent Information
- Application Number
- CN202210887644.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-07-26
AI Technical Summary
Network delay leads to low accuracy of gimbal control, and it is difficult for the prior art to effectively avoid video picture delay affecting gimbal control effect.
By detecting the rotation command trigger operation, the current position of the gimbal in the specified coordinate system is determined, the estimated position is calculated based on the motor speed, and the rotation command is issued to carry the estimated position, the rotation direction and the specified duration, so that the gimbal can rotate to the estimated position within the specified duration to not exceed the estimated position.
Effectively avoid excessive rotation of the gimbal, reduce position deviation caused by network delay, and improve the accuracy of gimbal control.
Smart Images

Figure CN115268508B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pan-tilt, and particularly to a pan-tilt control method, a system and a pan-tilt control device. Background Art
[0002] With the rapid development of technology, the application fields of pan-tilts are becoming more and more extensive. Since the cameras carried by pan-tilts will follow the movement of the pan-tilts to perform follow-up shooting on target objects, pan-tilts are widely used in the monitoring field.
[0003] In the related art, first, the target object in the video frame is located and analyzed, and then, a control instruction is generated according to the position of the target object to control the pan-tilt, so that the pan-tilt can track the target object. However, due to network latency, there may be a deviation between the position of the pan-tilt corresponding to the current video frame collected by the image acquisition device carried on the pan-tilt received and the current position of the pan-tilt, thus resulting in a low accuracy of pan-tilt control.
[0004] Based on this, there is an urgent need for a pan-tilt control method to avoid the delay of the video frame caused by network latency, which affects the actual effect of pan-tilt control, and thus improve the accuracy of pan-tilt control. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide a pan-tilt control method, a system and a pan-tilt control device to avoid the delay of the video frame caused by network latency, which affects the actual effect of pan-tilt control, and thus improve the accuracy of pan-tilt control. The specific technical solutions are as follows:
[0006] In a first aspect, the embodiments of the present invention provide a pan-tilt control method, and the method includes:
[0007] When a trigger operation for a rotation instruction of the pan-tilt is detected, determine the current video frame collected by the image acquisition device carried on the pan-tilt, and extract the current position of the pan-tilt in a specified coordinate system from the current video frame; wherein, the trigger operation indicates the rotation direction of the pan-tilt;
[0008] Based on the current position and the motor speed of the pan-tilt obtained in advance, calculate the estimated position that the pan-tilt reaches after rotating in the rotation direction from the current position for a specified duration;
[0009] Send a rotation instruction carrying the estimated position, the rotation direction and the specified duration to the pan-tilt, so that the pan-tilt rotates in the rotation direction and rotates to a first position not exceeding the estimated position within the specified duration.
[0010] Optionally, in a specific implementation, when detecting a triggering operation of a rotation instruction for the pan-tilt, determining a current video frame captured by an image acquisition device carried by the pan-tilt includes:
[0011] When detecting a triggering operation of a continuous rotation instruction for the pan-tilt, determining a current video frame captured by an image acquisition device carried by the pan-tilt;
[0012] The method further includes:
[0013] After a duration corresponding to a preset sending period, returning to the step of determining the current video frame captured by the image acquisition device carried by the pan-tilt; until detecting that the triggering operation stops.
[0014] Optionally, in a specific implementation, before detecting a triggering operation of a rotation instruction for the pan-tilt and determining a current video frame captured by an image acquisition device carried by the pan-tilt, the method further includes:
[0015] Obtaining a horizontal rotation speed reported by a horizontal motor of the pan-tilt and a vertical rotation speed reported by a vertical motor of the pan-tilt;
[0016] The calculating, based on the current position and the previously obtained motor rotation speeds of the pan-tilt, of a predicted position that the pan-tilt reaches by rotating for a specified duration in the rotation direction includes:
[0017] Based on the horizontal position in the current position and the horizontal rotation speed, calculating a horizontal predicted position that the pan-tilt reaches by rotating for the specified duration in the rotation direction;
[0018] Based on the vertical position in the current position and the vertical rotation speed, calculating a vertical predicted position that the pan-tilt reaches by rotating for the specified duration in the rotation direction.
[0019] Optionally, in a specific implementation, the establishing manner of the specified coordinate system includes:
[0020] Obtaining a left rotation shaft limit and a right rotation shaft limit of the horizontal motor, and an upper rotation shaft limit and a lower rotation shaft limit of the vertical motor;
[0021] Taking the position of the pan-tilt when the horizontal motor is limited by the left rotating shaft and the vertical motor is limited by the lower rotating shaft as the origin, a specified coordinate system is established with the horizontal rotation direction of the pan-tilt as the horizontal axis and the vertical rotation direction of the pan-tilt as the vertical axis; wherein, the positive direction of the horizontal axis is: the rotation direction of the horizontal motor of the pan-tilt from the left rotating shaft limit to the right rotating shaft limit; the positive direction of the vertical axis is: the rotation direction of the vertical motor of the pan-tilt from the lower rotating shaft limit to the upper rotating shaft limit.
[0022] Optionally, in a specific implementation
[0023] Calculating the horizontal estimated position that the pan-tilt reaches by moving the specified duration from the current position in the rotation direction based on the horizontal position and the horizontal rotation speed in the current position includes:
[0024] Calculating the first product of the horizontal rotation speed and the specified duration;
[0025] If the horizontal rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the horizontal axis of the specified coordinate system, then calculate the sum of the first product and the horizontal position in the current position, and determine the sum value and the minimum value in the right rotating shaft limit as the horizontal estimated position;
[0026] If the horizontal rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the horizontal axis of the specified coordinate system, then calculate the difference between the horizontal position in the current position and the first product, and determine the difference value and the maximum value in the left rotating shaft limit as the horizontal estimated position;
[0027] Calculating the vertical estimated position that the pan-tilt reaches by moving the specified duration from the current position in the rotation direction based on the vertical position and the vertical rotation speed in the current position includes:
[0028] Calculating the second product of the vertical rotation speed and the specified duration;
[0029] If the vertical rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the vertical axis of the specified coordinate system, then calculate the sum of the second product and the vertical position in the current position, and determine the sum value and the minimum value in the upper rotating shaft limit as the vertical estimated position;
[0030] If the vertical rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the vertical axis of the specified coordinate system, then calculate the difference between the vertical position in the current position and the second product, and determine the difference value and the maximum value in the lower rotating shaft limit as the vertical estimated position.
[0031] Second aspect, an embodiment of the present invention provides a pan-tilt control system, and the system includes:
[0032] An image acquisition device, configured to acquire video frames; wherein, the image acquisition device is mounted on a pan-tilt.
[0033] A pan-tilt control device, configured to obtain the video frames acquired by the image acquisition device; when detecting a trigger operation for a rotation instruction of the pan-tilt, determine the current video frame acquired by the image acquisition device, and extract the current position of the pan-tilt in a specified coordinate system from the current video frame; wherein, the trigger operation indicates the rotation direction of the pan-tilt; based on the current position and the pre-acquired motor rotation speed of the pan-tilt, calculate a predicted position that the pan-tilt reaches after rotating for a specified duration in the rotation direction from the current position, and send a rotation instruction carrying the predicted position, the rotation direction, and the specified duration to the pan-tilt.
[0034] The pan-tilt is configured to receive the rotation instruction carrying the predicted position, the rotation direction, and the specified duration sent by the pan-tilt control device, rotate in the rotation direction, and rotate to a first position not exceeding the predicted position within the specified duration.
[0035] Optionally, in a specific implementation manner, the pan-tilt control device is specifically configured to:
[0036] When detecting a trigger operation for a continuous rotation instruction of the pan-tilt, determine the current video frame acquired by the image acquisition device mounted on the pan-tilt.
[0037] The pan-tilt control device is further configured to:
[0038] After the duration corresponding to a preset sending period, return to the step of determining the current video frame acquired by the image acquisition device mounted on the pan-tilt; until the detection of the stop of the trigger operation.
[0039] Optionally, in a specific implementation manner, the pan-tilt control device is further configured to:
[0040] Before detecting the trigger operation for the rotation instruction of the pan-tilt and determining the current video frame acquired by the image acquisition device mounted on the pan-tilt, obtain the horizontal rotation speed reported by the horizontal motor of the pan-tilt and the vertical rotation speed reported by the vertical motor of the pan-tilt.
[0041] The pan-tilt control device is specifically configured to:
[0042] Based on the horizontal position in the current position and the horizontal rotation speed, calculate the horizontal predicted position that the pan-tilt reaches after rotating for the specified duration in the rotation direction from the current position.
[0043] Based on the vertical position and the vertical rotation speed in the current position, calculate the vertical predicted position that the pan-tilt reaches after rotating from the current position in the rotation direction for the specified duration.
[0044] Optionally, in a specific implementation, the pan-tilt control device is further configured to:
[0045] Obtain the left rotation shaft limit and the right rotation shaft limit of the horizontal motor, and the upper rotation shaft limit and the lower rotation shaft limit of the vertical motor;
[0046] Taking the position where the pan-tilt is located when the horizontal motor is at the left rotation shaft limit and the vertical motor is at the lower rotation shaft limit as the origin, establish a specified coordinate system with the horizontal rotation direction of the pan-tilt as the horizontal axis and the vertical rotation direction of the pan-tilt as the vertical axis; wherein, the positive coordinate direction of the horizontal axis: the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit; the positive coordinate direction of the vertical axis: the rotation direction of the vertical motor of the pan-tilt from the lower rotation shaft limit to the upper rotation shaft limit.
[0047] Optionally, in a specific implementation,
[0048] The pan-tilt control device is specifically configured to:
[0049] Calculate the first product of the horizontal rotation speed and the specified duration;
[0050] If the horizontal rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the horizontal axis of the specified coordinate system, then calculate the sum of the first product and the horizontal position in the current position, and determine the sum and the minimum value in the right rotation shaft limit as the horizontal predicted position;
[0051] If the horizontal rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the horizontal axis of the specified coordinate system, then calculate the difference between the horizontal position in the current position and the first product, and determine the difference and the maximum value in the left rotation shaft limit as the horizontal predicted position;
[0052] The pan-tilt control device is specifically configured to:
[0053] Calculate the second product of the vertical rotation speed and the specified duration;
[0054] If the vertical rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the vertical axis of the specified coordinate system, then calculate the sum of the second product and the vertical position in the current position, and determine the sum and the minimum value in the upper rotation shaft limit as the vertical predicted position;
[0055] If the vertical rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the longitudinal axis of the specified coordinate system, calculate the difference between the vertical position in the current position and the second product, and determine the maximum value in the lower rotating shaft limit as the vertical estimated position.
[0056] In a third aspect, an embodiment of the present invention provides a pan-tilt control device, and the device includes:
[0057] A position extraction module, configured to determine a current video frame captured by an image capture device carried by the pan-tilt when detecting a trigger operation of a rotation instruction regarding the pan-tilt, and extract the current position of the pan-tilt in a specified coordinate system from the current video frame; wherein, the trigger operation indicates the rotation direction of the pan-tilt;
[0058] A calculation module, configured to calculate an estimated position that the pan-tilt reaches by rotating from the current position in the rotation direction for a specified duration based on the current position and the pre-acquired motor rotation speed of the pan-tilt;
[0059] A control module, configured to send a rotation instruction carrying the estimated position, the rotation direction, and the specified duration to the pan-tilt, so that the pan-tilt rotates in the rotation direction and rotates to a first position not exceeding the estimated position within the specified duration.
[0060] Optionally, in a specific implementation manner, the position extraction module is specifically configured to:
[0061] When detecting a trigger operation of a continuous rotation instruction regarding the pan-tilt, determine the current video frame captured by the image capture device carried by the pan-tilt;
[0062] The control module is further configured to trigger the position extraction module after a duration corresponding to a preset sending period; until the detection of the stop of the trigger operation.
[0063] Optionally, in a specific implementation manner, the device further includes:
[0064] A rotation speed acquisition module, configured to acquire the horizontal rotation speed reported by the horizontal motor and the vertical rotation speed reported by the vertical motor of the pan-tilt before detecting the trigger operation of the rotation instruction regarding the pan-tilt and determining the current video frame captured by the image capture device carried by the pan-tilt;
[0065] The calculation module includes a horizontal estimated position sub-module and a vertical estimated position sub-module:
[0066] The horizontal predicted position sub-module is used to calculate the horizontal predicted position that the pan-tilt reaches after rotating for the specified duration from the current position in the rotation direction based on the horizontal position in the current position and the horizontal rotation speed;
[0067] The vertical predicted position sub-module is used to calculate the vertical predicted position that the pan-tilt reaches after rotating for the specified duration from the current position in the rotation direction based on the vertical position in the current position and the vertical rotation speed.
[0068] Optionally, in a specific implementation manner, the device further includes a coordinate system establishment module:
[0069] The coordinate system establishment module is used to obtain the left rotation shaft limit and the right rotation shaft limit of the horizontal motor, and the upper rotation shaft limit and the lower rotation shaft limit of the vertical motor;
[0070] Taking the position where the pan-tilt is located when the horizontal motor is at the left rotation shaft limit and the vertical motor is at the lower rotation shaft limit as the origin, a specified coordinate system is established with the horizontal rotation direction of the pan-tilt as the horizontal axis and the vertical rotation direction of the pan-tilt as the vertical axis; wherein, the positive coordinate direction of the horizontal axis: the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit; the positive coordinate direction of the vertical axis: the rotation direction of the vertical motor of the pan-tilt from the lower rotation shaft limit to the upper rotation shaft limit.
[0071] Optionally, in a specific implementation manner, the horizontal predicted position sub-module is specifically used for:
[0072] Calculating the first product of the horizontal rotation speed and the specified duration;
[0073] If the horizontal rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the horizontal axis of the specified coordinate system, then calculate the sum of the first product and the horizontal position in the current position, and determine the sum value and the minimum value in the right rotation shaft limit as the horizontal predicted position;
[0074] If the horizontal rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the horizontal axis of the specified coordinate system, then calculate the difference between the horizontal position in the current position and the first product, and determine the difference value and the maximum value in the left rotation shaft limit as the horizontal predicted position;
[0075] The vertical predicted position sub-module is specifically used for:
[0076] Calculating the second product of the vertical rotation speed and the specified duration;
[0077] If the vertical rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the vertical axis of the specified coordinate system, calculate the sum of the second product and the vertical position in the current position, and determine the sum value and the minimum value in the upper rotation axis limit as the vertical estimated position;
[0078] If the vertical rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the vertical axis of the specified coordinate system, calculate the difference between the vertical position in the current position and the second product, and determine the difference value and the maximum value in the lower rotation axis limit as the vertical estimated position.
[0079] In a fourth aspect, an embodiment of the present invention provides a pan-tilt control device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus;
[0080] The memory is used to store a computer program;
[0081] The processor is used to implement the steps of any of the pan-tilt control methods provided in the first aspect when executing the program stored on the memory.
[0082] In a fifth aspect, an embodiment of the present invention provides a computer-readable medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps of any of the pan-tilt control methods provided in the first aspect.
[0083] In a sixth aspect, an embodiment of the present invention provides a computer program product containing instructions. When it runs on a computer, it causes the computer to execute the steps of any of the pan-tilt control methods provided in the first aspect.
[0084] Beneficial effects of the embodiments of the present invention:
[0085] As can be seen above, by applying the solution provided in the embodiments of the present invention, first, it is possible to determine whether a trigger operation for a rotation instruction of the pan-tilt is detected, where the above trigger operation is used to indicate the rotation direction of the above pan-tilt. When the above trigger operation is detected, the current video frame captured by the image capture device carried by the above pan-tilt can be determined, and thus, the current position of the above pan-tilt in the specified coordinate system can be extracted from the above current video frame. Then, based on the above current position and the pre-acquired motor speed of the above pan-tilt, the estimated position that the above pan-tilt reaches after rotating for a specified duration in the above rotation direction can be calculated, and thus, a rotation instruction carrying the above estimated position, the above rotation direction, and the above specified duration can be sent to the above pan-tilt, so that the above pan-tilt moves in the above rotation direction and moves to a first position not exceeding the above estimated position within the above specified duration.
[0086] Based on this, when applying the solution provided by the embodiments of the present invention to control the movement of the pan-tilt, it is possible to control the position where the pan-tilt rotates within a specified duration not to exceed the estimated position. Thus, it is possible to avoid excessive rotation of the pan-tilt, and further reduce the deviation between the position of the pan-tilt corresponding to the video frame seen by the user and the actual current position of the pan-tilt caused by network latency. Furthermore, the accuracy of pan-tilt control is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following-described drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other embodiments based on these drawings.
[0088] Figure 1 It is a flowchart showing a method for controlling a pan-tilt provided by an embodiment of the present invention;
[0089] Figure 2 It is a flowchart showing another method for controlling a pan-tilt provided by an embodiment of the present invention;
[0090] Figure 3 It is a flowchart showing a specific embodiment of an embodiment of the present invention;
[0091] Figure 4 It is a schematic structural diagram of a pan-tilt control system provided by an embodiment of the present invention;
[0092] Figure 5 It is a schematic structural diagram of another pan-tilt control system provided by an embodiment of the present invention;
[0093] Figure 6 It is a schematic structural diagram of a pan-tilt control device provided by an embodiment of the present invention;
[0094] Figure 7 It is a schematic structural diagram of a pan-tilt control device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0095] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art based on this application belong to the scope of protection of the present invention.
[0096] In the related art, first, the target object in the video frame is located and analyzed. Then, a control instruction is generated according to the position of the target object to control the pan-tilt head, so that the pan-tilt head can track the target object. However, due to network latency, there may be a deviation between the position of the pan-tilt head corresponding to the currently acquired video frame collected by the image acquisition device carried on the pan-tilt head and the current position of the pan-tilt head. As a result, the accuracy of pan-tilt head control is relatively low. Based on this, there is an urgent need for a pan-tilt head control method to avoid the delay of the video frame caused by network latency from affecting the actual effect of pan-tilt head control, thereby improving the accuracy of pan-tilt head control.
[0097] To solve the above technical problems, an embodiment of the present invention provides a pan-tilt head control method.
[0098] Among them, this method can be applied to various application scenarios that require controlling a pan-tilt head. For example, controlling a pan-tilt head equipped with a camera to track a target object, etc. And this method can be applied to the control device of the pan-tilt head. Among them, the control device can include independent pan-tilt head control devices such as laptops, tablets, mobile phones, etc. that can communicate with the pan-tilt head; when the pan-tilt head is located in a monitoring system, the control device can be the control server in the monitoring system. For the sake of clear writing, the execution subject of this method is hereinafter simply referred to as the pan-tilt head control device. Based on this, the embodiment of the present invention does not limit the application scenario and execution subject of this method.
[0099] A pan-tilt head control method provided by an embodiment of the present invention may include the following steps:
[0100] When a trigger operation for a rotation instruction of the pan-tilt head is detected, determine the current video frame collected by the image acquisition device carried on the pan-tilt head, and extract the current position of the pan-tilt head in a specified coordinate system from the current video frame; wherein, the trigger operation indicates the rotation direction of the pan-tilt head;
[0101] Based on the current position and the motor rotation speed of the pan-tilt head obtained in advance, calculate the estimated position that the pan-tilt head reaches after rotating in the rotation direction from the current position for a specified duration;
[0102] Send a rotation instruction carrying the estimated position, the rotation direction, and the specified duration to the pan-tilt head, so that the pan-tilt head rotates in the rotation direction and rotates to a first position not exceeding the estimated position within the specified duration.
[0103] As can be seen above, when applying the solution provided by the embodiment of the present invention, first, it can be determined whether a trigger operation for a rotation instruction of the pan-tilt is detected, where the above trigger operation is used to indicate the rotation direction of the pan-tilt. When the above trigger operation is detected, the current video frame captured by the image acquisition device carried by the pan-tilt can be determined, and thus, the current position of the pan-tilt in a specified coordinate system can be extracted from the above current video frame. Then, based on the above current position and the motor rotation speed of the pan-tilt obtained in advance, the estimated position that the pan-tilt reaches after rotating for a specified duration in the above rotation direction can be calculated. Thus, a rotation instruction carrying the above estimated position, the above rotation direction, and the above specified duration can be sent to the pan-tilt, so that the pan-tilt moves in the above rotation direction and moves to a first position not exceeding the above estimated position within the above specified duration.
[0104] Based on this, when applying the solution provided by the embodiment of the present invention to control the movement of the pan-tilt, it can be controlled that the position reached by the pan-tilt within a specified duration does not exceed the estimated position. Thus, it can be avoided that the pan-tilt rotates excessively. Furthermore, the deviation between the position of the pan-tilt corresponding to the video frame seen by the user and the actual current position of the pan-tilt caused by network latency can be reduced. Further, the accuracy of pan-tilt control can be improved.
[0105] Next, with reference to the accompanying drawings, a pan-tilt control method provided by an embodiment of the present invention will be specifically described.
[0106] Figure 1 It is a schematic flowchart of a pan-tilt control method provided by an embodiment of the present invention. As Figure 1 shown, the method may include the following steps S101 - S103.
[0107] S101: When a trigger operation for a rotation instruction of the pan-tilt is detected, determine the current video frame captured by the image acquisition device carried by the pan-tilt, and extract the current position of the pan-tilt in a specified coordinate system from the current video frame;
[0108] Among them, the trigger operation indicates the rotation direction of the pan-tilt.
[0109] The user can control the pan-tilt control device to send various control instructions to the pan-tilt by operating the pan-tilt control device. Among them, the user sends an operation instruction to the pan-tilt control device through various operations to indicate sending a control instruction corresponding to this type of operation to the pan-tilt, so that when the pan-tilt control device detects various user operations, it generates a control instruction corresponding to the user operation and sends the control instruction to the pan-tilt.
[0110] That is to say, for various control commands sent by the pan-tilt control device to the pan-tilt, the operations corresponding to the control commands executed by the user on the pan-tilt control device can be used as the trigger operations for the control commands regarding the pan-tilt.
[0111] For example, when the user clicks the button for turning left, the pan-tilt control device can detect the pressing operation of the user on the button for turning left. Thus, the pan-tilt control device can generate a turning command for turning left and send the turning command for turning left to the pan-tilt. Among them, the operation of the user clicking the button for turning left is the trigger operation for the turning command regarding the pan-tilt to turn left. When the pan-tilt control device detects the above operation of the user clicking the button for turning left, it can determine that it has detected the trigger operation for the turning command regarding the pan-tilt to turn left.
[0112] Before controlling the pan-tilt to rotate, the pan-tilt control device can detect whether there is a trigger operation for the turning command regarding the pan-tilt, and the above trigger operation is used to indicate the turning direction of the pan-tilt. For example, the turning direction of the pan-tilt is indicated by pressing the button in the corresponding direction, or the turning direction of the pan-tilt is indicated by shaking the control lever in the corresponding direction, etc.
[0113] In addition, an image acquisition device can be mounted on the above pan-tilt, and the positions of the pan-tilt and the image acquisition device are relatively stationary. Among them, the video frames acquired by the image acquisition device can carry the position information of the pan-tilt in the specified coordinate system when the video frames are acquired.
[0114] The pan-tilt control device can acquire the video frames acquired by the image acquisition device. For example, acquire all the video frames acquired by the above image acquisition device, acquire some of the video frames acquired by the above image acquisition device at the time intervals corresponding to the preset acquisition period according to the preset acquisition period, acquire the video frames acquired by the above image acquisition device at a specific moment based on the video frame acquisition instruction determined based on a specific moment, etc. In this regard, the embodiments of the present invention do not make specific limitations.
[0115] Among them, the above specified coordinate system can be a world coordinate system, a camera coordinate system of the image acquisition device, or a coordinate system constructed according to the rotation axis limits of the pan-tilt motors. In this regard, the embodiments of the present invention do not make specific limitations.
[0116] Optionally, in a specific implementation manner, a method for establishing a specified coordinate system provided by the embodiments of the present invention may include the following steps 11-12:
[0117] Step 11: Obtain the left rotation axis limit and right rotation axis limit of the horizontal motor, and the upper rotation axis limit and lower rotation axis limit of the vertical motor;
[0118] Step 12: Taking the position of the pan-tilt when the horizontal motor is at the left rotation shaft limit and the vertical motor is at the lower rotation shaft limit as the origin, establish a specified coordinate system with the horizontal rotation direction of the pan-tilt as the horizontal axis and the vertical rotation direction of the pan-tilt as the vertical axis.
[0119] Among them, the positive direction of the horizontal axis is: the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit; the positive direction of the vertical axis is: the rotation direction of the vertical motor of the pan-tilt from the lower rotation shaft limit to the upper rotation shaft limit.
[0120] In this specific implementation, first, the left rotation shaft limit and the right rotation shaft limit of the horizontal motor of the pan-tilt, as well as the upper rotation shaft limit and the lower rotation shaft limit of the vertical motor of the pan-tilt, can be obtained.
[0121] Among them, the rotation of the pan-tilt is realized by the rotation of the bearings of the pan-tilt motors. When the bearing of the motor rotates in a certain direction, there is a limit position. That is to say, when the bearing of the motor rotates in one direction, when it rotates to a certain position, it will stop rotating and cannot continue to rotate in that direction. Then, the position where the bearing of the motor stops rotating is the shaft limit of the motor in that direction.
[0122] Therefore, the left rotation shaft limit of the above horizontal motor is the limit position of the horizontal motor rotating to the left; the right rotation shaft limit of the above horizontal motor is the limit position of the horizontal motor rotating to the right; the upper rotation shaft limit of the above vertical motor is the limit position of the vertical motor rotating upward; the lower rotation shaft limit of the above vertical motor is the limit position of the vertical motor rotating downward.
[0123] After determining the left rotation shaft limit and the right rotation shaft limit of the horizontal motor of the pan-tilt, as well as the upper rotation shaft limit and the lower rotation shaft limit of the vertical motor of the pan-tilt, the position of the pan-tilt when the above horizontal motor is at the left rotation shaft limit and the above vertical motor is at the lower rotation shaft limit can be taken as the origin, the horizontal rotation direction of the above pan-tilt as the horizontal axis and the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit as the positive direction of the horizontal axis, the vertical rotation direction of the above pan-tilt as the vertical axis and the rotation direction from the lower rotation shaft limit to the upper rotation shaft limit as the positive direction of the vertical axis, and a specified coordinate system can be established.
[0124] In this way, when the triggering operation of the above rotation instruction regarding the pan-tilt is detected, the current video frame can be determined in the video frames collected by the image acquisition device carried by the above pan-tilt, and the current position of the above pan-tilt in the specified coordinate system can be extracted from the current video frame. Among them, the so-called current video frame is: the video frame collected by the image acquisition device at the moment when the triggering operation of the above rotation instruction regarding the pan-tilt is detected.
[0125] For example, obtain all the video frames captured by the image acquisition device, and determine the current video frame therefrom, so that the current position of the above-mentioned pan-tilt head in the specified coordinate system can be extracted.
[0126] For another example, obtain the current video frame captured by the image acquisition device, and extract the current position of the above-mentioned pan-tilt head in the specified coordinate system from the current video frame.
[0127] S102: Based on the current position and the pre-obtained motor speed of the pan-tilt head, calculate the estimated position that the pan-tilt head reaches after rotating for a specified duration in the rotation direction from the current position.
[0128] In this specific implementation, since the motor speeds corresponding to the motors of different pan-tilt heads are different, therefore, in order to calculate the estimated position of the pan-tilt head, the motor speed of this pan-tilt head can be pre-obtained. Thus, after the current position of the above-mentioned pan-tilt head in the specified coordinate system is extracted, based on the current position and the pre-obtained motor speed of the above-mentioned pan-tilt head, calculate the estimated position that the above-mentioned pan-tilt head reaches after rotating for a specified duration in the rotation direction indicated by the above-mentioned trigger operation from the current position.
[0129] Among them, generally, there are two motors on the pan-tilt head, one is a horizontal motor for making the pan-tilt head rotate left and right, and the other is a vertical motor for making the pan-tilt head rotate up and down, and the speed of each motor is usually fixed. Therefore, before controlling the pan-tilt head, the user can determine the horizontal speed of the horizontal motor and the vertical speed of the vertical motor of this pan-tilt head according to the relevant parameters of the pan-tilt head. Thus, the determined horizontal speed and vertical speed can be input into the pan-tilt head control device, so that the pan-tilt head control device can obtain the pre-input horizontal speed and vertical speed of the pan-tilt head by the user, and based on the extracted current position of the pan-tilt head in the specified coordinate system and the above-mentioned horizontal speed and vertical speed, calculate the estimated position that the pan-tilt head reaches after rotating for a specified duration in the rotation direction indicated by the above-mentioned trigger operation from the current position.
[0130] For example, when the specified coordinate system is: when the above-mentioned horizontal motor is at the left rotation shaft limit and the above-mentioned vertical motor is at the lower rotation shaft limit, the position where the above-mentioned pan-tilt head is located is the origin, the horizontal rotation direction of the above-mentioned pan-tilt head is the horizontal axis, and the rotation direction of the horizontal motor of the pan-tilt head from the left rotation shaft limit to the right rotation shaft limit is the positive direction of the horizontal axis, the vertical rotation direction of the above-mentioned pan-tilt head is the vertical axis, and the rotation direction from the lower rotation shaft limit to the upper rotation shaft limit is the positive direction of the vertical axis. When the detected rotation direction of pan-tilt head A indicated by the trigger operation is to rotate to the right, which is the same as the positive direction of the horizontal axis of the above-mentioned specified coordinate system, then when the specified duration is t A , the current position of pan-tilt head A is (x A , y A ), and the horizontal speed of the horizontal motor of pan-tilt head A is s A , the estimated position of pan-tilt head A is (xA +t A *s A ,y A )。
[0131] S103: Send a rotation instruction carrying the estimated position, rotation direction, and specified duration to the pan-tilt head, so that the pan-tilt head rotates in the rotation direction and rotates to a first position not exceeding the estimated position within the specified duration.
[0132] In this specific implementation manner, after calculating the above-mentioned estimated position, a rotation instruction carrying the above-mentioned estimated position, the above-mentioned rotation direction, and the specified duration can be sent to the pan-tilt head, so that the above-mentioned pan-tilt head rotates in the above-mentioned rotation direction.
[0133] Among them, if within the specified duration, the position reached by the pan-tilt head does not reach the above-mentioned estimated position, then when the pan-tilt head rotates for the specified duration, the position reached is the current position reached by the pan-tilt head in response to the above-mentioned rotation operation, that is, the first position not exceeding the estimated position; that is to say, starting from when the pan-tilt head receives the above-mentioned rotation instruction, after experiencing the specified duration, the pan-tilt head rotates to the position reached by the pan-tilt head when rotating for the specified duration.
[0134] If within the specified duration, the position reached by the pan-tilt head reaches the above-mentioned estimated position, then even if the rotation duration experienced by the pan-tilt head when reaching the above-mentioned estimated position does not reach the above-mentioned specified duration, the pan-tilt head will stop rotating. Thus, the above-mentioned estimated position is the current position reached by the pan-tilt head in response to the above-mentioned rotation operation; that is to say, starting from when the pan-tilt head receives the above-mentioned rotation instruction, after experiencing the specified duration, the pan-tilt head rotates to the above-mentioned estimated position, then at this time the first position is the estimated position.
[0135] If within the specified duration, the position reached by the pan-tilt head does not reach the above-mentioned estimated position, but has reached the axis limit position of the pan-tilt head in the above-mentioned rotation direction, then the axis limit position of the pan-tilt head in the above-mentioned rotation direction is the current position reached by the pan-tilt head in response to the above-mentioned rotation operation; that is to say, starting from when the pan-tilt head receives the above-mentioned rotation instruction, after experiencing the specified duration, the pan-tilt head rotates to the axis limit position of the pan-tilt head in the above-mentioned rotation direction.
[0136] In this way, when the pan-tilt head rotates in the rotation direction of the pan-tilt head indicated by the trigger operation, the farthest position that the pan-tilt head can reach is the above-mentioned estimated position or the axis limit position corresponding to the rotation direction. Thus, it is possible to avoid excessive rotation of the pan-tilt head, resulting in a continuous increase in video frame delay, so that the picture seen by the user is a delayed picture. Furthermore, the impact on the actual effect of pan-tilt head control can be reduced.
[0137] As can be seen above, when applying the solution provided by the embodiments of the present invention, first, it is possible to determine whether a trigger operation for a rotation instruction of the pan-tilt is detected, where the above trigger operation is used to indicate the rotation direction of the pan-tilt. When the above trigger operation is detected, the current video frame captured by the image acquisition device carried by the pan-tilt can be determined. Thus, the current position of the pan-tilt in a specified coordinate system can be extracted from the above current video frame. Then, based on the above current position and the pre-acquired motor rotation speed of the pan-tilt, the estimated position that the pan-tilt reaches after rotating for a specified duration in the above rotation direction can be calculated. Thus, a rotation instruction carrying the above estimated position, the above rotation direction, and the above specified duration can be sent to the pan-tilt, so that the pan-tilt moves in the above rotation direction and moves to a first position not exceeding the above estimated position within the above specified duration.
[0138] Based on this, when applying the solution provided by the embodiments of the present invention to control the movement of the pan-tilt, it is possible to control the position that the pan-tilt rotates to within a specified duration not to exceed the estimated position. Thus, it is possible to avoid excessive rotation of the pan-tilt. Furthermore, the deviation between the position of the pan-tilt corresponding to the video frame seen by the user due to network latency and the actual current position of the pan-tilt can be reduced. Further, the accuracy of pan-tilt control can be improved.
[0139] Normally, when controlling the pan-tilt, the pan-tilt is controlled to rotate continuously. Therefore, rotation instructions can be continuously sent to the pan-tilt according to a preset sending period.
[0140] Based on this, optionally, in a specific implementation manner, as Figure 2 shown, in the above step S101, when a trigger operation for a rotation instruction of the pan-tilt is detected and the current video frame captured by the image acquisition device carried by the pan-tilt is determined, it may include the following step S1011:
[0141] S1011: When a trigger operation for a continuous rotation instruction of the pan-tilt is detected, determine the current video frame captured by the image acquisition device carried by the pan-tilt.
[0142] Correspondingly, a pan-tilt control method provided by the embodiments of the present invention further includes the following step S104:
[0143] S104: After the duration corresponding to the preset sending period, return to the step of determining the current video frame captured by the image acquisition device carried by the pan-tilt; until the detection of the trigger operation stops.
[0144] In this specific implementation manner, before controlling the pan-tilt, it is possible to detect whether there is a triggering operation for a continuous rotation instruction of the pan-tilt. When the above triggering operation is detected, the current video frame can be determined in the video frames collected by the image acquisition device carried by the above pan-tilt, and thus, the current position of the above pan-tilt in the specified coordinate system can be extracted from the current video frame, and then, the above steps S102 - S103 are executed. After that, during the duration of the above triggering operation, every time the duration corresponding to the above sending period elapses, the current video frame can be determined in the video frames collected by the image acquisition device carried by the above pan-tilt, and the current position of the above pan-tilt in the specified coordinate system can be extracted from the current video frame, and then, the above steps S102 - S103 are executed again. This cycle continues until the detection of the triggering operation stops.
[0145] That is to say, when the above triggering operation for the continuous rotation instruction of the pan-tilt is detected, the pan-tilt control device can periodically determine the current video frame in the video frames collected by the image acquisition device carried by the above pan-tilt according to the above specified duration, and extract the current position of the above pan-tilt in the specified coordinate system from the current video frame, and then, periodically execute the above steps S102 - S103 according to the above specified duration. Thus, a rotation instruction can be sent to the pan-tilt periodically according to the above specified duration, and the position reached by the pan-tilt when each specified duration ends will not exceed the calculated estimated position.
[0146] Among them, the duration corresponding to the above sending period and the above specified duration may be the same or different. In this regard, the embodiments of the present invention do not make specific limitations. When the above specified duration is greater than the duration corresponding to the above sending period, the pan-tilt can be kept rotating continuously, thereby improving the working efficiency of the pan-tilt.
[0147] Optionally, in order to improve the control accuracy of the pan-tilt, when the above specified duration is greater than the duration corresponding to the above sending period, the above specified duration is usually 1.1 to 1.2 times the duration corresponding to the above sending period.
[0148] For example, if the duration corresponding to the sending period is 0.2 seconds and the specified duration is 0.25 seconds, the control button for rotating the pan-tilt to the right can be pressed continuously for 10 seconds, and the pan-tilt control device can be controlled to send a rotation instruction for rotating the pan-tilt to the right for 0.25 seconds to the pan-tilt every 0.2 seconds within the above 10 seconds, so that the pan-tilt responds to the above rotation instruction for rotating the pan-tilt to the right for 0.25 seconds every 0.2 seconds. This cycle continues until the 10 - second time ends and the above pressing operation stops.
[0149] To facilitate understanding of a pan-tilt control method provided by the embodiments of the present invention, hereinafter, by using Figure 3The following specific embodiments are used to illustrate a pan-tilt control method provided by an embodiment of the present invention.
[0150] Among them, Figure 3 the user's video stream acquisition in [] is that the pan-tilt control device acquires the video stream collected by the image acquisition device carried by the pan-tilt. Figure 3 the user presses the pan-tilt control in [] means that the user performs a triggering operation on the pan-tilt control device for the rotation instruction of the pan-tilt. Figure 3 the "no" in [] indicates that when the pan-tilt control device does not detect the user's triggering operation on the pan-tilt control device for the rotation instruction of the pan-tilt, the step of the user performing the triggering operation on the pan-tilt control device for the rotation instruction of the pan-tilt is returned. Figure 3 the "yes" in [] indicates that when the pan-tilt control device detects the user's triggering operation on the pan-tilt control device for the rotation instruction of the pan-tilt, execute Figure 3 the step of obtaining the pan-tilt position corresponding to the current picture from the video stream in []. Figure 3 obtaining the pan-tilt position corresponding to the current picture from the video stream in []: when the pan-tilt control device detects the user's triggering operation on the pan-tilt control device for the rotation instruction of the pan-tilt, determine the current video frame collected by the image acquisition device carried by the pan-tilt from the above video stream, and extract the current position of the pan-tilt in the specified coordinate system from the current video frame. Figure 3 calculating the estimated position in [] is that the pan-tilt control device calculates the estimated position that the pan-tilt reaches after rotating for a specified duration from the current position according to the rotation direction. Figure 3 sending the control instruction in [] is that the pan-tilt control device sends a rotation instruction carrying the estimated position, rotation direction and specified duration to the pan-tilt. Figure 3 Delay 200ms (delay for 200 milliseconds) in [] means that the duration corresponding to the preset sending period is 200ms.
[0151] That is to say, the user continuously presses the control button on the pan-tilt to control the pan-tilt control device to execute once every 200ms: determine the current video frame collected by the image acquisition device carried by the pan-tilt from the above video stream, and extract the current position of the pan-tilt in the specified coordinate system from the current video frame; calculate the estimated position that the pan-tilt reaches after rotating for a specified duration from the current position according to the rotation direction; send a rotation instruction carrying the estimated position, rotation direction and specified duration to the pan-tilt. Until the user stops pressing the above control button.
[0152] Optionally, in a specific implementation manner, before the above step S101, a pan-tilt control method provided by an embodiment of the present invention may further include the following step 20:
[0153] Step 20: Obtain the horizontal rotation speed reported by the horizontal motor of the pan-tilt and the vertical rotation speed reported by the vertical motor of the pan-tilt.
[0154] In this specific implementation, a pan-tilt usually includes a horizontal motor for controlling the left-right rotation of the pan-tilt and a vertical motor for controlling the up-down rotation of the pan-tilt. Therefore, before controlling the pan-tilt, first, the horizontal rotation speed reported by the horizontal motor of the pan-tilt and the vertical rotation speed reported by the vertical motor of the pan-tilt can be obtained. Thus, after obtaining the current position of the pan-tilt, based on the above horizontal rotation speed, vertical rotation speed, current position, and rotation direction, the estimated position to which the pan-tilt rotates within a specified duration can be calculated.
[0155] Correspondingly, step S102, calculating the estimated position reached by the pan-tilt from the current position according to the rotation direction for a specified duration based on the current position and the pre-acquired motor rotation speed of the pan-tilt, may include the following steps 1021-1022:
[0156] Step 1021: Calculate the horizontal estimated position reached by the pan-tilt from the current position according to the rotation direction for a specified duration based on the horizontal position and horizontal rotation speed in the current position.
[0157] In this specific implementation, after obtaining the current position and the pre-acquired motor rotation speed of the pan-tilt, the horizontal estimated position reached by the pan-tilt from the current position according to the rotation direction for a specified duration can be calculated based on the horizontal position in the current position and the horizontal rotation speed of the horizontal motor of the pan-tilt.
[0158] For example, the horizontal position in the current position of pan-tilt B is x B , the horizontal rotation speed of the horizontal motor of the pan-tilt is s1, and the specified duration is t B , then the horizontal estimated position reached by the pan-tilt from the current position according to the rotation direction for a specified duration can be calculated as: x B ±t B *s1. Wherein, in the above formula, if the sign between the horizontal position x B in the current position of pan-tilt B, the horizontal rotation speed s1 of the horizontal motor of the pan-tilt, and the product of the specified duration t B is a positive sign, it indicates that the rotation direction of the pan-tilt is the same as the positive coordinate direction in the specified coordinate system; if the sign between the horizontal position x B in the current position of pan-tilt B, the horizontal rotation speed s1 of the horizontal motor of the pan-tilt, and the product of the specified duration t B is a negative sign, it indicates that the rotation direction of the pan-tilt is opposite to the positive coordinate direction in the specified coordinate system.
[0159] Optionally, in a specific implementation, when the specified coordinate system is: the position where the pan-tilt is located when the above horizontal motor is at the left rotation shaft limit and the above vertical motor is at the lower rotation shaft limit is the origin, the horizontal rotation direction of the pan-tilt is the horizontal axis, and the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit is the positive direction of the horizontal axis, and the vertical rotation direction of the pan-tilt is the vertical axis and the rotation direction from the lower rotation shaft limit to the upper rotation shaft limit is the positive direction of the vertical axis, step 1021 described above may include the following steps 21-23:
[0160] Step 21: Calculate the first product of the horizontal rotation speed and the specified duration; if the horizontal rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the horizontal axis of the specified coordinate system, then execute step 22; if the horizontal rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the horizontal axis of the specified coordinate system, then execute step 23;
[0161] Step 22: Calculate the sum of the first product and the horizontal position in the current position, and determine the sum and the minimum value in the right rotation shaft limit as the horizontal estimated position;
[0162] Step 23: Calculate the difference between the horizontal position in the current position and the first product, and determine the difference and the maximum value in the left rotation shaft limit as the horizontal estimated position.
[0163] In this specific implementation, after obtaining the current position and the pre-obtained rotation speed of the motors of the pan-tilt, the horizontal position in the current position, the horizontal rotation speed of the horizontal motor of the pan-tilt, and the specified duration can be determined. First, the first product of the above horizontal rotation speed and the above specified duration can be calculated.
[0164] Since there are positive and negative directions for the horizontal axis of the specified coordinate system, there are forward and reverse directions for the rotation direction of the pan-tilt in the horizontal rotation direction.
[0165] If the horizontal rotation direction corresponding to the rotation direction of the pan-tilt is the same as the positive coordinate direction of the horizontal axis of the above specified coordinate system, that is, the rotation direction of the pan-tilt is the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit, then the sum of the above first product and the horizontal position in the current position can be calculated, and the sum and the minimum value in the right rotation shaft limit can be determined as the horizontal estimated position of the pan-tilt.
[0166] For example, the right rotation shaft limit of the horizontal motor of the pan-tilt is 10, and the sum of the calculated first product and the horizontal position in the current position is 15. Since the horizontal motor of the pan-tilt will not continue to rotate when it rotates to 10 to the right, the horizontal estimated position of the pan-tilt can be determined to be 10.
[0167] If the horizontal rotation direction corresponding to the rotation direction of the pan-tilt is opposite to the positive coordinate direction of the horizontal axis of the above-specified coordinate system, that is, the rotation direction of the pan-tilt is the rotation direction of the horizontal motor of the pan-tilt from the right rotation axis limit to the left rotation axis limit, then the difference between the above first product and the horizontal position in the current position can be calculated, and the maximum value of the above difference and the above left rotation axis limit is determined as the horizontal estimated position of the pan-tilt.
[0168] For example, the left rotation axis limit of the horizontal motor of the pan-tilt is 0, and the difference between the calculated first product and the horizontal position in the current position is -1. Since the horizontal motor of the pan-tilt will not continue to rotate when it rotates to 0 to the left, the horizontal estimated position of the pan-tilt can be determined to be 0.
[0169] Step 1022: Calculate the vertical estimated position that the pan-tilt reaches after rotating for a specified duration from the current position according to the rotation direction based on the vertical position and vertical rotation speed in the current position.
[0170] In this specific implementation, after obtaining the current position and the pre-obtained motor rotation speed of the pan-tilt, the vertical estimated position that the pan-tilt reaches after rotating for a specified duration from the current position can be calculated based on the vertical position in the current position and the vertical rotation speed of the vertical motor of the pan-tilt.
[0171] For example, the vertical position in the current position of pan-tilt B is y B , the vertical rotation speed of the horizontal motor of the pan-tilt is s2, and the specified duration is t B , then the vertical estimated position that the pan-tilt reaches after rotating for a specified duration from the current position according to the rotation direction that is the same as the positive coordinate direction in the specified coordinate system can be calculated as: y B +t B *s2.
[0172] Optionally, in a specific implementation, when the specified coordinate system is: the position where the pan-tilt is located is the origin when the above horizontal motor is at the left rotation axis limit and the above vertical motor is at the lower rotation axis limit, the horizontal rotation direction of the pan-tilt is the horizontal axis and the rotation direction of the horizontal motor of the pan-tilt from the left rotation axis limit to the right rotation axis limit is the positive direction of the horizontal axis, and the vertical rotation direction of the pan-tilt is the vertical axis and the rotation direction from the lower rotation axis limit to the upper rotation axis limit is the positive direction of the vertical axis, the above step 1022 may include the following steps 31-33:
[0173] Step 31: Calculate the second product of the vertical rotation speed and the specified duration; if the vertical rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the vertical axis of the specified coordinate system, then execute step 32; if the vertical rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the vertical axis of the specified coordinate system, then execute step 33;
[0174] Step 32: Calculate the sum of the second product and the vertical position at the current position, and determine the sum and the minimum value in the upper rotation axis limit as the vertical estimated position;
[0175] Step 33: Calculate the difference between the vertical position at the current position and the second product, and determine the difference and the maximum value in the lower rotation axis limit as the vertical estimated position.
[0176] In this specific implementation, after obtaining the current position and the pre-obtained motor speed of the pan-tilt, the vertical position at the current position, the vertical speed of the vertical motor of the pan-tilt, and the specified duration can be determined. First, the second product of the above vertical speed and the above specified duration can be calculated.
[0177] Since there are positive and negative directions for the longitudinal axis of the specified coordinate system, the rotation direction of the pan-tilt in the vertical rotation direction has forward and reverse directions.
[0178] If the vertical rotation direction corresponding to the rotation direction of the pan-tilt is the same as the positive coordinate direction of the longitudinal axis of the above specified coordinate system, that is, the rotation direction of the pan-tilt is the rotation direction of the horizontal motor of the pan-tilt from the lower rotation axis limit to the upper rotation axis limit, then the sum of the above second product and the vertical position at the current position can be calculated, and the sum and the minimum value in the above upper rotation axis limit can be determined as the vertical estimated position of the pan-tilt.
[0179] For example, the upper rotation axis limit of the vertical motor of the pan-tilt is 10, and the sum of the calculated second product and the vertical position at the current position is 15. Since the vertical motor of the pan-tilt will not continue to rotate when it rotates upward to 10, the vertical estimated position of the pan-tilt can be determined to be 10.
[0180] If the vertical rotation direction corresponding to the rotation direction of the pan-tilt is opposite to the positive coordinate direction of the longitudinal axis of the above specified coordinate system, that is, the rotation direction of the pan-tilt is the rotation direction of the horizontal motor of the pan-tilt from the upper rotation axis limit to the lower rotation axis limit, then the difference between the above second product and the vertical position at the current position can be calculated, and the difference and the maximum value in the above lower rotation axis limit can be determined as the vertical estimated position of the pan-tilt.
[0181] For example, the lower rotation axis limit of the vertical motor of the pan-tilt is 0, and the difference between the calculated second product and the vertical position at the current position is -2. Since the vertical motor of the pan-tilt will not continue to rotate when it rotates downward to 0, the vertical estimated position of the pan-tilt can be determined to be 0.
[0182] In this way, after calculating the horizontal estimated position and the vertical estimated position to which the pan-tilt rotates within the specified duration, the estimated position to which the pan-tilt rotates within the specified duration can be determined.
[0183] Corresponding to the pan-tilt control method provided in the embodiments of the present invention described above, the embodiments of the present invention also provide a pan-tilt control system.
[0184] Figure 4 As shown in the structural schematic diagram of a pan-tilt control system provided in the embodiments of the present invention, Figure 4 as shown, the system may include an image acquisition device 410, a pan-tilt control device 420, and a pan-tilt 430, where:
[0185] The image acquisition device 410 is configured to acquire video frames; wherein, the image acquisition device 410 is mounted on the pan-tilt 430;
[0186] The pan-tilt control device 420 is configured to obtain the video frames acquired by the image acquisition device; when detecting a trigger operation for a rotation instruction regarding the pan-tilt 430, determine the current video frame acquired by the image acquisition device 410, and extract the current position of the pan-tilt 430 in a specified coordinate system from the current video frame; wherein, the trigger operation indicates the rotation direction of the pan-tilt 430; calculate the estimated position that the pan-tilt 430 reaches after rotating for a specified duration from the current position in the rotation direction based on the current position and the motor rotation speed of the pan-tilt 430 acquired in advance, and send a rotation instruction carrying the estimated position, the rotation direction, and the specified duration to the pan-tilt 430;
[0187] The pan-tilt 430 is configured to receive the rotation instruction carrying the estimated position, the rotation direction, and the specified duration sent by the pan-tilt control device 420, rotate in the rotation direction, and rotate to a first position not exceeding the estimated position within the specified duration.
[0188] As can be seen above, by applying the solution provided in the embodiments of the present invention, first, it can be determined whether a trigger operation for a rotation instruction regarding the pan-tilt is detected, where the above trigger operation is used to indicate the rotation direction of the above pan-tilt. When the above trigger operation is detected, the current video frame acquired by the image acquisition device mounted on the above pan-tilt can be determined, and thus, the current position of the above pan-tilt in a specified coordinate system can be extracted from the above current video frame. Then, the estimated position that the above pan-tilt reaches after rotating for a specified duration from the current position in the above rotation direction can be calculated based on the above current position and the motor rotation speed of the above pan-tilt acquired in advance, and thus, a rotation instruction carrying the above estimated position, the above rotation direction, and the above specified duration can be sent to the above pan-tilt, so that the above pan-tilt moves in the above rotation direction and moves to a first position not exceeding the above estimated position within the above specified duration.
[0189] Based on this, when applying the solution provided by the embodiments of the present invention to control the pan-tilt to move, it is possible to control the position where the pan-tilt rotates within a specified duration not to exceed the estimated position, thereby avoiding excessive rotation of the pan-tilt, and further reducing the deviation between the position of the pan-tilt corresponding to the video frame seen by the user due to network latency and the actual current position of the pan-tilt, and further improving the accuracy of pan-tilt control.
[0190] Optionally, in a specific implementation manner, the pan-tilt control device 420 is specifically configured to:
[0191] When detecting a trigger operation for a continuous rotation instruction regarding the pan-tilt, determine the current video frame captured by the image acquisition device carried by the pan-tilt;
[0192] The pan-tilt control device 420 is further configured to:
[0193] After the duration corresponding to the preset sending period, return to the step of determining the current video frame captured by the image acquisition device carried by the pan-tilt; until the detection of the stop of the trigger operation.
[0194] Optionally, in a specific implementation manner, the pan-tilt control device 420 is further configured to:
[0195] Before detecting a trigger operation for a rotation instruction regarding the pan-tilt and determining the current video frame captured by the image acquisition device carried by the pan-tilt, obtain the horizontal rotation speed reported by the horizontal motor of the pan-tilt and the vertical rotation speed reported by the vertical motor; or, the horizontal rotation speed of the horizontal motor of the pan-tilt and the vertical rotation speed of the vertical motor input by the user;
[0196] The pan-tilt control device 420 is specifically configured to:
[0197] Based on the horizontal position in the current position and the horizontal rotation speed, calculate the horizontal estimated position that the pan-tilt reaches from the current position by rotating in the rotation direction for the specified duration;
[0198] Based on the vertical position in the current position and the vertical rotation speed, calculate the vertical estimated position that the pan-tilt reaches from the current position by rotating in the rotation direction for the specified duration.
[0199] Optionally, in a specific implementation manner, the pan-tilt control device 420 is further configured to:
[0200] Obtain the left rotation shaft limit and right rotation shaft limit of the horizontal motor, and the upper rotation shaft limit and lower rotation shaft limit of the vertical motor;
[0201] Taking the position of the pan-tilt when the horizontal motor is limited by the left rotating shaft and the vertical motor is limited by the lower rotating shaft as the origin, a specified coordinate system is established with the horizontal axis as the horizontal rotation direction of the pan-tilt and the vertical axis as the vertical rotation direction of the pan-tilt; wherein, the positive direction of the horizontal axis is: the rotation direction of the horizontal motor of the pan-tilt from the left rotating shaft limit to the right rotating shaft limit; the positive direction of the vertical axis is: the rotation direction of the vertical motor of the pan-tilt from the lower rotating shaft limit to the upper rotating shaft limit.
[0202] Optionally, in a specific implementation, the pan-tilt control device 420 is specifically configured to:
[0203] Calculate the first product of the horizontal rotation speed and the specified duration;
[0204] If the horizontal rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the horizontal axis of the specified coordinate system, calculate the sum of the first product and the horizontal position in the current position, and determine the sum value and the minimum value in the right rotating shaft limit as the horizontal estimated position;
[0205] If the horizontal rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the horizontal axis of the specified coordinate system, calculate the difference between the horizontal position in the current position and the first product, and determine the difference value and the maximum value in the left rotating shaft limit as the horizontal estimated position;
[0206] The pan-tilt control device 420 is specifically configured to:
[0207] Calculate the second product of the vertical rotation speed and the specified duration;
[0208] If the vertical rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the vertical axis of the specified coordinate system, calculate the sum of the second product and the vertical position in the current position, and determine the sum value and the minimum value in the upper rotating shaft limit as the vertical estimated position;
[0209] If the vertical rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the vertical axis of the specified coordinate system, calculate the difference between the vertical position in the current position and the second product, and determine the difference value and the maximum value in the lower rotating shaft limit as the vertical estimated position.
[0210] Exemplarily, such as Figure 5As shown in the figure, it is a schematic structural diagram of another pan-tilt control system provided by an embodiment of the present invention. The system includes: a pan-tilt control device 501 and a pan-tilt camera 503, and the above pan-tilt camera 503 includes an image acquisition device 5031, a pan-tilt 5032, and a communication module 5033. Among them, the communication module 5033 is connected to the pan-tilt control device 501 through a communication link 502. That is to say, the communication module 5033 and the pan-tilt control device 501 can realize signaling interaction through the communication link 502. Furthermore, the signaling interaction between the pan-tilt control device 501 and the pan-tilt camera 503 is completed.
[0211] Among them, the image acquisition device 5031 is mounted on the pan-tilt 5032, and video frames are collected as the pan-tilt 5032 moves, and the collected video frames are sent to the communication module 5033, so that after receiving the above video frames, the communication module 5033 sends the received video frames to the pan-tilt control device 501 through the communication link 502.
[0212] After receiving the above video frames, the pan-tilt control device 501 can determine the current video frame collected by the image acquisition device 5031 based on the above video frames. Thus, the pan-tilt control device 501 can determine the current position of the pan-tilt 5032 from the above current video frame. Furthermore, using the above current position and the pre-acquired motor speed of the pan-tilt 5032, calculate the estimated position that the pan-tilt 5032 reaches after rotating for a specified duration in the above rotation direction from the above current position, and send a rotation instruction carrying the above estimated position, the above rotation direction, and the above specified duration to the above communication module 5033 through the communication link 502, so that after receiving the above rotation instruction, the above communication module 5033 sends a rotation instruction carrying the above estimated position, the above rotation direction, and the above specified duration to the pan-tilt 5032.
[0213] After receiving the above rotation instruction sent by the above communication module 5033, the pan-tilt 5032 can rotate in the above rotation direction and rotate to a first position that does not exceed the above estimated position within the above specified duration.
[0214] Corresponding to the pan-tilt control method provided by the above embodiment of the present invention, the embodiment of the present invention also provides a pan-tilt control device.
[0215] Figure 6 It is a schematic structural diagram of a pan-tilt control device according to an embodiment of the present invention. As Figure 6 shown, the device may include the following modules:
[0216] A position extraction module 610, configured to determine a current video frame captured by an image acquisition device carried by the pan-tilt when detecting a trigger operation of a rotation instruction for the pan-tilt, and extract a current position of the pan-tilt in a specified coordinate system from the current video frame; wherein, the trigger operation indicates a rotation direction of the pan-tilt;
[0217] A calculation module 620, configured to calculate a predicted position that the pan-tilt reaches after rotating for a specified duration from the current position in the rotation direction based on the current position and a pre-acquired motor rotation speed of the pan-tilt;
[0218] A control module 630, configured to send a rotation instruction carrying the predicted position, the rotation direction, and the specified duration to the pan-tilt, so that the pan-tilt rotates in the rotation direction and rotates to a first position not exceeding the predicted position within the specified duration.
[0219] As can be seen above, by applying the solution provided in the embodiment of the present invention, first, it can be determined whether a trigger operation of a rotation instruction for the pan-tilt is detected, wherein the above trigger operation is used to indicate the rotation direction of the above pan-tilt. When the above trigger operation is detected, the current video frame captured by the image acquisition device carried by the above pan-tilt can be determined, and thus, the current position of the above pan-tilt in the specified coordinate system can be extracted from the above current video frame. Then, the predicted position that the pan-tilt reaches after rotating for a specified duration from the current position in the rotation direction can be calculated based on the above current position and the pre-acquired motor rotation speed of the above pan-tilt, and thus, a rotation instruction carrying the above predicted position and the above rotation direction can be sent to the above pan-tilt, so that the above pan-tilt moves in the above rotation direction and moves to a first position not exceeding the above predicted position within the above specified duration.
[0220] Based on this, by applying the solution provided in the embodiment of the present invention, when controlling the pan-tilt to move, it can be controlled that the position reached by the pan-tilt within a specified duration does not exceed the predicted position, and thus, the over-rotation of the pan-tilt can be avoided. Furthermore, the deviation between the position of the pan-tilt corresponding to the video frame seen by the user due to network latency and the actual current position of the pan-tilt can be reduced, and further, the accuracy of pan-tilt control can be improved.
[0221] Optionally, in a specific implementation manner, the position extraction module 610 is specifically configured to:
[0222] When detecting a trigger operation of a continuous rotation instruction for the pan-tilt, determine the current video frame captured by the image acquisition device carried by the pan-tilt;
[0223] The control module 630 is further configured to trigger the position extraction module 610 after the duration corresponding to a preset sending period; until it is detected that the triggering operation stops.
[0224] Optionally, in a specific implementation manner, the device further includes:
[0225] A rotation speed acquisition module, configured to acquire the horizontal rotation speed reported by the horizontal motor and the vertical rotation speed reported by the vertical motor of the pan-tilt before determining the current video frame collected by the image acquisition device carried by the pan-tilt when a triggering operation for a rotation instruction of the pan-tilt is detected;
[0226] The calculation module 620 includes a horizontal estimated position sub-module and a vertical estimated position sub-module:
[0227] The horizontal estimated position sub-module is configured to calculate the horizontal estimated position reached by the pan-tilt rotating from the current position in the rotation direction for the specified duration based on the horizontal position in the current position and the horizontal rotation speed;
[0228] The vertical estimated position sub-module is configured to calculate the vertical estimated position reached by the pan-tilt rotating from the current position in the rotation direction for the specified duration based on the vertical position in the current position and the vertical rotation speed.
[0229] Optionally, in a specific implementation manner, the device further includes a coordinate system establishment module:
[0230] The coordinate system establishment module is configured to acquire the left rotation shaft limit and the right rotation shaft limit of the horizontal motor, and the upper rotation shaft limit and the lower rotation shaft limit of the vertical motor;
[0231] Taking the position where the pan-tilt is located when the horizontal motor is at the left rotation shaft limit and the vertical motor is at the lower rotation shaft limit as the origin, establish a specified coordinate system with the horizontal rotation direction of the pan-tilt as the horizontal axis and the vertical rotation direction of the pan-tilt as the vertical axis; wherein, the positive coordinate direction of the horizontal axis: the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit; the positive coordinate direction of the vertical axis: the rotation direction of the vertical motor of the pan-tilt from the lower rotation shaft limit to the upper rotation shaft limit.
[0232] Optionally, in a specific implementation manner, the horizontal estimated position sub-module is specifically configured to:
[0233] Calculate the first product of the horizontal rotation speed and the specified duration;
[0234] If the horizontal rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the horizontal axis of the specified coordinate system, calculate the sum of the first product and the horizontal position in the current position, and determine the sum value and the minimum value in the right rotation axis limit as the horizontal predicted position;
[0235] If the horizontal rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the horizontal axis of the specified coordinate system, calculate the difference between the horizontal position in the current position and the first product, and determine the difference value and the maximum value in the left rotation axis limit as the horizontal predicted position;
[0236] The vertical predicted position sub-module is specifically used for:
[0237] Calculate the second product of the vertical rotation speed and the specified duration;
[0238] If the vertical rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the vertical axis of the specified coordinate system, calculate the sum of the second product and the vertical position in the current position, and determine the sum value and the minimum value in the upper rotation axis limit as the vertical predicted position;
[0239] If the vertical rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the vertical axis of the specified coordinate system, calculate the difference between the vertical position in the current position and the second product, and determine the difference value and the maximum value in the lower rotation axis limit as the vertical predicted position.
[0240] Corresponding to the above-mentioned pan-tilt control method provided by the embodiment of the present invention, the embodiment of the present invention also provides a pan-tilt control device, as Figure 7 shown, including a processor 701, a communication interface 702, a memory 703, and a communication bus 704. Among them, the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
[0241] The memory 703 is used to store a computer program;
[0242] The processor 701 is used to implement the steps of any of the pan-tilt control methods provided by the above-mentioned embodiments of the present invention when executing the program stored on the memory 703.
[0243] The communication bus mentioned in the above pan-tilt control device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0244] The communication interface is used for communication between the above pan-tilt control device and other devices.
[0245] The memory may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0246] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0247] In another embodiment provided by the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above pan-tilt control methods are implemented.
[0248] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the pan-tilt control methods in the above embodiments.
[0249] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0250] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the element.
[0251] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system embodiments, device embodiments, pan-tilt control device embodiments, computer-readable storage medium embodiments, and computer program product embodiments, since they are basically similar to method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for the relevant content.
[0252] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.
Claims
1. A pan-tilt control method, characterized in that, The method includes: When a trigger operation for a rotation instruction of the pan-tilt is detected, determining a current video frame captured by an image acquisition device carried by the pan-tilt, and extracting a current position of the pan-tilt in a specified coordinate system from the current video frame; wherein, the trigger operation indicates a rotation direction of the pan-tilt; Based on the current position and the motor rotation speed of the pan-tilt obtained in advance, calculating an estimated position that the pan-tilt reaches after rotating for a specified duration in the rotation direction from the current position; Sending a rotation instruction carrying the estimated position, the rotation direction, and the specified duration to the pan-tilt, so that the pan-tilt rotates in the rotation direction and rotates to a first position not exceeding the estimated position within the specified duration.
2. The method according to claim 1, characterized in that The determining the current video frame captured by the image acquisition device carried by the pan-tilt when a trigger operation for a rotation instruction of the pan-tilt is detected includes: When a trigger operation for a continuous rotation instruction of the pan-tilt is detected, determining the current video frame captured by the image acquisition device carried by the pan-tilt; The method further includes: After a duration corresponding to a preset sending period, returning to the step of determining the current video frame captured by the image acquisition device carried by the pan-tilt; until the detection of the stop of the trigger operation.
3. The method according to claim 1, characterized in that Before the determining the current video frame captured by the image acquisition device carried by the pan-tilt when a trigger operation for a rotation instruction of the pan-tilt is detected, the method further includes: Obtaining a horizontal rotation speed reported by the horizontal motor of the pan-tilt and a vertical rotation speed reported by the vertical motor of the pan-tilt; The calculating the estimated position that the pan-tilt reaches after rotating for a specified duration in the rotation direction from the current position based on the current position and the motor rotation speed of the pan-tilt obtained in advance includes: Based on the horizontal position in the current position and the horizontal rotation speed, calculating a horizontal estimated position that the pan-tilt reaches after rotating for the specified duration in the rotation direction from the current position; Based on the vertical position in the current position and the vertical rotation speed, calculating a vertical estimated position that the pan-tilt reaches after rotating for the specified duration in the rotation direction from the current position.
4. The method according to claim 3, wherein The establishment method of the specified coordinate system includes: Obtaining a left rotation shaft limit and a right rotation shaft limit of the horizontal motor, and an upper rotation shaft limit and a lower rotation shaft limit of the vertical motor; Taking the position where the pan-tilt is located when the horizontal motor is at the left rotation shaft limit and the vertical motor is at the lower rotation shaft limit as the origin, establishing a specified coordinate system with the horizontal rotation direction of the pan-tilt as the horizontal axis and the vertical rotation direction of the pan-tilt as the vertical axis; wherein, the positive direction of the horizontal axis is: the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit; the positive direction of the vertical axis is: the rotation direction of the vertical motor of the pan-tilt from the lower rotation shaft limit to the upper rotation shaft limit.
5. According to the method of claim 4, wherein Calculating the horizontal estimated position that the pan-tilt reaches after rotating for the specified duration from the current position in the rotation direction based on the horizontal position and the horizontal rotation speed in the current position, includes: Calculating a first product of the horizontal rotation speed and the specified duration; If the horizontal rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the horizontal axis of the specified coordinate system, calculating the sum of the first product and the horizontal position in the current position, and determining the sum and the minimum value in the right rotation axis limit as the horizontal estimated position; If the horizontal rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the horizontal axis of the specified coordinate system, calculating the difference between the horizontal position in the current position and the first product, and determining the difference and the maximum value in the left rotation axis limit as the horizontal estimated position; Calculating the vertical estimated position that the pan-tilt reaches after rotating for the specified duration from the current position in the rotation direction based on the vertical position and the vertical rotation speed in the current position, includes: Calculating a second product of the vertical rotation speed and the specified duration; If the vertical rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the vertical axis of the specified coordinate system, calculating the sum of the second product and the vertical position in the current position, and determining the sum and the minimum value in the upper rotation axis limit as the vertical estimated position; If the vertical rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the vertical axis of the specified coordinate system, calculating the difference between the vertical position in the current position and the second product, and determining the difference and the maximum value in the lower rotation axis limit as the vertical estimated position.
6. A pan-tilt control system, characterized in that, The system includes: An image acquisition device for acquiring video frames; wherein, the image acquisition device is mounted on a pan-tilt; A pan-tilt control device for obtaining the video frames acquired by the image acquisition device; when detecting a trigger operation for a rotation instruction of the pan-tilt, determining the current video frame acquired by the image acquisition device, and extracting the current position of the pan-tilt in a specified coordinate system from the current video frame; wherein, the trigger operation indicates the rotation direction of the pan-tilt; calculating the estimated position that the pan-tilt reaches after rotating for a specified duration from the current position in the rotation direction based on the current position and the motor rotation speed of the pan-tilt acquired in advance, and sending a rotation instruction carrying the estimated position, the rotation direction, and the specified duration to the pan-tilt; The pan-tilt for receiving the rotation instruction carrying the estimated position, the rotation direction, and the specified duration sent by the pan-tilt control device, rotating in the rotation direction and rotating to a first position not exceeding the estimated position within the specified duration.
7. The system according to claim 6, wherein The pan-tilt control device is specifically used for: When detecting a trigger operation for a continuous rotation instruction of the pan-tilt, determining the current video frame acquired by the image acquisition device mounted on the pan-tilt; The pan-tilt control device is further used for: After the duration corresponding to the preset sending period, return to the step of determining the current video frame captured by the image acquisition device carried by the pan-tilt; until the detection of the trigger operation stops.
8. The system according to claim 6, characterized in that The pan-tilt control device is further configured to: Before detecting the trigger operation of the rotation instruction regarding the pan-tilt and determining the current video frame captured by the image acquisition device carried by the pan-tilt, obtain the horizontal rotation speed reported by the horizontal motor of the pan-tilt and the vertical rotation speed reported by the vertical motor of the pan-tilt; Specifically, the pan-tilt control device is configured to: Based on the horizontal position in the current position and the horizontal rotation speed, calculate the horizontal predicted position that the pan-tilt reaches after rotating for the specified duration from the current position in the rotation direction; Based on the vertical position in the current position and the vertical rotation speed, calculate the vertical predicted position that the pan-tilt reaches after rotating for the specified duration from the current position in the rotation direction.
9. The system according to claim 8, wherein The pan-tilt control device is further configured to: Obtain the left rotation shaft limit and the right rotation shaft limit of the horizontal motor, and the upper rotation shaft limit and the lower rotation shaft limit of the vertical motor; Taking the position where the horizontal motor is at the left rotation shaft limit and the vertical motor is at the lower rotation shaft limit as the origin, establish a specified coordinate system with the horizontal rotation direction of the pan-tilt as the horizontal axis and the vertical rotation direction of the pan-tilt as the vertical axis; wherein, the positive coordinate direction of the horizontal axis: the rotation direction of the horizontal motor of the pan-tilt from the left rotation shaft limit to the right rotation shaft limit; the positive coordinate direction of the vertical axis: the rotation direction of the vertical motor of the pan-tilt from the lower rotation shaft limit to the upper rotation shaft limit.
10. The system according to claim 9, wherein Specifically, the pan-tilt control device is configured to: Calculate the first product of the horizontal rotation speed and the specified duration; If the horizontal rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the horizontal axis of the specified coordinate system, calculate the sum value of the first product and the horizontal position in the current position, and determine the sum value and the minimum value in the right rotation shaft limit as the horizontal predicted position; If the horizontal rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the horizontal axis of the specified coordinate system, calculate the difference between the horizontal position in the current position and the first product, and determine the difference and the maximum value in the left rotation shaft limit as the horizontal predicted position; Specifically, the pan-tilt control device is configured to: Calculate the second product of the vertical rotation speed and the specified duration; If the vertical rotation direction corresponding to the rotation direction is the same as the positive coordinate direction of the vertical axis of the specified coordinate system, calculate the sum value of the second product and the vertical position in the current position, and determine the sum value and the minimum value in the upper rotation shaft limit as the vertical predicted position; If the vertical rotation direction corresponding to the rotation direction is opposite to the positive coordinate direction of the vertical axis of the specified coordinate system, calculate the difference between the vertical position in the current position and the second product, and determine the difference and the maximum value in the lower rotation shaft limit as the vertical predicted position.
11. A pan-tilt control device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete their mutual communication through the communication bus; The memory is used to store computer programs; The processor is used to implement the method steps described in any one of claims 1-5 when executing the programs stored on the memory.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the method steps described in any one of claims 1-5.
Citation Information
Patent Citations
System and method for controlling cloud platform rotation and data analysis on two dimensional plane
CN102360224A
Holder rotation control method and device, and unmanned aerial vehicle
CN108549413A