A target positioning method and device based on linkage of a bolt and a gimbal camera
By obtaining the vertex coordinates and radial transformation matrix of the PT camera through offline calibration and polygon subdivision, and calculating the PT value and Zoom value in real time, the problem of target positioning accuracy and efficiency in the linkage of bullet camera and PT camera is solved, and efficient target positioning of the monitoring system is realized.
Patent Information
- Application Number
- CN202310896231.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-07-20
AI Technical Summary
In existing technologies, how to achieve effective linkage between bullet cameras and pan-tilt cameras based on reasonable deployment planning, and improve the target positioning accuracy and efficiency of the monitoring system, has become an urgent technical problem to be solved.
By using offline calibration, the gimbal camera and the bullet camera are bound together. The vertex coordinates and radial transformation matrix of the region of interest are obtained by polygon subdivision. The target position information is obtained in real time, and the PT value and Zoom value of the gimbal camera are calculated based on this information to achieve precise focusing of the gimbal camera.
It enables rapid calibration and real-time response of the gun-mounted and pan-tilt-zoom (PTZ) cameras, improving the accuracy and speed of target positioning and simplifying the processing flow.
Smart Images

Figure CN116977443B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to intelligent monitoring technology, and more particularly to a target positioning method and device based on the linkage of bullet camera and pan-tilt camera. Background Technology
[0002] In surveillance systems, bullet cameras are used to monitor specific areas, while PTZ cameras can scan the entire area by controlling the angle and direction of the PTZ. Linking PTZ cameras and bullet cameras enables more intelligent surveillance systems, such as automatic tracking, focusing, preset positions, and scene switching. By linking PTZ cameras and bullet cameras, a more intelligent and efficient surveillance system can be achieved, improving the accuracy and efficiency of monitoring.
[0003] An existing method for camera placement involves acquiring the deployable camera range and the target to be monitored from a 3D model; setting up a corresponding camera at each placement location; obtaining the first distance, observation angle, and occlusion status between the camera at each placement location and the target; and selecting multiple placement locations from all placement locations to form a first set based on all first distances, observation angles, and occlusion statuses; obtaining the first spatial range of the target to be monitored covered by the camera at each placement location in the first set; and selecting the optimal placement location from the first set based on all first spatial ranges. This allows for reasonable planning of camera placement. However, based on reasonable placement planning, how to effectively coordinate bullet cameras and pan-tilt-zoom (PTZ) cameras to achieve more accurate target monitoring or location remains a pressing technical problem that needs to be solved. Summary of the Invention
[0004] (a) Technical problems to be solved
[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a target positioning method and device based on the linkage of a gun camera and a gimbal camera.
[0006] (II) Technical Solution
[0007] To achieve the above objectives, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, embodiments of the present invention provide a target localization method based on the linkage of a gun-mounted camera and a gimbal camera, comprising:
[0009] S10. Using an offline calibration method, bind the gimbal camera to the gun camera associated with the gimbal camera, and obtain the vertex coordinates and radiative transformation matrix of each polygon in the region of interest of a frame image to which the gun camera belongs based on the polygon subdivision method.
[0010] S20. Obtain the target position information of the target detected by the gun in real time, and determine whether the target position information is located in the region of interest;
[0011] S30. If it belongs to the target, then based on the target location information, the vertex coordinates of the polygon to which the target location information belongs, and the ray transformation matrix, obtain the PT value and Zoom value of the detected target used by the gimbal camera when focusing on the target.
[0012] S40. The PT value and Zoom value are sent to the gimbal camera so that the gimbal camera rotates and focuses on the detection target based on the PT value and Zoom value.
[0013] Optionally, the step S10, which involves obtaining the vertex coordinates and radial transformation matrix of each polygon in the region of interest within a frame of image to which the gun belongs, based on polygon subdivision, includes:
[0014] The vertex coordinates and radial transformation matrix of each triangle in the region of interest of a frame of image to which the gun belongs are obtained based on the triangulation method.
[0015] Optionally, S10 includes:
[0016] For each camera attached to the gimbal camera, select one frame from the video stream captured by that camera and determine the sub-image within the field of view of the gimbal camera in that frame.
[0017] Select multiple first coordinate points in the boundary region of the subimage, connect all the first coordinate points in the specified direction to form the region of interest, and obtain the range of pixel coordinates of interest;
[0018] Based on the defined distance and uniformity conditions, multiple second coordinate points are selected within the region of interest;
[0019] Obtain the pixel coordinates and PT values of all first coordinate points. The PT value is the rotation information when any first coordinate point is focused by the gimbal camera.
[0020] Obtain the pixel coordinates and PT values of all second coordinate points. The PT value is the rotation information when any second coordinate point is focused by the gimbal camera.
[0021] Based on the triangulation method, all the first coordinate points and all the second coordinate points are arranged into triangles with no repetition, and each triangle has a unique identifier;
[0022] Based on the pixel coordinates and PT values of the three vertices in each triangle, obtain the radiative transformation matrix that converts the pixel coordinates of the three vertices into their respective PT values.
[0023] Optionally, S20 includes:
[0024] The video stream information of the camera is obtained, and the first position information of the detected target in the current frame is obtained according to the target detection model. The first position information includes pixel coordinates and the width and height information of the detected target.
[0025] Based on the pixel coordinates of the detected target, determine whether the pixel coordinates are within the pixel coordinate range of the region of interest.
[0026] If yes, proceed to step S30; otherwise, end.
[0027] Optionally, S30 includes:
[0028] Based on the pixel coordinates of the center point of the detected target and the pixel coordinates of the three vertices of each triangle, the triangle to which the detected target belongs is determined.
[0029] Based on the radiative transformation matrix of the triangle to which the detected target belongs, the pixel coordinates of the center point of the detected target are converted into the PT value of the detected target.
[0030] Optionally, S30 further includes:
[0031] Based on the known zoom value range of the gimbal camera and the width and height information of the target being detected, obtain the zoom value of the target being detected.
[0032] Optionally, if the zoom value of the gimbal camera ranges from z_min to z_max, then the zoom value Z of the detected target is obtained based on the following formula. 目标 ;
[0033] Z 目标 = (z_min - z_max) * S + z_max,
[0034] S=min(w / image_w,h / image_h);
[0035] image_w and image_h represent the resolution width and height of the camera module, respectively;
[0036] w and h represent the width and height of the target being detected, respectively.
[0037] Optionally, the video stream information of the camera is acquired, and based on the target detection model, the first position information of the detected target in the current frame is obtained, including:
[0038] Select the current keyframe from the video stream information of the camera, and use the Yolov5 algorithm based on neural networks to obtain the first position information of the detected target in the current frame.
[0039] Secondly, embodiments of the present invention also provide a target localization method based on the linkage of a gun camera and a gimbal camera, comprising:
[0040] A10. Acquire the target position information of the target detected by the gun in real time, and determine whether the target position information is within the predefined region of interest;
[0041] A20. If it belongs to the target, then based on the target location information, the vertex coordinates of the polygon to which the target location information belongs, and the ray transformation matrix, obtain the PT value and Zoom value of the detected target used by the gimbal camera when focusing on the target.
[0042] A30. Send the PT value and Zoom value to the gimbal camera so that the gimbal camera rotates and focuses on the detection target based on the PT value and Z value;
[0043] The predefined region of interest is the area within the field of view of the corresponding gimbal camera determined from the image captured by the bullet camera when the bullet camera and the gimbal camera are bound together.
[0044] In the offline phase, the region of interest is divided into multiple polygons by using polygon subdivision, and the pixel coordinates and PT values of each vertex in each polygon are obtained, as well as the radiative transformation matrix of each vertex in pixel coordinates to its respective PT value.
[0045] For example, in the offline stage, the region of interest is divided into multiple triangles by using triangulation, and the pixel coordinates and PT values of each vertex in each triangle are obtained, as well as the radiative transformation matrix of each vertex in pixel coordinates to its respective PT value.
[0046] Because triangles have the fewest sides and are relatively easy to identify, they can be implemented in practice using existing triangulation methods.
[0047] Thirdly, the present invention provides a computing device electrically connected to a gimbal camera and at least one bullet camera. When the bullet camera and the gimbal camera are bound together, the processor of the computing device executes the steps of a target positioning method based on the linkage of a bullet camera and a gimbal camera as described in any of the first aspects above.
[0048] (III) Beneficial Effects
[0049] The method of this invention is applicable to the camera calibration process involving multiple bullet cameras and gimbal cameras. Its operation process is gradual, and the online processing stage is faster and more accurate in positioning.
[0050] In this embodiment of the invention, the target area can be divided into multiple sub-regions in advance through offline calibration. Then, the vertex coordinates and radiative transformation matrix of each sub-region are obtained. Then, through online inference, the PT value and Zoom value of the gimbal camera when focusing on the target are determined by using the sub-region / region of interest information where the target location information is located. Thus, the gimbal camera can rotate and focus on the detected target based on the PT value and Zoom value, making the whole process simple, fast, and accurate, and ensuring the precise positioning of the gimbal camera focus. Attached Figure Description
[0051] Figure 1 This is a flowchart illustrating a target localization method based on the linkage of a gun camera and a gimbal camera, according to an embodiment of the present invention.
[0052] Figures 2 to 7 This is a schematic diagram of the offline processing stage;
[0053] Figure 8 This is a flowchart illustrating a target localization method based on the linkage of a gun camera and a gimbal camera, as provided in an embodiment of the present invention. Detailed Implementation
[0054] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0055] The functional distances achievable by the linkage between the gimbal camera and the bullet camera are explained below.
[0056] Automatic tracking: When the camera detects abnormal behavior, the pan-tilt camera can automatically adjust its angle to track the movement trajectory of the target object, achieving more accurate monitoring.
[0057] Focusing function: When the camera detects an anomaly in a specific area, the pan-tilt camera can automatically adjust the focus to achieve clearer image capture.
[0058] Preset position function: The PTZ camera can be set to multiple preset positions. When the camera detects an abnormality in a specific area, the PTZ camera can automatically adjust to the preset position and quickly capture the target object.
[0059] Automatic scene switching: When the gimbal camera scans different scenes, it can automatically switch to the corresponding preset position to achieve intelligent scene switching.
[0060] Current linkage technologies require offline / online fitting of the images from various camera modules and the PTZ (PTZ) camera. This fitting necessitates pre-calibration of the camera modules and PTZ camera, followed by target localization based on the calibrated images. The method of this invention enables rapid calibration, real-time response, and precise localization, specifically for target localization and focusing using camera module images.
[0061] P: Pan refers to the control for moving the camera left and right, and can achieve 360-degree horizontal rotation;
[0062] T: Tilt refers to the control of the camera's vertical movement, which can achieve movement in the vertical direction;
[0063] Z: Zoom refers to the control of the camera's focal length, which can switch between near and far views.
[0064] Example 1
[0065] like Figure 1 and Figure 8 As shown, this embodiment provides a target localization method based on the linkage of a bullet camera and a gimbal camera. The execution subject of this embodiment can be a control device jointly used by the bullet camera and the gimbal camera. The method includes:
[0066] S10. Using an offline calibration method, bind the gimbal camera to the gun associated with the gimbal camera, and obtain the vertex coordinates and radiative transformation matrix of each triangle in the region of interest of a frame of image to which the gun belongs based on the triangulation method.
[0067] S20. Obtain the target position information of the target detected by the gun in real time, and determine whether the target position information is located in the region of interest;
[0068] S30. If it belongs to the target, then based on the target location information, the vertex coordinates of the triangle to which the target location information belongs, and the ray transformation matrix, obtain the PT value and Zoom value of the detected target used by the gimbal camera when focusing on the target.
[0069] S40. The PT value and Zoom value are sent to the gimbal camera so that the gimbal camera rotates and focuses on the detection target based on the PT value and Z value.
[0070] In this embodiment, the vertex coordinates and radial transformation matrix of each triangle in the region of interest (ROI) of a frame containing the camera are obtained using triangulation. In other embodiments, polygonal subdivision can also be used to obtain the vertex coordinates and radial transformation matrix of each polygon in the ROI of a frame containing the camera. Since triangles are the smallest triangles and are easy to distinguish and connect, triangulation is preferred in this embodiment. In other embodiments, during the offline processing stage, quadrilaterals, pentagons, or a combination of quadrilaterals and pentagons can be used to form polygonal subdivision. This embodiment is not limited to these methods, as long as the uniqueness of the ROI division and its subsequent usability are achieved.
[0071] The method in this embodiment can pre-divide the target area into multiple sub-regions through offline calibration, then obtain the vertex coordinates and radiative transformation matrix of each sub-region, and then use online inference to determine the PT value and Zoom value of the gimbal camera when focusing on the target by using the sub-region / region of interest information where the target location information is located. Thus, the gimbal camera can rotate and focus on the detected target based on the PT value and Zoom value, making the whole process simple, fast, and accurate, and ensuring the precise positioning of the gimbal camera focus.
[0072] Existing technology also provides a Delaunay triangulation method, which is an algorithm for triangulating a given set of points, ensuring that the generated triangles are as close as possible to circles. The definition of Delaunay triangulation is: for a given set of points, if the resulting triangulation satisfies the following conditions, then the triangulation is called a Delaunay triangulation: 1. The circumcircle of each triangle does not contain any points; 2. The circumcircles of any two non-adjacent triangles do not intersect.
[0073] The advantage of the existing Delaunay triangulation is that it ensures that the triangulated triangles will not be too distorted or have extremely poor aspect ratios, thereby improving the quality of the triangular mesh.
[0074] Therefore, in this embodiment, the existing Delaunay triangulation can be used to achieve the above-mentioned offline stage triangulation triangle.
[0075] Typically, the Delaunay triangulation algorithm mainly involves the following steps:
[0076] Step 1: Construct the convex hull of the point set: By calculating the convex hull of the point set, we obtain the outer boundary of the point set, which serves as the starting state of the algorithm.
[0077] Step 2: Adding new points: For the remaining points, add them to the convex hull one by one. When adding a new point, first find the triangle containing the point, then split the triangle into three triangles, and add the new point to one of the triangles.
[0078] Step 3: Check validity: After adding a new point to the triangle, it is necessary to check whether the generated new triangle satisfies the definition of Delaunay triangulation. If it does not, a series of rotation operations are required to transform it into a triangle that satisfies the Delaunay conditions.
[0079] Repeat steps two and three until all points are added to the convex hull, resulting in the final Delaunay triangulation.
[0080] Example 2
[0081] To better understand the above Figure 1 The proposed solution will be discussed below. Figures 2 to 8 A detailed explanation is provided. In this embodiment, the linkage between the camera module and the gimbal camera can be understood as the linkage between multiple camera modules and one gimbal camera. To better ensure accurate calibration, before implementing this solution, it is necessary to confirm which camera modules are pre-bound to the gimbal camera.
[0082] Offline phase:
[0083] 101. For each camera attached to the gimbal camera, select one frame from the video stream captured by that camera and determine the sub-image within the visible range of the gimbal camera in that frame.
[0084] Select multiple first coordinate points for the boundary region of the subgraph, such as... Figure 3 As shown, connecting all the first coordinate points in a specified direction forms the region of interest, thus obtaining the range of pixel coordinates of interest. Figure 4 and Figure 5 As shown;
[0085] In this embodiment, due to the influence of the actual application scenario or the field of view of the gimbal camera, only a portion or all of the area in the bullet camera's view needs to be located and focused by the gimbal camera. Therefore, it is necessary to select this "area of interest" in the bullet camera's view, i.e., the sub-image mentioned above, such as... Figure 2 As shown.
[0086] In this embodiment, the connection according to the specified direction can be a sequential connection in a clockwise direction or a sequential connection in a counterclockwise direction.
[0087] Understandably, within the effective range of the sub-image, the first coordinate point closest to the boundary is selected, the pixel coordinates of these coordinate points are recorded, and all the first coordinate points are connected in a specified direction to form the region of interest.
[0088] 102. Based on the defined distance and uniformity conditions, select multiple second coordinate points within the region of interest, such as... Figure 5 As shown; obtain the pixel coordinates and PT values of all first coordinate points, where the PT value is the rotation information when any first coordinate point is focused by the gimbal camera;
[0089] Understandably, each coordinate point corresponds to a unique PT value. For example, manually triggering the marking of the first coordinate point on the camera's view, after marking, manually rotating the gimbal camera until it centers the marked point, and then recording the current PT value, which is the PT value corresponding to that first coordinate point. Currently, common Hikvision and Dahua gimbal cameras all have the function of "centering the marked point and returning the PT value".
[0090] Obtain the pixel coordinates and PT values of all second coordinate points. The PT value is the rotation information when any second coordinate point is focused by the gimbal camera.
[0091] To improve subsequent positioning accuracy, select as many second coordinate points as possible, such as... Figure 5 The second coordinate point is 30 to 63.
[0092] Regarding steps 101 and 102 above, the points in the camera's view are mainly used to control the gimbal camera, so that the gimbal camera centers the above points and records the pan value and titl value (PT value) of the gimbal camera at this time. Figure 6 The result shows the result of centering point 33 with the gimbal camera.
[0093] Typically, the pan-tilt head is controlled by the user through the API interface of the pan-tilt camera. The bullet bolt cannot rotate, so it does not require control.
[0094] Special note: The control device connected to the gimbal camera rotates the gimbal camera via the API interface. After each rotation, the API interface will return the current P value and T value, as well as the real-time image, to the control device.
[0095] 103. Based on triangulation, form a series of triangles with no repetition between all the first coordinate points and all the second coordinate points, such as... Figure 7 As shown, each triangle has a unique identifier;
[0096] Based on the pixel coordinates and PT values of the three vertices in each triangle, obtain the radiative transformation matrix that converts the pixel coordinates of the three vertices into their respective PT values.
[0097] exist Figure 5 The image contains the pixel coordinates of 64 points and their corresponding gimbal PT values. This information will be used to calculate the mapping matrix from the bullet camera's field of view to the gimbal camera's PT for all points within the effective range. In this embodiment, triangulation is used for processing.
[0098] For example, the effective range of the breechblock can be used as the edges of a polygon, and all points of interest can be used as a point set for triangulation, such as... Figure 7 As shown.
[0099] After triangulation, the point numbers of each triangle can be obtained. For example... Figure 7 The triangle in the upper left corner is formed by the points of interest (0, 1, 30).
[0100] Definition of Delaunay triangulation: For a given set of points, if the triangular partitions formed by these points satisfy the following conditions one and two, then the partition is called a Delaunay triangulation:
[0101] Condition 1: The circumcircle of each triangle does not contain any points;
[0102] Condition 2: The circumcircles of any two non-adjacent triangles do not intersect.
[0103] against Figure 7 For each triangle in the diagram, given the pixel coordinates of its three vertices and their corresponding PT values, an affine transformation matrix M is solved using the least squares method. M converts the pixel coordinates to PT coordinates. Here, M is the mapping matrix for that triangular region. For each point within the effective region, it uniquely belongs to a certain triangle, so it has a unique mapping matrix that maps its pixel coordinates to PT values.
[0104] At this point, the offline calibration process for the bolt carrier is complete, saving the effective range of the bolt carrier, the coordinates of all triangle vertices, and the mapping matrix (affine transformation matrix) for each triangle.
[0105] Online phase:
[0106] 104. Obtain the video stream information of the camera. Based on the target detection model, obtain the first position information of the detected target in the current frame. The first position information includes pixel coordinates and the width and height information of the detected target.
[0107] For example, the current keyframe in the video stream of the camera is selected, and the Yolov5 algorithm based on neural networks is used to obtain the first position information of the detected target in the current frame.
[0108] 105. Based on the pixel coordinates of the center point of the detected target, determine whether the pixel coordinates are within the pixel coordinate range of the region of interest.
[0109] If yes, proceed to step 106; otherwise, end.
[0110] 106. Determine the triangle to which the detected target belongs based on the pixel coordinates of the center point of the detected target and the pixel coordinates of the three vertices of each triangle;
[0111] 107. Based on the radiative transformation matrix of the triangle to which the detected target belongs, convert the pixel coordinates of the center point of the detected target into the PT value of the detected target.
[0112] 108. Based on the known zoom value range of the gimbal camera and the width and height information of the target being detected, obtain the zoom value of the target being detected.
[0113] The zoom value range of the gimbal camera is z_min to z_max. The zoom value Z of the detected target is obtained based on the following formula. 目标 ;
[0114] Z 目标 = (z_min - z_max) * S + z_max,
[0115] S=min(w / image_w,h / image_h);
[0116] image_w and image_h represent the resolution width and height of the camera module, respectively;
[0117] w and h represent the width and height of the target being detected, respectively.
[0118] The method described in this embodiment has a simpler operation process, resulting in faster real-time inference and more accurate positioning. This method is applicable to camera calibration schemes involving multiple bullet cameras and gimbal cameras, achieving rapid fitting between bullet camera image pixels and gimbal camera PTZ. Compared to other similar technologies, it offers a simpler operation process, faster real-time inference, and more accurate positioning.
[0119] In addition, embodiments of the present invention also provide a target localization method based on the linkage of a gun camera and a gimbal camera, which includes:
[0120] A10. Acquire the target position information of the target detected by the gun in real time, and determine whether the target position information is within the predefined region of interest;
[0121] A20. If it belongs to the target, then based on the target location information, the vertex coordinates of the triangle to which the target location information belongs, and the ray transformation matrix, obtain the PT value and Zoom value of the detected target used by the gimbal camera when focusing on the target.
[0122] A30. Send the PT value and Zoom value to the gimbal camera so that the gimbal camera rotates and focuses on the detection target based on the PT value and Z value;
[0123] The predefined region of interest is the area within the field of view of the corresponding gimbal camera determined from the image captured by the bullet camera when the bullet camera and the gimbal camera are bound together.
[0124] In the offline phase, the region of interest is divided into multiple polygons by using polygon subdivision, and the pixel coordinates and PT values of each vertex in each polygon are obtained, as well as the radiative transformation matrix of each vertex in pixel coordinates to its respective PT value.
[0125] Understandably, in the offline stage, the region of interest is divided into multiple triangles by using triangulation, and the pixel coordinates and PT values of the three vertices in each triangle are obtained, as well as the radiative transformation matrix that converts the pixel coordinates of the three vertices into their respective PT values.
[0126] The method in this embodiment can be an automatic control process implemented by the control device described below in the online inference stage. The offline stage mentioned above can be pre-acquired, and some steps can be manually triggered and then the control device processes the calculation. In other embodiments, the offline stage can be an automatic process implemented by the control device. This embodiment does not limit it.
[0127] According to another aspect of the invention, the present invention also provides a computing device, i.e., a control device, which is electrically connected to a gimbal camera and at least one camera module. When the camera module and the gimbal camera are bound together, the processor of the computing device executes the steps of a target positioning method based on the linkage of the camera module and the gimbal camera as described in any of the above embodiments.
[0128] It should be noted that the word "a" or "one" preceding a component does not preclude the existence of multiple such components. This invention can be implemented using hardware comprising several different components and using a suitably programmed computer. The use of terms such as "first," "second," "third," etc., is merely for convenience and does not indicate any order. These terms can be understood as part of the component names.
[0129] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0130] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning of the basic inventive concept, can make other changes and modifications to these embodiments.
[0131] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from the spirit and scope of the invention.
Claims
1. A target positioning method based on a linkage of a gun and a gimbal camera, characterized in that, Comprising: S10, by means of offline calibration, binding the gun camera associated with the holder camera and obtaining the vertex coordinates and radial transformation matrix of each polygon of the region of interest in the frame image to which the gun camera belongs based on polygon subdivision method; for each gun camera bound by the holder camera, selecting a frame image from the video stream captured by the gun camera, and determining the subgraph in the frame image belonging to the visual range of the holder camera; Selecting a plurality of first coordinate points on the boundary region of the subgraph, connecting all the first coordinate points according to the specified direction to form the region of interest, and obtaining the pixel coordinate range of the region of interest; Selecting a plurality of second coordinate points inside the region of interest according to the limited distance and uniformity conditions; Obtaining the pixel coordinates and PT values of all first coordinate points, the PT value being the rotation information when any first coordinate point is focused by the holder camera; Obtaining the pixel coordinates and PT values of all second coordinate points, the PT value being the rotation information when any second coordinate point is focused by the holder camera; Based on the triangular subdivision method, all first coordinate points and all second coordinate points are formed into sequentially arranged and non-repeated triangles, each triangle having a unique identification; Based on the pixel coordinates and PT values of the three vertices in each triangle, the radial transformation matrix converting the three vertices in the pixel coordinates into their respective PT values is obtained; S20, obtaining the target position information of the detection target captured by the gun camera in real time, and judging whether the target position information is located in the region of interest; S30, if yes, obtaining the PT value and Zoom value of the detection target to which the holder camera is used to focus the target according to the target position information and the vertex coordinates and radial transformation matrix of the polygon to which the target position information belongs; S40, sending the PT value and Zoom value to the holder camera, so that the holder camera rotates and focuses on the detection target based on the PT value and Zoom value.
2. The method of claim 1, wherein, The S10 based on the polygon subdivision method to obtain the vertex coordinates and radial transformation matrix of each polygon of the region of interest in the frame image to which the gun camera belongs, comprising: Based on the triangular subdivision method, the vertex coordinates and radial transformation matrix of each triangle of the region of interest in the frame image to which the gun camera belongs are obtained.
3. The method of claim 2, wherein, The S20 comprises: Obtaining the video stream information of the gun camera, and obtaining the first position information of the detection target in the current frame according to the target detection model, the first position information including pixel coordinates and width and height information of the detection target; According to the pixel coordinates of the detection target, it is judged whether the pixel coordinates are located in the pixel coordinate range of the region of interest, If yes, step S30 is executed, otherwise, it is ended.
4. The method of claim 3, wherein, The S30 comprises: According to the pixel coordinates of the detection target center point and the pixel coordinates of the three vertices in each triangle, the triangle to which the detection target belongs is determined; According to the radial transformation matrix of the triangle to which the detection target belongs, the pixel coordinates of the detection target center point are converted into the PT value of the detection target.
5. The method of claim 4, wherein, The S30 further comprises: According to the known Zoom value range of the holder camera and the width and height information of the detection target, the Zoom value of the detection target is obtained.
6. The method of claim 5, wherein, The Zoom value range of the PTZ camera is z_min ~ z_max, and the Zoom value Z of the detected target is obtained based on the following formula 目标 ; Z 目标 = (z_min - z_max) * S + z_max, S = min(w / image_w, h / image_h); image_w and image_h represent the resolution width and height of the gun respectively; w and h represent the width and height of the detection target respectively.
7. The method of claim 3, wherein obtaining video stream information of the gun, and obtaining first position information of the detection target in the current frame according to a target detection model, comprising: selecting a current key frame in the video stream information of the gun, and obtaining the first position information of the detection target in the current frame by using a Yolov5 algorithm based on a neural network.
8. A computing device, comprising: electrically connecting the gimbal camera and the at least one gun, and when the gun and the gimbal camera are bound, the processor of the computing device executes the steps of the target positioning method based on the gun and the gimbal camera linkage according to any one of claims 1 to 7.
Citation Information
Patent Citations
Box camera and dome camera linkage coordinate positioning method
CN107730556A
Gun-ball linkage calibration method, device and equipment
CN112419424A