A pan / tilt target conversion control method, device, equipment and storage medium
By calculating the rotation parameters, the PTZ equipment can quickly and accurately lock the target during high-voltage transmission line inspections, solving the stability and time-consuming problems caused by manual adjustment, and achieving stable and efficient target conversion of the PTZ equipment.
Patent Information
- Application Number
- CN202011543459.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-12-23
AI Technical Summary
During the inspection of high-voltage transmission lines, when the pan-tilt equipment adjusts the rotation angle, camera magnification and focal length under manual control, it is easy to cause the camera area to shake, resulting in unstable positioning of the target area, making it difficult to quickly and accurately lock the shooting target.
By obtaining the image captured by the gimbal device at the initial multiple, determine the initial position of the target object in the camera area, select a triangle model that matches the gimbal device and the target object, calculate the rotation parameters, and rotate the gimbal device to the target position, and capture images at high magnifications to achieve stable and fast target conversion.
It improves the speed and accuracy of the rotation parameter calculation of the gimbal equipment, ensures the stability and smoothness of the target conversion process, saves control time, and avoids the instability and time-consuming manual adjustment.
Smart Images

Figure CN112714287B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of detection robots, and in particular to a pan-tilt target conversion control method, device, equipment and storage medium. Background Art
[0002] Generally, high-voltage transmission lines are set up in the open air and require regular inspection and maintenance. The obstacle-crossing robot can cross obstacles such as high-voltage towers or line hardware, travel on high-voltage transmission lines, and detect hidden dangers and defects in high-voltage transmission lines and high-voltage towers in high-voltage transmission lines.
[0003] At present, the host computer can be used to send control instructions to the obstacle-crossing robot in the background to control the obstacle-crossing robot to move on the high-voltage transmission line and control the pan-tilt head on the obstacle-crossing robot to record the scene. The background analysts can analyze the hidden dangers and defects of the high-voltage transmission line based on the scene.
[0004] Furthermore, when controlling the pan-tilt head on the obstacle-crossing robot to record live images, a control instruction can be sent to the pan-tilt head to control the pan-tilt head to perform operations such as adjusting the rotation angle, camera magnification, and camera focal length.
[0005] It should be noted that when manually controlling the movement of the gimbal to acquire images of the target area, due to the high magnification of the camera, even a slight adjustment of the camera position can easily cause large-scale shaking of the camera area, leading to unstable control, and thus there is a problem of being unable to quickly manually locate the target area for shooting. Summary of the invention
[0006] The purpose of the present invention is to propose a pan-tilt target conversion control method, device, equipment and storage medium to achieve the rapidity and accuracy of determining the rotation parameters of the pan-tilt device, making the pan-tilt target conversion control more stable and smooth, and saving control time.
[0007] To achieve the above-mentioned purpose, the first aspect of the present application provides a pan / tilt target conversion control method, comprising:
[0008] Acquire a first image captured by the gimbal device at a first magnification;
[0009] Determine the position of the target object in the first image as the initial position of the target object in the camera area of the PTZ device;
[0010] Select a triangular model that matches the actual distance between the pan-tilt device and the target object, and calculate the rotation parameters required by the pan-tilt device when moving the target object from the initial position to the target position of the camera area, wherein the vertices of the triangular model are used to respectively represent the positions of the pan-tilt device, the target object before relative movement, and the target object after relative movement in space;
[0011] The pan / tilt device is controlled using the rotation parameter so that the pan / tilt device is rotated to the target position where the target object is located in the camera area, and a second image is obtained by shooting at a second magnification.
[0012] Further, the step of determining the position of the target object in the first image as the initial position of the target object in the camera area of the pan / tilt device includes:
[0013] displaying the first image;
[0014] receiving a first user operation acting on the first image;
[0015] In response to the first user operation, drawing a target area in the area where the target object is located in the first image;
[0016] The center position of the target area is determined as the initial position of the target object in the camera area of the pan / tilt device.
[0017] Further, the step of determining the position of the target object in the first image as the initial position of the target object in the camera area of the pan / tilt device includes:
[0018] performing a preprocessing operation on the first image and extracting image features from the first image;
[0019] Inputting the image features into a target recognition model to identify a target area where a target object is located in the first image;
[0020] The center position of the target area is determined as the initial position of the target object in the camera area of the pan / tilt device.
[0021] Further, the selecting of a triangle model that matches the actual distance between the pan-tilt device and the target object, and calculating the rotation parameters required by the pan-tilt device when moving the target object from the initial position to the target position of the camera area, includes:
[0022] Taking the difference between the initial position and the target position as the pixel movement distance of the target object in the imaging area;
[0023] According to a pre-determined linear correspondence between the actual distance and the pixel distance, the pixel movement distance is converted into an actual movement distance of the target object relative to the pan / tilt device;
[0024] Selecting a triangular model based on the actual distance between the pan-tilt device and the target object to represent the spatial triangular relationship between the pan-tilt device, the target object before relative movement, and the target object after relative movement, and using the actual movement distance to calculate the rotation angle of the pan-tilt device;
[0025] The rotation angle is used as a rotation parameter of the pan / tilt device.
[0026] Further, when the actual distance between the pan-tilt device and the target object exceeds a preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form an isosceles triangle in space;
[0027] The method of selecting a triangular model based on the actual distance between the pan-tilt device and the target object to represent the spatial triangular relationship between the pan-tilt device, the target object before relative movement, and the target object after relative movement, and using the actual movement distance to calculate the rotation angle of the pan-tilt device includes:
[0028] Determining the actual distance between the PTZ device and the target object;
[0029] Taking the actual distance as the length of the waist of the isosceles triangle and the actual moving distance as the length of the base of the isosceles triangle, based on the triangle cosine theorem, the angle of the angle opposite to the base is obtained;
[0030] The angle of the diagonal angle opposite to the bottom edge is determined as the rotation angle of the pan / tilt device.
[0031] Further, the determining the actual distance between the pan / tilt device and the target object includes:
[0032] Obtaining the actual size of the target object;
[0033] determining a pixel size of the target object in the first image;
[0034] Determine the ratio between the pixel size and the actual size as the actual ratio;
[0035] When the calibration object is at a unit distance from the pan / tilt device, the ratio between the actual distance corresponding to the calibration position and the pixel distance measured in advance is used as a reference ratio;
[0036] Determine the ratio between the actual ratio and the reference ratio as the distance multiple;
[0037] The product of the distance multiple and the unit distance is used as the actual distance between the pan / tilt device and the target object.
[0038] Further, the determining the actual distance between the pan / tilt device and the target object includes:
[0039] Moving the pan / tilt device to a preset point around the target object;
[0040] Acquire a target distance between the preset point and the target object;
[0041] The target distance is used as the actual distance between the pan / tilt device and the target object.
[0042] Further, when the actual distance between the pan-tilt device and the target object is less than or equal to a preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form a right triangle in space; wherein one right-angled side of the right triangle corresponds to a line between the target object before relative movement and the target object after relative movement; the other right-angled side corresponds to a line between the target object after relative movement and the pan-tilt device; and the hypotenuse corresponds to a line between the target object before relative movement and the pan-tilt device.
[0043] The method of selecting a triangular model based on the actual distance between the pan-tilt device and the target object to represent the spatial triangular relationship between the pan-tilt device, the target object before relative movement, and the target object after relative movement, and using the actual movement distance to calculate the rotation angle of the pan-tilt device includes:
[0044] Taking the actual distance between the target object and the pan / tilt device after the relative movement as the first distance;
[0045] Calculating a ratio of the actual moving distance to the first distance;
[0046] Calculating the inverse tangent value corresponding to the ratio;
[0047] The arc tangent value is determined as the rotation angle of the pan / tilt device.
[0048] Furthermore, before converting the pixel moving distance into the actual moving distance of the target object relative to the pan / tilt device according to the pre-determined linear correspondence between the actual distance and the pixel distance, the method further includes:
[0049] The camera device in the pan-tilt device is calibrated to obtain a linear correspondence between the actual distance and the pixel distance corresponding to the camera device.
[0050] Furthermore, before photographing at a second magnification to obtain a second image, the method further includes:
[0051] determining a target proportion of the imaging area occupied by the target object when the target object is moved to a target position of the imaging area;
[0052] Determine the original proportion of the target object in the first image;
[0053] The ratio between the target ratio and the original ratio is used as the magnification factor;
[0054] The product of the first multiple and the magnification multiple is used as the second multiple.
[0055] To achieve the above-mentioned purpose, the second aspect of the present application provides a pan / tilt target conversion control device, comprising:
[0056] A first image acquisition module, used to acquire a first image of a target object captured by the PTZ device at a first magnification;
[0057] An initial position determination module, used to determine the position of the target object in the first image as the initial position of the target object in the camera area of the PTZ device;
[0058] a rotation parameter calculation module, used to select a triangular model that matches the actual distance between the pan-tilt device and the target object, and calculate the rotation parameters required by the pan-tilt device when the target object is moved from the initial position to the target position of the camera area, wherein the vertices of the triangular model are used to respectively represent the positions of the pan-tilt device, the target object before relative movement, and the target object after relative movement in space;
[0059] The second image acquisition module is used to control the pan-tilt device to rotate according to the rotation parameter, so that the pan-tilt device rotates to the target position where the target object is located in the camera area, and captures the second image of the target object at a second magnification.
[0060] To achieve the above-mentioned purpose, the third aspect of the present application provides a pan / tilt target conversion control device, comprising: a memory and one or more processors;
[0061] The memory is used to store one or more programs;
[0062] When the one or more programs are executed by the one or more processors, the one or more processors implement the gimbal target conversion control method as described in any one of the first aspects.
[0063] To achieve the above-mentioned purpose, the fourth aspect of the present application provides a storage medium containing computer executable instructions, and the computer executable instructions are used to execute the gimbal target conversion control method as described in any one of the first aspects when executed by a computer processor.
[0064] As can be seen from the above, the technical solution provided by the present application is to obtain a first image of a target object photographed by a gimbal device at a first magnification; determine the position of the target object in the first image as the initial position of the target object in the camera area of the gimbal device; select a triangular model that matches the actual distance between the gimbal device and the target object, and calculate the rotation parameters required by the gimbal device when moving the target object from the initial position to the target position in the camera area, wherein the vertices of the triangular model are used to respectively represent the positions of the gimbal device, the target object before relative movement, and the target object after relative movement in space; control the gimbal device to rotate according to the rotation parameters so that the gimbal device rotates to the target position where the target object is located in the camera area, and photograph the second image of the target object at a second magnification, thereby achieving the rapidity and accuracy of determining the rotation parameters of the gimbal device, making the gimbal target conversion control more stable and smooth, and saving the control time. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1A This is a flow chart of a pan / tilt target conversion control method provided in Embodiment 1 of the present invention;
[0066] Figure 1B A schematic diagram of a target object located at an initial position provided in Embodiment 1 of the present invention;
[0067] Figure 1C A schematic diagram of a target object moving in a camera area provided by Embodiment 1 of the present invention;
[0068] Figure 1D A schematic diagram of the spatial positions of a pan / tilt device, a target object before relative movement, and a target object after relative movement provided by Embodiment 1 of the present invention;
[0069] Figure 1E A schematic diagram of the spatial positions of another pan / tilt device, a target object before relative movement, and a target object after relative movement provided in Embodiment 1 of the present invention;
[0070] Figure 2A schematic diagram of the structure of a pan / tilt target conversion control device provided in Embodiment 2 of the present invention;
[0071] Figure 3 A schematic structural diagram of a pan / tilt target conversion control device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0072] The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.
[0073] Example 1
[0074] The present application provides a pan-tilt target conversion control method, which can be executed by a pan-tilt target conversion control device, which can be implemented by software and / or hardware and integrated in a pan-tilt target conversion control device. Optionally, the pan-tilt target conversion control device can be a host computer of the pan-tilt device, which includes but is not limited to a terminal such as a computer or a server. In this embodiment, the pan-tilt target conversion control device is a server as an example for detailed description.
[0075] Figure 1A This is a flow chart of a pan / tilt target conversion control method provided by Embodiment 1 of the present invention. Figure 1A , the method may include the following steps:
[0076] S110, obtaining a first image of a target object captured by a pan / tilt device at a first magnification.
[0077] In this embodiment, it can be applied to the remote control of the pan-tilt device in the obstacle-crossing robot. Specifically, the obstacle-crossing robot can travel on the high-voltage transmission line and record the image or video in the high-voltage transmission line through the pan-tilt device. Furthermore, the high-voltage transmission line itself or the surrounding environment can be analyzed based on the image or video, and faults can be detected and repaired in a timely manner.
[0078] Generally, on the one hand, the host computer can send control instructions to the obstacle-crossing robot to control the obstacle-crossing robot to move along the high-voltage transmission line; on the other hand, it can also send control instructions to the pan-tilt device on the obstacle-crossing robot to control the rotation of the pan-tilt device, camera and other operations.
[0079] In this embodiment, the target object is an object that needs to be detected and photographed. For example, for an obstacle-crossing robot used to detect high-voltage transmission lines, the target object is a key component in the high-voltage transmission line, such as an insulator string vertically suspended from a tower head, or a shock-absorbing hammer.
[0080] In this embodiment, the host computer can control the pan-tilt device to capture the first image of the high-voltage transmission line while controlling the obstacle-crossing robot to move.
[0081] It should be noted that, in this embodiment, the first magnification can be configured as a low magnification, such as 1, so that the pan-tilt device can obtain as much field of view as possible on the obstacle-crossing robot's path.
[0082] In addition, in this embodiment, the target object in the image, such as the target object in the first image described in this embodiment, refers to the pixel point corresponding to the actual target object in the first image.
[0083] S120: Determine the position of the target object in the first image as the initial position of the target object in the camera area of the pan / tilt device.
[0084] In this embodiment, the relative position of the target object in the imaging area refers to the position of the actual target object after being projected to the imaging area through the convex lens and other imaging components in the imaging device. Further, for a photosensitive imaging device, the imaging area may correspond to the photosensitive area of the imaging device. In short, the imaging area corresponds to the area range that the imaging device can capture, that is, the area range seen in the image captured by the imaging device.
[0085] Generally, the target objects are distributed at different positions in the obstacle-crossing robot's travel path. When the gimbal device uses the same rotation angle for recording, the target objects tend to appear at the edge of the camera area, which is not conducive to clearly obtaining the image corresponding to the target object, and is even more detrimental to the subsequent fault analysis of the target object based on the image.
[0086] In this embodiment, in order to obtain a clear image of the target object in time, the pan-tilt device can be controlled to rotate, that is, the camera angle of the pan-tilt device can be adjusted so that the target object falls on the target position in the camera area. The target position is closer to the center of the camera area than the edge position. Of course, the target position can be directly set to the geometric center of the camera area.
[0087] Figure 1B A schematic diagram of a target object located at an initial position provided in Embodiment 1 of the present invention. Figure 1B In this embodiment, the target area where the target object is located can be identified in the first image, and the geometric center of the target area is used as the initial position of the target object in the camera area. Figure 1B In FIG. 3 , three rectangular frames are used to identify the target areas of three target objects (insulator strings). The geometric center of the rectangular frame can be used as the position of the target object in the first image, that is, the initial position of the target object in the camera area.
[0088] Specifically, in this embodiment, two methods can be used to determine the initial position of the target object in the camera area of the pan / tilt device, including: a manual method and an automatic method.
[0089] 1. Manual method
[0090] In this embodiment, the host computer can receive a first image from the gimbal device and display the first image; thereafter, receive a first user operation acting on the first image, such as a user operation of a picture frame; in response to the first user operation, draw a target area in the area where the target object is located in the first image; and determine the center position of the target area as the initial position of the target object in the camera area of the gimbal device.
[0091] The center position is the geometric center of the target area. For example, when the target area is a rectangular frame, the center position is the center of the rectangular frame; for example, when the target area is a circular frame, the center position is the center of the circular frame.
[0092] 2. Automatic method
[0093] In this embodiment, the first image can be preprocessed and image features can be extracted from the first image; the image features are input into a target recognition model to identify a target area where a target object is located in the first image; and the center position of the target area is determined as the initial position of the target object in the camera area of the pan-tilt device.
[0094] Among them, the preprocessing operation can use an image noise reduction algorithm to remove the noise interference generated by the camera device or the external environment to obtain a first image with less noise and high definition; an image enhancement algorithm can also be used to improve the contrast of the first image, increase or decrease the edge information of the target object, etc. Specifically, the contrast can be stretched to enhance the dynamic range of the grayscale; histogram equalization can also be used to perform global image equalization processing, etc.
[0095] Furthermore, the image feature may be an edge feature in the first image, etc. The target recognition model may use target detection algorithms such as MobileNet-SSD, SSD, YOLO, Faster-RCNN and FPN. Preferably, the target recognition model may be set to a model using the MobileNet-SSD target detection algorithm.
[0096] Furthermore, after the image features are input into the target recognition model, the type of the target object can be identified through recognition processing by the target recognition model, and the position and size of the target area of the target object in the image can also be identified. Accordingly, a rectangular frame can be drawn in the first image according to the position and size to identify the target area where the target object is located.
[0097] Furthermore, the center position of the target area can be used as the initial position of the target object in the camera area of the pan / tilt device.
[0098] S130, calculating the rotation parameters required by the pan / tilt device when moving the target object from the initial position to the target position of the camera area.
[0099] In this embodiment, the rotation parameter may correspond to the rotation angle. In addition, the pan-tilt device can rotate in several dimensions, which may correspond to several sets of rotation angles. For example, the pan-tilt device can rotate in the vertical direction and the horizontal direction, and the rotation parameter may correspond to the rotation angle of the pan-tilt device in the vertical direction and the rotation angle in the horizontal direction.
[0100] In this embodiment, when the pan-tilt device rotates, the corresponding image in the camera area of the camera device on the pan-tilt device also changes. That is, as the pan-tilt device rotates, the relative position of the target object in the camera area also rotates, and the two are in a linear corresponding relationship.
[0101] In a specific embodiment, Figure 1C This is a schematic diagram of a target object moving in a camera area provided by Embodiment 1 of the present invention. Figure 1C In this embodiment, when the pan / tilt device shoots the high-voltage transmission line at a first camera angle, the target object (anti-vibration hammer) is located at the upper right of the camera area. When the pan / tilt device rotates from the first camera angle to the second camera angle at a rotation angle α, the target object (anti-vibration hammer) is located at the geometric center of the camera area.
[0102] In this embodiment, the linear correspondence relationship based on the rotation can be used to calculate the rotation parameters required by the PTZ device when the target object moves to the target position, such as Figure 1C It should be noted that when the PTZ device can rotate in the vertical and horizontal directions, the rotation angle α can be expressed as (α x , α y ), where α x Can be used to represent the horizontal rotation angle, α y Can be used to indicate the rotation angle in the vertical direction.
[0103] Furthermore, in this embodiment, step S130 may be refined into steps S131-S134:
[0104] S131, selecting a triangle model that matches the actual distance between the pan / tilt device and the target object, and calculating the rotation parameters required by the pan / tilt device when moving the target object from the initial position to the target position in the camera area;
[0105] The vertices of the triangular model are used to represent the positions of the pan / tilt device, the target object before relative movement, and the target object after relative movement in space respectively.
[0106] In this embodiment, when the pan-tilt device can rotate in the vertical direction and the horizontal direction, the rotation angle in the horizontal direction and the rotation angle in the vertical direction can be solved respectively. After that, the pan-tilt device can be controlled to rotate in the vertical direction and the horizontal direction respectively.
[0107] In this embodiment, solving the horizontal rotation parameter (rotation angle) is taken as an example for description.
[0108] Specifically, assuming that the horizontal coordinate of the initial position of the target object in the camera area is x o , the horizontal coordinate of the target position is x1, then the pixel movement distance dpix of the target object in the camera area x It can be expressed as (x1-x0).
[0109] S132. According to a pre-determined linear correspondence between the actual distance and the pixel distance, the pixel movement distance is converted into an actual movement distance of the target object relative to the pan / tilt device.
[0110] In this embodiment, the camera device in the pan-tilt device may be calibrated to obtain a linear correspondence between the actual distance and the pixel distance corresponding to the camera device.
[0111] Exemplarily, the calibration method may be as follows: a calibration object is set, and the calibration object may be a square cardboard of 0.285m*0.289m. When the distance D between the camera device and the calibration object is 1, 2, 3, 4 and 5m respectively, take pictures.
[0112] Furthermore, the pixel distance of the calibration object in the captured image can be obtained, and the proportional relationship between the actual distance and the pixel distance can be calculated.
[0113] For example, the data obtained is:
[0114] 1. The distance between the camera and the calibration object is D = 1m, and the pixel distance of the calibration object in the image is x = 200 pixels, y = 300 pixels, where x represents width and y represents height;
[0115] 2. The distance between the camera and the calibration object is D = 2m, and the pixel distance of the calibration object in the image is x = 100 pixels, y = 150 pixels, where x represents width and y represents height;
[0116] 3. The distance between the camera and the calibration object is D = 3m, and the pixel distance of the calibration object in the image is x = 66 pixels, y = 100 pixels, where x represents width and y represents height;
[0117] 4. The distance between the camera and the calibration object is D = 4m, and the pixel distance of the calibration object in the image is x = 50 pixels, y = 75 pixels, where x represents width and y represents height;
[0118] 5. The distance between the camera device and the calibration object is D=5m, and the pixel distance of the calibration object in the image is x=40 pixels, y=60 pixels, where x represents width and y represents height.
[0119] It can be inferred from the above data that when the vertical distance between the camera device and the target object is n meters, the actual distance represented by 1 pixel is: x=0.285÷(200 / n), y=0.289÷(300 / n).
[0120] That is, 0.285 / 200 may be used as the linear multiple of the actual distance at the unit distance and the pixel distance in the horizontal direction, and 0.289 / 300 may be used as the linear multiple of the actual distance at the unit distance and the pixel distance in the vertical direction.
[0121] Further, assuming that the vertical distance between the camera device in the PTZ device and the target object is R1 (in meters), the pixel movement distance dpix in the horizontal direction of the target object is x , then the actual moving distance of the target object relative to the PTZ device can be expressed as:
[0122] d x =P x ×dpix x ×R1
[0123] Among them, P x It is the linear multiple of the actual distance and the pixel distance in the horizontal direction at a unit distance (such as 1m), which can be P x =0.285 / 200=0.001425.
[0124] During the above calibration process, the image may be taken at a preset magnification, such as 1. Further, in one embodiment, to increase the accuracy of the calibration, the image may be calibrated at multiple preset magnifications, and then the results of the calibration at multiple preset magnifications may be averaged to obtain the final calibration result at 1 magnification.
[0125] For example, calibration is performed at magnifications of 2, 4, 8, 10, 15, and 20 times, respectively. Furthermore, the calibration results of 2 and 20 times with relatively large errors are removed, and the average of the calibration results corresponding to the middle 4, 8, 10, and 15 times is taken as the final calibration result.
[0126] Furthermore, after calibration, error compensation values of a total of 8 coordinate values (abscissa x, ordinate y) can be given in one or more quadrants, such as 1 to 4, to improve the detection accuracy by about 5%.
[0127] S133. Select a triangular model based on the actual distance between the gimbal device and the target object to represent the spatial triangular relationship between the gimbal device, the target object before relative movement, and the target object after relative movement, and use the actual movement distance to calculate the rotation angle of the gimbal device.
[0128] In this embodiment, the positions of the pan-tilt device, the target object before relative movement, and the target object after relative movement in space can be set as a triangular model in space. Furthermore, in the triangular model, the triangular relationship can be used to determine the lengths of each angle or side of the triangular model.
[0129] In this embodiment, the triangle model may include: an isosceles triangle or a right triangle.
[0130] Furthermore, the spatial triangulation relationship matching the target object can select the type of triangular model according to whether the actual distance between the pan-tilt device and the target object exceeds a preset distance threshold. For example, when the actual distance between the pan-tilt device and the target object exceeds a preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form an isosceles triangle in space; for another example, when the actual distance between the pan-tilt device and the target object is less than or equal to the preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form a right triangle in space.
[0131] 1. Isosceles triangle
[0132] In this embodiment, Figure 1D A schematic diagram of the spatial positions of a pan-tilt device, a target object before relative movement, and a target object after relative movement provided in Example 1 of the present invention. When the pan-tilt device is far enough from the target object, the vertical distance between the pan-tilt device and the target object before and after rotation can be considered equal, that is, the pan-tilt device, the target object before relative movement, and the target object after relative movement form an isosceles triangle in space.
[0133] In one embodiment, the actual distance between the gimbal device and the target object can be determined; the actual distance is taken as the length of the waist of the isosceles triangle, and the actual moving distance is taken as the length of the base of the isosceles triangle, and based on the cosine theorem of the triangle, the angle opposite the base is obtained; the angle opposite the base is determined as the rotation angle of the gimbal device.
[0134] Reference Figure 1D , the actual distance between the PTZ device and the target object before relative movement is d x , the actual distance between the PTZ device and the target object after relative movement is also d x The distance between the target object before and after relative movement is l x . Rotation angle rad x The cosine value of can be expressed as:
[0135]
[0136] Furthermore, by solving the arc cosine value, the rotation angle rad of the gimbal device can be determined. x .
[0137] Furthermore, the actual distance between the PTZ device and the target object can also be determined using the following two methods, which may include: image processing acquisition method, direct acquisition method
[0138] 1.1 Image processing acquisition method
[0139] Specifically, the actual size of the target object can be obtained; the pixel size of the target object in the first image can be determined; the ratio between the pixel size and the actual size can be determined as the actual ratio; the ratio between the actual distance and the pixel distance corresponding to the calibration position measured in advance when the calibration object is at a unit distance from the gimbal device is used as a reference ratio; the ratio between the actual ratio and the reference ratio can be determined as a distance multiple; the product of the distance multiple and the unit distance can be used as the actual distance between the gimbal device and the target object.
[0140] 1.2 Direct Acquisition Method
[0141] Specifically, the pan-tilt device can be moved to a preset point around the target object, the coordinates of the preset point can be stored in a database, and the target distance from the preset point to the target object can be stored in the database; further, the target distance between the preset point and the target object can be obtained from the database; the target distance is used as the actual distance between the pan-tilt device and the target object.
[0142] 2. Right triangle
[0143] In this embodiment, Figure 1EA schematic diagram of the spatial positions of another pan-tilt device, a target object before relative movement, and a target object after relative movement provided in Embodiment 1 of the present invention. When the pan-tilt device is relatively close to the target object, the pan-tilt device, the target object before relative movement, and the target object after relative movement form a right triangle in space.
[0144] Reference Figure 1E , a right-angled side d of a right triangle x , corresponds to the line between the target object before relative movement and the target object after relative movement; the other right-angled side R1 corresponds to the line between the target object after relative movement and the PTZ device; the hypotenuse R0 corresponds to the line between the target object before relative movement and the PTZ device. The length of each side corresponds to the distance. In addition, Figure 1E The h in here is the height on the hypotenuse R0.
[0145] Reference Figure 1E The triangular relationship in can be obtained as follows:
[0146]
[0147] dpix x =abs(x1-x0) (2)
[0148] d x =P x ×dpix x ×R1 (3)
[0149] Where arctan is the inverse tangent function; abs is the absolute value function; the horizontal coordinate of the initial position of the target object in the camera area is x o , the horizontal coordinate of the target position is x1, dpix x P is the pixel moving distance of the target object in the camera area; x It is the linear multiple of the actual distance and the pixel distance in the horizontal direction at the unit distance, which can be P x =0.285 / 200=0.001425; rad x is the rotation angle of the gimbal device.
[0150] Combining formulas (1)-(3), the rotation angle rad of the gimbal device is x It can be expressed as:
[0151] rad x =arctan(P x ×dpix x ).
[0152] That is to say, the actual distance between the target object and the pan / tilt device after relative movement can be used as the first distance, namely R1; the actual moving distance d can be calculated. x The ratio of the first distance R1, that is, P x ×dpix x ; Calculate the ratio (P x ×dpix x ) corresponding to the inverse tangent value; the inverse tangent value is determined as the rotation angle of the gimbal device.
[0153] In this embodiment, a more matching spatial trigonometric relationship can be selected based on the actual distance between the PTZ device and the target object, further increasing the accuracy of detection. In addition, since the parameters used when calculating the rotation angle are smaller and less calculation is required when the spatial trigonometric relationship represented by a right triangle is used, when the actual distance between the PTZ device and the target object is closer, the isosceles triangle can be switched to a right triangle, thereby making the calculation of the rotation angle more flexible and taking less time.
[0154] S134: Use the rotation angle as a rotation parameter of the pan / tilt device.
[0155] In this embodiment, when the rotation angle is used as the rotation parameter of the pan-tilt device, the pan-tilt device can directly rotate according to the rotation angle when receiving the rotation parameter.
[0156] S140, controlling the pan / tilt device to rotate according to the rotation parameter, so that the pan / tilt device rotates to the target position where the target object is located in the camera area, and photographing a second image of the target object at a second magnification.
[0157] Generally, the second multiple can be set to be greater than the first multiple, so that after the rotation, the target object can occupy a larger proportion of the second image, that is, the target object can be observed more clearly from the second image.
[0158] In one embodiment, it is possible to determine the target ratio of the target object to the camera area when the target object is moved to the target position of the camera area; determine the original ratio of the target object in the first image; use the ratio between the target ratio and the original ratio as the magnification factor; and use the product of the first ratio and the magnification factor as the second ratio.
[0159] It should be noted that, in general, when the magnification is high, rotating the pan / tilt device to adjust the relative position of the target object in the camera area is likely to cause strong shaking. The reason for the shaking is that as the magnification of the camera device increases, each unit of rotation angle brings more displacement pixels of the target object in the camera area.
[0160] Based on the above factors, if the rotation parameters of the gimbal device are manually adjusted, and the relative position of the target object in the camera area is used as feedback, and the rotation parameters of the gimbal device are manually adjusted again until the target object is in the target position in the camera area, this requires multiple, unsmooth attempts, and the target object may not necessarily be ultimately adjusted to the target position in the camera area.
[0161] In the present embodiment, the rotation parameters of the pan-tilt device are cleverly calculated directly through image processing, and the rotation of the pan-tilt device is controlled according to the rotation parameters to adjust the target object to the target position in the camera area; thereafter, the pan-tilt device is set to use a second multiple that is higher than the first multiple to shoot the second image, so that the entire pan-tilt target conversion control process and the shooting process are smoother and more stable, thereby achieving the technical effect of quickly and accurately determining the rotation parameters of the pan-tilt device and saving control time.
[0162] In particular, in the case where there are multiple target objects in the first image, the rotation parameters of the gimbal device corresponding to each target object can be calculated separately, avoiding the problem of manually adjusting the rotation angle of the gimbal device, which is time-consuming and has low work efficiency when there are many target objects and fine-tuning is required one by one.
[0163] Furthermore, the shooting order of multiple target objects can be optimized to reduce the total rotation angle of the gimbal device, greatly saving time and electricity costs.
[0164] In addition, in general, the network in outdoor environments is not good and the network connection is often disconnected. If you need to remotely control the rotation of the gimbal device multiple times, the disconnection of the network connection will lead to poor control effect of the gimbal device and reduced work efficiency. By adopting the above-mentioned gimbal target conversion control method, the rotation angle can be obtained at one time, and multiple controls can be compressed into one accurate control, avoiding the error accumulation caused by poor network quality, thereby improving the control accuracy and efficiency.
[0165] Example 2
[0166] Figure 2 A schematic diagram of the structure of a pan-tilt target conversion control device provided in Example 2 of the present invention. The present application provides a pan-tilt target conversion control device, which can be implemented by software and / or hardware, and integrated in a pan-tilt target conversion control device. Optionally, the pan-tilt target conversion control device can be a host computer of the pan-tilt device, and the host computer includes but is not limited to a terminal such as a computer or a server. In this embodiment, the pan-tilt target conversion control device is a server as an example for detailed description.
[0167] Reference Figure 2The gimbal target conversion control device may specifically include the following structures: a first image acquisition module 210, an initial position determination module 220, a rotation parameter calculation module 230 and a second image acquisition module 240.
[0168] A first image acquisition module 210 is used to acquire a first image of a target object captured by a PTZ device at a first magnification;
[0169] An initial position determination module 220, configured to determine the position of the target object in the first image as the initial position of the target object in the camera area of the PTZ device;
[0170] A rotation parameter calculation module 230 is used to select a triangular model that matches the actual distance between the pan-tilt device and the target object, and calculate the rotation parameters required by the pan-tilt device when the target object is moved from the initial position to the target position of the camera area, wherein the vertices of the triangular model are used to respectively represent the positions of the pan-tilt device, the target object before relative movement, and the target object after relative movement in space;
[0171] The second image acquisition module 240 is used to control the pan-tilt device to rotate according to the rotation parameter, so that the pan-tilt device rotates to the target position where the target object is located in the camera area, and captures a second image of the target object at a second magnification.
[0172] In this embodiment, the rotation parameters of the pan-tilt device are cleverly calculated directly through image processing, and the rotation of the pan-tilt device is controlled according to the rotation parameters to adjust the target object to the target position in the camera area; thereafter, the pan-tilt device is set to use a second magnification higher than the first magnification to shoot the second image, so that the entire pan-tilt target conversion control process and the shooting process are smoother and more stable, achieving the technical effect of quickly and accurately determining the rotation parameters of the pan-tilt device and saving control time.
[0173] Based on the above technical solution, the initial position determination module 220 includes:
[0174] The first image display unit is used to display the first image.
[0175] The first user operation receiving unit is configured to receive a first user operation performed on the first image.
[0176] The first user operation response unit is used to respond to the first user operation to draw a target area in the area where the target object is located in the first image.
[0177] The first initial position determining unit is used to determine the center position of the target area as the initial position of the target object in the camera area of the pan / tilt device.
[0178] On the basis of the above technical solution, the initial position determination module 220 includes:
[0179] The image feature extraction unit is used to perform a preprocessing operation on the first image and extract image features from the first image.
[0180] The target area recognition unit is used to input the image features into a target recognition model to recognize the target area where the target object is located in the first image.
[0181] The second initial position determining unit is used to determine the center position of the target area as the initial position of the target object in the camera area of the pan / tilt device.
[0182] Based on the above technical solution, the rotation parameter calculation module 230 includes:
[0183] The pixel movement distance determination unit is used to use the difference between the initial position and the target position as the pixel movement distance of the target object moving within the imaging area.
[0184] The actual moving distance determining unit is used to convert the pixel moving distance into the actual moving distance of the target object relative to the pan / tilt device according to the pre-determined linear correspondence between the actual distance and the pixel distance.
[0185] A rotation angle determination unit is used to select a triangular model based on the actual distance between the gimbal device and the target object, to represent the spatial triangular relationship formed among the gimbal device, the target object before relative movement, and the target object after relative movement, and to calculate the rotation angle of the gimbal device using the actual movement distance.
[0186] A rotation parameter determination unit is used to use the rotation angle as a rotation parameter of the pan / tilt device.
[0187] On the basis of the above technical solution, when the actual distance between the pan-tilt device and the target object exceeds a preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form an isosceles triangle in space; the rotation angle determination unit includes:
[0188] The actual distance determination subunit is used to determine the actual distance between the pan / tilt device and the target object.
[0189] The base diagonal determination subunit is used to use the actual distance as the length of the waist of the isosceles triangle and the actual moving distance as the length of the base of the isosceles triangle, and based on the triangle cosine theorem, obtain the angle of the diagonal of the base.
[0190] The first rotation angle determination subunit is used to determine the angle of the diagonal opposite to the bottom edge as the rotation angle of the pan / tilt device.
[0191] In one embodiment, the actual distance determination subunit can be specifically used to: obtain the actual size of the target object; determine the pixel size of the target object in the first image; determine the ratio between the pixel size and the actual size as the actual ratio; use the ratio between the actual distance and the pixel distance corresponding to the calibration position measured in advance when the calibration object is at a unit distance from the gimbal device as a reference ratio; determine the ratio between the actual ratio and the reference ratio as a distance multiple; and use the product of the distance multiple and the unit distance as the actual distance between the gimbal device and the target object.
[0192] In another embodiment, the actual distance determination subunit can also be specifically used to: move the pan-tilt device to a preset point around the target object; obtain the target distance between the preset point and the target object; and use the target distance as the actual distance between the pan-tilt device and the target object.
[0193] On the basis of the above technical solution, when the actual distance between the gimbal device and the target object is less than or equal to a preset distance threshold, the gimbal device, the target object before relative movement and the target object after relative movement form a right triangle in space; wherein, one right-angled side of the right triangle corresponds to the line between the target object before relative movement and the target object after relative movement; the other right-angled side corresponds to the line between the target object after relative movement and the gimbal device; and the hypotenuse corresponds to the line between the target object before relative movement and the gimbal device.
[0194] The rotation angle determination unit is specifically used for:
[0195] Taking the actual distance between the target object and the pan / tilt device after the relative movement as the first distance;
[0196] Calculating a ratio of the actual moving distance to the first distance;
[0197] Calculating the inverse tangent value corresponding to the ratio;
[0198] The arc tangent value is determined as the rotation angle of the pan / tilt device.
[0199] On the basis of the above technical solution, the device also includes:
[0200] A calibration module is used to calibrate the camera device in the pan-tilt device before converting the pixel movement distance into the actual movement distance of the target object relative to the pan-tilt device based on the pre-determined linear correspondence between the actual distance and the pixel distance, so as to obtain the linear correspondence between the actual distance and the pixel distance corresponding to the camera device.
[0201] On the basis of the above technical solution, the device also includes:
[0202] The target ratio determination module is used to determine the target ratio of the target object to the imaging area when the target object is moved to the target position of the imaging area before the second image is captured at the second magnification.
[0203] The original proportion determination module is used to determine the original proportion of the target object in the first image.
[0204] The magnification factor determination module is used to use the ratio between the target ratio and the original ratio as the magnification factor.
[0205] The second multiple determination module is used to take the product of the first multiple and the magnification multiple as the second multiple.
[0206] Example 3
[0207] Figure 3 This is a schematic diagram of the structure of a pan / tilt target conversion control device provided by Embodiment 3 of the present invention. Figure 3 As shown, the PTZ target conversion control device includes: a processor 30, a memory 31, an input device 32 and an output device 33. The number of processors 30 in the PTZ target conversion control device can be one or more. Figure 3 In the example, a processor 30 is used. The number of memories 31 in the PTZ target conversion control device can be one or more. Figure 3 A memory 31 is taken as an example. The processor 30, memory 31, input device 32 and output device 33 of the PTZ target conversion control device can be connected by a bus or other means. Figure 3 The bus connection is used as an example. The PTZ target conversion control device is the host computer of the PTZ device, and the host computer can be a computer and a server, etc. This embodiment is described in detail with the PTZ target conversion control device as a server, and the server can be an independent server or a cluster server.
[0208] The memory 31, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the pan-tilt target conversion control method described in any embodiment of the present invention (for example, the first image acquisition module 210, the initial position determination module 220, the rotation parameter calculation module 230 and the second image acquisition module 240 in the pan-tilt target conversion control device). The memory 31 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the device, etc. In addition, the memory 31 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 31 may further include a memory remotely arranged relative to the processor 30, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0209] The input device 32 can be used to receive input digital or character information, and generate key signal input related to the setting and function control of the pan / tilt target conversion control device. It can also be a camera for acquiring images and a sound pickup device for acquiring audio data. The output device 33 can include audio devices such as speakers. It should be noted that the specific composition of the input device 32 and the output device 33 can be set according to actual conditions.
[0210] The processor 30 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 31, that is, realizes the above-mentioned pan-tilt target conversion control method.
[0211] Example 4
[0212] Embodiment 4 of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a pan / tilt target conversion control method when executed by a computer processor, including:
[0213] Acquire a first image captured by the gimbal device at a first magnification;
[0214] Determine the position of the target object in the first image as the initial position of the target object in the camera area of the PTZ device;
[0215] Select a triangular model that matches the actual distance between the pan-tilt device and the target object, and calculate the rotation parameters required by the pan-tilt device when moving the target object from the initial position to the target position of the camera area, wherein the vertices of the triangular model are used to respectively represent the positions of the pan-tilt device, the target object before relative movement, and the target object after relative movement in space;
[0216] The pan / tilt device is controlled using the rotation parameter so that the pan / tilt device is rotated to the target position where the target object is located in the camera area, and a second image is obtained by shooting at a second magnification.
[0217] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present invention, whose computer executable instructions are not limited to the operations of the pan-tilt target conversion control method as described above, can also execute the relevant operations in the pan-tilt target conversion control method provided in any embodiment of the present invention, and have corresponding functions and beneficial effects.
[0218] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a robot, a personal computer, a server, or a network device, etc.) to execute the pan-tilt target conversion control method described in any embodiment of the present invention.
[0219] It is worth noting that in the above-mentioned pan-tilt target conversion control device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0220] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0221] In the description of this specification, the description with reference to the terms "in one embodiment", "in another embodiment", "exemplary" or "in a specific embodiment" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0222] Although the present invention has been described in detail above by means of general description, specific implementation methods and tests, it is obvious to those skilled in the art that some modifications or improvements may be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection claimed by the present invention.
Claims
1. A pan / tilt target conversion control method, characterized in that: include: Acquire a first image of a target object captured by a pan / tilt device at a first magnification; Determine the position of the target object in the first image as the initial position of the target object in the camera area of the pan / tilt device; Selecting a triangle model that matches the actual distance between the pan-tilt device and the target object, and calculating the rotation parameters required by the pan-tilt device when moving the target object from the initial position to the target position of the camera area, including: Taking the difference between the initial position and the target position as the pixel movement distance of the target object in the imaging area; According to a pre-determined linear correspondence between the actual distance and the pixel distance, the pixel movement distance is converted into an actual movement distance of the target object relative to the pan / tilt device; Selecting a triangular model based on the actual distance between the pan-tilt device and the target object to represent the spatial triangular relationship between the pan-tilt device, the target object before relative movement, and the target object after relative movement, and using the actual movement distance to calculate the rotation angle of the pan-tilt device; Using the rotation angle as a rotation parameter of the pan / tilt device; The vertices of the triangular model are used to respectively represent the positions of the pan-tilt device, the target object before relative movement, and the target object after relative movement in space; the type of triangular model is selected according to whether the actual distance between the pan-tilt device and the target object exceeds a preset distance threshold; when the actual distance between the pan-tilt device and the target object exceeds the preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form an isosceles triangle in space; when the actual distance between the pan-tilt device and the target object is less than or equal to the preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form a right triangle in space; Controlling the pan / tilt device to rotate according to the rotation parameter, so that the pan / tilt device rotates to the target position where the target object is located in the camera area, and photographing the target object at a second magnification to obtain a second image; Before photographing at the second magnification to obtain the second image, the method further includes: determining a target proportion of the imaging area occupied by the target object when the target object is moved to a target position of the imaging area; Determine the original proportion of the target object in the first image; The ratio between the target ratio and the original ratio is used as the magnification factor; The product of the first multiple and the magnification multiple is used as the second multiple; Before converting the pixel moving distance into the actual moving distance of the target object relative to the pan / tilt device according to the pre-determined linear correspondence between the actual distance and the pixel distance, the method further includes: The camera device in the pan-tilt device is calibrated to obtain a linear correspondence between the actual distance and the pixel distance corresponding to the camera device; during the calibration process, the calibration is performed at multiple preset multiples, and then the results of the calibration at multiple preset multiples are averaged to obtain the final calibration result.
2. The method according to claim 1, characterized in that The step of determining the position of the target object in the first image as the initial position of the target object in the camera area of the pan / tilt device includes: displaying the first image; receiving a first user operation acting on the first image; In response to the first user operation, drawing a target area in the area where the target object is located in the first image; The center position of the target area is determined as the initial position of the target object in the camera area of the pan / tilt device.
3. The method according to claim 1, characterized in that The step of determining the position of the target object in the first image as the initial position of the target object in the camera area of the pan / tilt device includes: performing a preprocessing operation on the first image and extracting image features from the first image; Inputting the image features into a target recognition model to identify a target area where a target object is located in the first image; The center position of the target area is determined as the initial position of the target object in the camera area of the pan / tilt device.
4. The method according to claim 1, characterized in that: When the actual distance between the pan-tilt device and the target object exceeds a preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form an isosceles triangle in space; The method of selecting a triangular model based on the actual distance between the pan-tilt device and the target object to represent the spatial triangular relationship between the pan-tilt device, the target object before relative movement, and the target object after relative movement, and using the actual movement distance to calculate the rotation angle of the pan-tilt device includes: Determining the actual distance between the PTZ device and the target object; Taking the actual distance as the length of the waist of the isosceles triangle and the actual moving distance as the length of the base of the isosceles triangle, based on the triangle cosine theorem, the angle of the angle opposite to the base is obtained; The angle of the diagonal angle opposite to the bottom edge is determined as the rotation angle of the pan / tilt device.
5. The method according to claim 4, characterized in that The determining the actual distance between the pan / tilt device and the target object comprises: Obtaining the actual size of the target object; determining a pixel size of the target object in the first image; Determine the ratio between the pixel size and the actual size as the actual ratio; When the calibration object is at a unit distance from the pan / tilt device, the ratio between the actual distance corresponding to the calibration position and the pixel distance measured in advance is used as a reference ratio; Determine the ratio between the actual ratio and the reference ratio as the distance multiple; The product of the distance multiple and the unit distance is used as the actual distance between the pan / tilt device and the target object.
6. The method according to claim 4, characterized in that The determining the actual distance between the pan / tilt device and the target object comprises: Moving the pan / tilt device to a preset point around the target object; Acquire a target distance between the preset point and the target object; The target distance is used as the actual distance between the pan / tilt device and the target object.
7. The method according to claim 1, characterized in that When the actual distance between the pan-tilt device and the target object is less than or equal to a preset distance threshold, the pan-tilt device, the target object before relative movement, and the target object after relative movement form a right triangle in space; wherein one right-angled side of the right triangle corresponds to a line between the target object before relative movement and the target object after relative movement; the other right-angled side corresponds to a line between the target object after relative movement and the pan-tilt device; and the hypotenuse corresponds to a line between the target object before relative movement and the pan-tilt device. The method of selecting a triangular model based on the actual distance between the pan-tilt device and the target object to represent the spatial triangular relationship between the pan-tilt device, the target object before relative movement, and the target object after relative movement, and using the actual movement distance to calculate the rotation angle of the pan-tilt device includes: Taking the actual distance between the target object and the pan / tilt device after the relative movement as the first distance; Calculating a ratio of the actual moving distance to the first distance; Calculating the inverse tangent value corresponding to the ratio; The arc tangent value is determined as the rotation angle of the pan / tilt device.
8. A pan / tilt target conversion control device, characterized in that: It is applicable to the pan / tilt target conversion control method according to any one of claims 1 to 7, comprising: A first image acquisition module, used to acquire a first image of a target object captured by the PTZ device at a first magnification; An initial position determination module, used to determine the position of the target object in the first image as the initial position of the target object in the camera area of the PTZ device; a rotation parameter calculation module, used to select a triangular model that matches the actual distance between the pan-tilt device and the target object, and calculate the rotation parameters required by the pan-tilt device when the target object is moved from the initial position to the target position of the camera area, wherein the vertices of the triangular model are used to respectively represent the positions of the pan-tilt device, the target object before relative movement, and the target object after relative movement in space; The second image acquisition module is used to control the pan-tilt device to rotate according to the rotation parameter, so that the pan-tilt device rotates to the target position where the target object is located in the camera area, and captures the second image of the target object at a second magnification.
9. A PTZ target conversion control device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the pan-tilt target conversion control method as described in any one of claims 1-7.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the pan-tilt target conversion control method as described in any one of claims 1-7 when executed by a computer processor.
