A control method, device and equipment for monitoring equipment
By obtaining the picture mapping relationship of the monitoring equipment and adjusting the control parameters, the problem of large -scale linked errors in the existing technologies has been solved, and high -precision linkage adjustments have been achieved, and the time -consuming and errors of artificial calibration are reduced.
Patent Information
- Application Number
- CN202210036244.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-10
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-01-10
AI Technical Summary
The calibration method of the existing monitoring equipment's bolt and ball machine linkage has problems of large errors and long time, especially in the absence of image conditions that are obvious feature points, the calibration process is even more difficult.
By obtaining the monitoring screen of the first monitoring equipment within the scope of its monitoring, adjust the control parameters of the second monitoring equipment, so that the scope of monitoring includes the scope of the first monitoring, determine the mapping relationship of the picture, and control the second according to the mapping relationship. Monitoring equipment is adjusted with the first monitoring equipment.
The high accuracy of monitoring equipment has been achieved, which significantly reduces the time and errors of manual timing.
Smart Images

Figure CN114339166B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of equipment control, and in particular to a control method, device and equipment for monitoring equipment. Background Art
[0002] With the development of artificial intelligence technology, intelligent monitoring and capturing technology has also received more and more attention. For example, the checkpoint monitoring system combines deep learning technology to monitor ports, waterways, checkpoints and other important transportation routes. The system usually adopts a gun camera and a ball camera linkage system. The gun camera detects and tracks the target, and the ball camera captures. The accuracy of the gun-ball linkage of the system is particularly important. The linkage accuracy directly affects the real-time tracking of the target and the capture effect.
[0003] Existing technologies usually use gun cameras and ball cameras to calibrate reference points, perform multi-point calibration through gun camera pixels and ball camera horizontal angle and pitch angle, and use least squares or curve fitting to achieve the mapping relationship between the two. This method will lead to large errors and poor results if there are few reference points. If there are many reference points, there will still be large errors and it will take time to calibrate. When the image has no obvious feature points, the calibration process is even more difficult. Some technologies use methods that limit the installation positions of gun cameras and ball cameras to achieve approximate consistency between the two images, which results in limited construction and considerable errors. Summary of the invention
[0004] The present invention provides a control method, device and equipment for monitoring equipment, which achieve high precision and greatly reduce the time consumption and error in manual calibration of the monitoring equipment screen.
[0005] To solve the above technical problems, the embodiments of the present invention provide the following solutions:
[0006] A control method for a monitoring device, comprising:
[0007] Acquire a first monitoring picture of a first monitoring device within a first monitoring range;
[0008] Adjusting control parameters of a second monitoring device so that a second monitoring range of the second monitoring device includes the first monitoring range, and determining a mapping relationship between a first monitoring screen within the first monitoring range and a second monitoring screen within the second monitoring range;
[0009] According to the mapping relationship, the second monitoring device is controlled to be adjusted in linkage with the first monitoring device.
[0010] Optionally, determining a mapping relationship between a first monitoring screen within a first monitoring range and a second monitoring screen within a second monitoring range includes:
[0011] Acquire at least four first target pixels in a first monitoring picture and acquire at least four second target pixels in a second monitoring picture, wherein one of the first target pixels and one of the second target pixels constitute a pair of target pixels, and the first target pixel and the second target pixel have the same features;
[0012] Based on the at least 4 pairs of target pixels, the mapping relationship between the first monitoring screen and the second monitoring screen is determined; at least 3 of the at least 4 first target pixels are not collinear, and at least 3 of the at least 4 second target pixels are not collinear.
[0013] Optionally, determining a mapping relationship between the first monitoring picture and the second monitoring picture according to the at least four pairs of target pixels includes:
[0014] Determine a relationship between the two-dimensional coordinates of a first target pixel point and the three-dimensional coordinates of a second target pixel point in each pair of target pixels;
[0015] A mapping relationship matrix is determined according to the relationship expression and the two-dimensional coordinates of the second target pixel point.
[0016] Optionally, determining a relationship between the two-dimensional coordinates of a first target pixel point and the three-dimensional coordinates of a second target pixel point in each pair of target pixels includes:
[0017] Get the two-dimensional coordinates (x i ,y i ) and the three-dimensional coordinates (x′) of the second target pixel of the i-th pair of target pixels i ,y′ i ,z′ i );
[0018] According to the two-dimensional coordinates (x i ,y i ) and the three-dimensional coordinates of the second target pixel (x′ i ,y′ i ,z′ i ), through the formula The relationship is:
[0019] Among them, x′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ) in the horizontal axis, y′ i is the three-dimensional coordinate of the second target pixel (x′ i ,t′ i ,z′i ) in the vertical coordinate, z′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ), is the mapping relationship matrix, x i is the two-dimensional coordinate of the first target pixel (x i ,y i ) in the horizontal axis, y i is the two-dimensional coordinate of the first target pixel (x i ,y i ) in the vertical axis.
[0020] Optionally, determining a mapping relationship matrix according to the relationship expression and the two-dimensional coordinates of the second target pixel point includes:
[0021] According to the three-dimensional coordinates (x′ i , y′ i , z′ i ), through the formula and Determine the two-dimensional coordinates of the second target pixel point in the i-th pair of target pixel points as (u i ,v i );
[0022] The two-dimensional coordinate (x i ,y i ) and the two-dimensional coordinates of the second target pixel are (u i ,v i ), through the formula Determine the mapping relationship matrix; where a 11 , a 12 , a 13 , a 21 , a 22 , a 23 , a 31 , a 32 and a 33 is the element in the mapping relationship matrix, u i The two-dimensional coordinates of the second target pixel are (u i ,v i ), v i The two-dimensional coordinates of the second target pixel are (u i ,v i ) in the vertical axis.
[0023] Optionally, according to the mapping relationship, controlling the second monitoring device to be adjusted in linkage with the first monitoring device includes:
[0024] Determine the deviation angle of the second target pixel from the center position corresponding to the second monitoring screen;
[0025] According to the deviation angle, an angle parameter of the second monitoring device corresponding to the first target pixel point is obtained;
[0026] According to the angle parameter of the second monitoring device corresponding to the first target pixel point on the first monitoring device, the second monitoring device is controlled to be adjusted in linkage.
[0027] Optionally, determining a deviation angle between the second target pixel point and a center position corresponding to the second monitoring screen includes:
[0028] By formula Calculate the horizontal deviation angle of the second target pixel point corresponding to the first target pixel point from the center position corresponding to the second monitoring screen; where p' is the horizontal deviation angle, X 像素 is the horizontal position of the second target pixel, ω is the pixel width of the second target pixel, and γ is the horizontal field angle of the second target pixel; and / or
[0029] By formula Calculate the vertical deviation angle between the second target pixel point corresponding to the first target pixel point and the center position corresponding to the second monitoring screen; where t' is the vertical deviation angle, Y 像素 is the vertical position of the second target pixel, h is the pixel length of the second target pixel, and δ is the vertical field angle of the second target pixel.
[0030] The present invention also provides a control device for a monitoring device, the device comprising:
[0031] An acquisition module, used to acquire a first monitoring picture of a first monitoring device within a first monitoring range;
[0032] A processing module is used to adjust the control parameters of the second monitoring device so that the second monitoring range of the second monitoring device includes the first monitoring range, determine the mapping relationship between the first monitoring screen within the first monitoring range and the second monitoring screen within the second monitoring range; and control the second monitoring device to be linked and adjusted with the first monitoring device according to the mapping relationship.
[0033] The present invention also provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the control method of the monitoring device as described above.
[0034] The present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enables the computer to execute the control method of the monitoring device as described above.
[0035] The above solution of the present invention includes at least the following beneficial effects:
[0036] The above scheme of the present invention obtains the first monitoring screen of the first monitoring device within the first monitoring range; adjusts the control parameters of the second monitoring device so that the second monitoring range of the second monitoring device includes the first monitoring range, determines the mapping relationship between the first monitoring screen within the first monitoring range and the second monitoring screen within the second monitoring range; and controls the second monitoring device to be adjusted in linkage with the first monitoring device according to the mapping relationship. The scheme of the present invention is simple in obtaining the mapping relationship between the first monitoring device and the second monitoring device, with high precision, and greatly reduces the time consumption and error in manually calibrating the screens of the monitoring devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic flow chart of a control method for a monitoring device according to an embodiment of the present invention;
[0038] Figure 2 A schematic flow chart of a control method for a monitoring device in a specific embodiment provided by the present invention;
[0039] Figure 3 Schematic diagram of the structure of a control device of a monitoring device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0041] like Figure 1 As shown, the present invention provides a control method for a monitoring device, comprising:
[0042] Step 11, obtaining a first monitoring picture within a monitoring range of a first monitoring device;
[0043] Step 12, adjusting the control parameters of the second monitoring device so that the second monitoring range of the second monitoring device includes the first monitoring range, and determining a mapping relationship between the first monitoring screen within the first monitoring range and the second monitoring screen within the second monitoring range;
[0044] Step 13: Control the second monitoring device to adjust in linkage with the first monitoring device according to the mapping relationship.
[0045] In this embodiment, based on the first monitoring screen obtained by the first monitoring device within the monitoring range, the control parameters of the second monitoring device are adjusted so that the second monitoring range of the second monitoring device includes the first monitoring range, and the mapping relationship between the first monitoring screen and the second monitoring screen is determined. According to the mapping relationship, the first monitoring device and the first monitoring device are controlled to be adjusted in linkage. The linkage adjustment here means that when the first monitoring device is adjusted, the second monitoring device will be adjusted according to the adjustment of the first monitoring device. The method of obtaining the mapping relationship is simple and accurate, which greatly reduces the time and error in manual calibration of the monitoring device screen.
[0046] It should be noted that the first monitoring device and the second monitoring device here may be monitoring devices with a rotatable monitoring range or monitoring devices with a fixed monitoring range, and the present application is not limited thereto;
[0047] The second monitoring range includes the first monitoring range, which means that the second monitoring range completely includes the first monitoring range, that is, the second monitoring screen within the second monitoring range can include all the screen contents of the first monitoring screen within the first monitoring range;
[0048] When the first monitoring device is a monitoring device with a fixed first monitoring range, and the second monitoring device is a monitoring device with a rotatable second monitoring range, at this time, the second monitoring range includes the first monitoring range, which means that the rotatable second monitoring range of the second monitoring device can include the first monitoring range, that is, at least two second monitoring images captured under the rotatable second monitoring range can completely include all the contents in the first monitoring image.
[0049] In an optional embodiment of the present invention, step 11 includes:
[0050] Step 111, obtaining the stream address of the first monitoring device;
[0051] Step 112, obtaining a first real-time video stream of the first monitoring device according to the stream address of the first monitoring device;
[0052] Step 113, obtaining a first monitoring screen according to the first real-time video stream; the first monitoring screen is a video screen of the first real-time video stream at a preset time.
[0053] In this embodiment, the stream address of the first monitoring device is preferably a URL for obtaining the real-time video stream of the first monitoring device. The real-time video stream is obtained through the stream address of the first monitoring device, and then the video picture at a preset time is obtained as the first monitoring picture.
[0054] In an optional embodiment of the present invention, after step 11, the method further includes:
[0055] Step 114, obtaining the stream address of the second monitoring device;
[0056] Step 115, obtaining a second real-time video stream of the second monitoring device according to the stream address of the second monitoring device, and connecting to a control interface of the second monitoring device;
[0057] Step 116, obtaining a second monitoring screen according to the second real-time video stream; the second monitoring screen is a video screen of the second real-time video stream at a preset time.
[0058] In this embodiment, the stream address of the second monitoring device is preferably a URL for obtaining the real-time video stream of the second monitoring device. The real-time video stream is obtained through the stream address of the second monitoring device, and then the video picture at a preset time is obtained as the second monitoring picture. At the same time, on the basis of obtaining the second monitoring picture, the control interface of the second monitoring device is connected according to the stream address. The control interface here is used to control the rotation of the second monitoring device and obtain relevant parameters of the second monitoring device. The relevant parameters here include horizontal angle, pitch angle and field of view angle, etc.
[0059] In an optional embodiment of the present invention, determining the mapping relationship between the first monitoring screen within the first monitoring range and the second monitoring screen within the second monitoring range in step 12 includes:
[0060] Step 121, obtaining at least four first target pixels in a first monitoring picture and obtaining at least four second target pixels in a second monitoring picture, wherein one of the first target pixels and one of the second target pixels constitute a pair of target pixels, and the first target pixel and the second target pixel have the same features;
[0061] Step 122, determining the mapping relationship between the first monitoring screen and the second monitoring screen based on the at least 4 pairs of target pixels; at least 3 of the at least 4 first target pixels are not collinear, and at least 3 of the at least 4 second target pixels are not collinear.
[0062] In this embodiment, at least four first target pixels are obtained on the first monitoring screen, and at least four second target pixels having the same characteristics as the first target pixels are obtained on the second monitoring screen based on the first target pixels, wherein a first target pixel and a second target pixel having the same characteristics as the first target pixel constitute a pair of target pixels, and at least four first target pixels can constitute at least four pairs of target pixels; at least three of the at least four first target pixels are not collinear, and at least three of the at least four second target pixels having the same characteristics as the at least four first target pixels are also not collinear;
[0063] Based on at least 4 pairs of target pixels, the mapping relationship between the first monitoring screen and the second monitoring screen can be determined; the mapping relationship between the two screens here can be reflected by a mapping relationship matrix or by other methods, and the present application is not limited to this.
[0064] In an optional embodiment of the present invention, after adjusting the control parameters of the second monitoring device in step 12 so that the second monitoring range of the second monitoring device includes the first monitoring range, the method further includes:
[0065] Step 113, when the second monitoring range of the second monitoring device includes the first monitoring range, determine the horizontal angle, pitch angle, horizontal field of view angle, vertical field of view angle, pixel width and pixel length of the second monitoring screen of the second monitoring device.
[0066] In an optional embodiment of the present invention, step 122 includes:
[0067] Step 1221, determining a relationship between the two-dimensional coordinates of a first target pixel point and the three-dimensional coordinates of a second target pixel point in each pair of target pixels;
[0068] Step 1222: Determine a mapping relationship matrix according to the relationship expression and the two-dimensional coordinates of the second target pixel point.
[0069] In this embodiment, according to at least 4 pairs of target pixel points, a relationship between the two-dimensional coordinates of the first target pixel point and the three-dimensional coordinates of the second target pixel point in each pair of target pixel points is determined, wherein the two-dimensional coordinates are preferably point coordinates of the corresponding target pixel point in the plane rectangular coordinate system of the monitoring screen expressed in the form of a number pair (x, y), wherein x is the horizontal coordinate and y is the vertical coordinate; the three-dimensional coordinates are preferably point coordinates of the corresponding target pixel point in the monitoring screen in the form of (x, y, z) in the space rectangular coordinate system, wherein x is the horizontal coordinate, y is the vertical coordinate, and z is the vertical coordinate;
[0070] According to the relationship and the two-dimensional coordinates of the second target pixel, the mapping relationship matrix of the first monitoring screen and the second monitoring screen can be determined, wherein the two-dimensional coordinates of the second target pixel and the three-dimensional coordinates of the second target pixel can be obtained by the formula:
[0071] and After conversion, (x', y', z') is the three-dimensional coordinate of the second target pixel, and (u, v) is the two-dimensional coordinate of the second target pixel.
[0072] In an optional embodiment of the present invention, step 1221 includes:
[0073] Step 12211, obtain the two-dimensional coordinates (x i,y i ) and the three-dimensional coordinates (x′) of the second target pixel of the i-th pair of target pixels i ,y′ i ,z′ i );
[0074] Step 12212: according to the two-dimensional coordinates (x i ,y i ) and the three-dimensional coordinates of the second target pixel (x′ i ,y′ i ,z′ i ), through the formula The relationship is:
[0075] Among them, x′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ) in the horizontal axis, y′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ) in the vertical coordinate, z′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ), is the mapping relationship matrix, x i is the two-dimensional coordinate of the first target pixel (x i ,y i ) in the horizontal axis, y i is the two-dimensional coordinate of the first target pixel (x i ,y i ) in the vertical axis.
[0076] In this embodiment, the two-dimensional coordinates (x ) of the first target pixel point of the i-th pair of target pixels in at least four pairs of target pixels are obtained. i ,y i ) and the three-dimensional coordinates (x′) of the second target pixel of the i-th pair of target pixels i ,y′ i ,z′ i ), where i = 1, 2, 3, 4;
[0077] By formula Combining the operation rules of matrix multiplication, we can get the relationship as follows: in, is the mapping relationship matrix.
[0078] Further, step 1222 includes:
[0079] According to the three-dimensional coordinates (x′ i , y′ i , z′ i ), through the formula and Determine the two-dimensional coordinates of the second target pixel point in the i-th pair of target pixel points as (u i ,v i );
[0080] Step 12222: The two-dimensional coordinate (x i ,y i ) and the two-dimensional coordinates of the second target pixel are (u i ,v i ), through the formula Determine the mapping relationship matrix; where a 11 , a 12 , a 13 , a 21 , a 22 , a 23 , a 31 , a 32 and a 33 is the element in the mapping relationship matrix, u i The two-dimensional coordinates of the second target pixel are (u i ,v i ), v i The two-dimensional coordinates of the second target pixel are (u i ,v i ) in the vertical axis.
[0081] In this embodiment, the formula and The three-dimensional coordinate (x′) of the second target pixel in the i-th pair of target pixels i , y′ i , z′ i ) is converted into two-dimensional coordinates (u i ,v i ), through the formula Determine the mapping relationship matrix Among them, u i 、v i 、x i and i For known parameters, solve the element a in the mapping relationship matrix 11 , a 12 , a 13 , a 21 , a22 , a 23 , a 31 , a 32 and a 33 At least 4 sets of known parameters u are required i 、v i 、x i and i , therefore, the mapping relationship matrix is determined by at least 4 pairs of target pixels.
[0082] In an optional embodiment of the present invention, step 13 includes:
[0083] Step 131, determining a deviation angle between a second target pixel point and a center position corresponding to a second monitoring screen;
[0084] Step 132, obtaining an angle parameter of the second monitoring device corresponding to the first target pixel point according to the deviation angle;
[0085] Step 133, controlling the second monitoring device to adjust in linkage according to the angle parameter of the second monitoring device corresponding to the first target pixel point on the first monitoring device.
[0086] In this embodiment, according to the mapping relationship between the first monitoring screen and the second monitoring screen, the deviation angle of the second target pixel point from the corresponding center position of the second monitoring screen is determined, wherein the deviation angle of the second monitoring screen includes a horizontal deviation angle and a vertical deviation angle. According to the deviation angle, the angle parameters of the second monitoring device are determined, and the angle parameters include a horizontal angle and a pitch angle. The first target pixel point of the first monitoring screen of the first monitoring device and the angle parameters of the second monitoring device have a one-to-one correspondence, that is, each first target pixel point on the first monitoring screen corresponds to an angle parameter of the second monitoring device. When any first target pixel point is selected on the first monitoring screen, the second monitoring device can be controlled to be linked and adjusted to the monitoring angle corresponding to the angle parameter according to the corresponding angle parameter.
[0087] In an optional embodiment of the present invention, step 131 includes:
[0088] Step 1311, by formula Calculate the horizontal deviation angle of the second target pixel point corresponding to the first target pixel point from the center position corresponding to the second monitoring screen; where p' is the horizontal deviation angle, X 像素 is the horizontal position of the second target pixel, ω is the pixel width of the second target pixel, and γ is the horizontal field angle of the second target pixel; and / or
[0089] Step 1312, by formula Calculate the vertical deviation angle between the second target pixel point corresponding to the first target pixel point and the center position corresponding to the second monitoring screen; where t' is the vertical deviation angle, Y 像素 is the vertical position of the second target pixel, h is the pixel length of the second target pixel, and δ is the vertical field angle of the second target pixel.
[0090] In this embodiment, the formula A horizontal deviation angle is calculated, and further, according to the horizontal deviation angle, a horizontal angle in the angle parameter of the second monitoring device corresponding to the first target pixel point is obtained as p=α+p', wherein α is the horizontal angle of the second monitoring device obtained in step 113 when the second monitoring range of the second monitoring device includes the first monitoring range;
[0091] By formula A vertical deviation angle is calculated, and further, according to the vertical deviation angle, a vertical angle in the angle parameter of the second monitoring device corresponding to the first target pixel point is obtained as t=β+t', wherein β is the pitch angle of the second monitoring device obtained in step 113 when the second monitoring range of the second monitoring device includes the first monitoring range;
[0092] It should be noted that the horizontal position X of the second target pixel 像素 and the vertical position Y of the second target pixel 像素 It is obtained based on the mapping relationship matrix.
[0093] Through the above steps 1311 and 1312, the horizontal angle and pitch angle of the second monitoring device corresponding to the first target pixel point can be calculated. When the second monitoring device is controlled to be adjusted in linkage according to the angle parameter of the second monitoring device corresponding to the first target pixel point on the first monitoring device, any first target pixel point on the first monitoring screen of the first monitoring device is selected, the angle parameter can be obtained by calculating the angle parameter or reading the preset angle parameter, and the second monitoring device can be adjusted in linkage to the position where the angle parameter is located.
[0094] Optionally, the angle parameter is obtained by calculating the angle parameter, including:
[0095] Select any first target pixel on the first monitoring screen;
[0096] According to the selected first target pixel point, an angle parameter corresponding to the selected first target pixel point is calculated.
[0097] Optionally, the angle parameters are obtained by reading preset angle parameters, including:
[0098] Traverse all first target pixel points on the first monitoring device to obtain angle parameters corresponding to all first target pixel points;
[0099] When any first target pixel point on the first monitoring screen is selected, the angle parameter corresponding to the first target pixel point is read.
[0100] like Figure 2 As shown, in a specific embodiment, the first monitoring device is a gun camera device with a fixed monitoring range, and the second monitoring device is a ball camera device with a rotatable monitoring range. By clicking the gun camera screen, the ball camera is controlled to adjust to the corresponding screen, including:
[0101] Step a, obtaining the video stream of the gun camera, the video stream of the ball camera and the control parameters of the ball camera;
[0102] Step b, adjusting the ball camera so that the current ball camera screen of the ball camera includes all the gun camera screens;
[0103] Step c, judging whether the current ball camera screen of the ball camera can include all the gun camera screens;
[0104] Step c1, if not, adjust the ball camera so that at least two ball camera images within the monitoring range of the ball camera can include all the gun camera images, and then enter step d;
[0105] Step c2: if yes, proceed to step d;
[0106] Step d, recording the horizontal angle, pitch angle, horizontal field angle, vertical field angle, pixel width and pixel length of the second monitoring screen of the ball camera at this time;
[0107] Step e, selecting at least four first target pixels on the gun camera screen, and further, selecting at least four second target pixels with the same characteristics on the ball camera screen according to the at least four first target pixels; forming a pair of target pixels with two first target pixels and second target pixels with the same characteristics;
[0108] Step f, according to at least 4 pairs of target pixel points, a perspective transformation formula is introduced to obtain a perspective transformation matrix, where the perspective transformation matrix is used to represent a mapping relationship between a first target pixel point and a second target pixel point;
[0109] Step g, according to the relevant parameters of the ball camera recorded in step d and the perspective transformation matrix, the horizontal angle and pitch angle of the ball camera corresponding to the first target pixel point on the gun camera are calculated; when the first target pixel point on the gun camera is selected, the horizontal angle and pitch angle of the corresponding ball camera can be calculated, and the ball camera is controlled to adjust to the position of the horizontal angle and pitch angle.
[0110] In the embodiment of the present invention, the first monitoring screen of the first monitoring device within the first monitoring range is obtained; the control parameters of the second monitoring device are adjusted so that the second monitoring range of the second monitoring device includes the first monitoring range, and the mapping relationship between the first monitoring screen within the first monitoring range and the second monitoring screen within the second monitoring range is determined; according to the mapping relationship, the second monitoring device is controlled to be adjusted in linkage with the first monitoring device. In the embodiment of the present invention, the method for obtaining the mapping relationship between the first monitoring device and the second monitoring device is simple and has high precision, which greatly reduces the time consumption and error when manually calibrating the screens of the monitoring devices.
[0111] like Figure 3 As shown, the present invention also provides a control device 30 for a monitoring device, the device 30 comprising:
[0112] An acquisition module 31 is used to acquire a first monitoring picture of a first monitoring device within a first monitoring range;
[0113] The processing module 32 is used to adjust the control parameters of the second monitoring device so that the second monitoring range of the second monitoring device includes the first monitoring range, and determine the mapping relationship between the first monitoring screen within the first monitoring range and the second monitoring screen within the second monitoring range; according to the mapping relationship, the second monitoring device is controlled to be adjusted in linkage with the first monitoring device.
[0114] Optionally, determining a mapping relationship between a first monitoring screen within a first monitoring range and a second monitoring screen within a second monitoring range includes:
[0115] Acquire at least four first target pixels in a first monitoring picture and acquire at least four second target pixels in a second monitoring picture, wherein one of the first target pixels and one of the second target pixels constitute a pair of target pixels, and the first target pixel and the second target pixel have the same features;
[0116] Based on the at least 4 pairs of target pixels, the mapping relationship between the first monitoring screen and the second monitoring screen is determined; at least 3 of the at least 4 first target pixels are not collinear, and at least 3 of the at least 4 second target pixels are not collinear.
[0117] Optionally, determining a mapping relationship between the first monitoring picture and the second monitoring picture according to the at least four pairs of target pixels includes:
[0118] Determine a relationship between the two-dimensional coordinates of a first target pixel point and the three-dimensional coordinates of a second target pixel point in each pair of target pixels;
[0119] A mapping relationship matrix is determined according to the relationship expression and the two-dimensional coordinates of the second target pixel point.
[0120] Optionally, determining a relationship between the two-dimensional coordinates of a first target pixel point and the three-dimensional coordinates of a second target pixel point in each pair of target pixels includes:
[0121] Get the two-dimensional coordinates (x i ,y i ) and the three-dimensional coordinates (x′) of the second target pixel of the i-th pair of target pixels i ,y′ i ,z′ i );
[0122] According to the two-dimensional coordinates (x i ,y i ) and the three-dimensional coordinates of the second target pixel (x′ i ,y′ i ,z′ i ), through the formula The relationship is:
[0123] Among them, x′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ) in the horizontal axis, y′ i is the three-dimensional coordinate of the second target pixel (x′ i ,t′ i ,z′ i ) in the vertical coordinate, z′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ), is the mapping relationship matrix, x i is the two-dimensional coordinate of the first target pixel (x i ,y i ) in the horizontal axis, y i is the two-dimensional coordinate of the first target pixel (x i ,y i ) in the vertical axis.
[0124] Optionally, determining a mapping relationship matrix according to the relationship expression and the two-dimensional coordinates of the second target pixel point includes:
[0125] According to the three-dimensional coordinates (x′ i , y′ i , z′ i ), through the formula and Determine the two-dimensional coordinates of the second target pixel point in the i-th pair of target pixel points as (u i ,v i );
[0126] The two-dimensional coordinate (x i ,y i ) and the two-dimensional coordinates of the second target pixel are (u i ,v i ), through the formula Determine the mapping relationship matrix; where a 11 , a 12 , a 13 , a 21 , a 22 , a 23 , a 31 , a 32 and a 33 is the element in the mapping relationship matrix, u i The two-dimensional coordinates of the second target pixel are (u i ,v i ), v i The two-dimensional coordinates of the second target pixel are (u i ,v i ) in the vertical axis.
[0127] Optionally, according to the mapping relationship, controlling the second monitoring device to be adjusted in linkage with the first monitoring device includes:
[0128] Determine the deviation angle of the second target pixel from the center position corresponding to the second monitoring screen;
[0129] According to the deviation angle, an angle parameter of the second monitoring device corresponding to the first target pixel point is obtained;
[0130] According to the angle parameter of the second monitoring device corresponding to the first target pixel point on the first monitoring device, the second monitoring device is controlled to be adjusted in linkage.
[0131] Optionally, determining a deviation angle between the second target pixel point and a center position corresponding to the second monitoring screen includes:
[0132] By formula Calculate the horizontal deviation angle of the second target pixel point corresponding to the first target pixel point from the center position corresponding to the second monitoring screen; where p' is the horizontal deviation angle, X 像素 is the horizontal position of the second target pixel, ω is the pixel width of the second target pixel, and γ is the horizontal field angle of the second target pixel; and / or
[0133] By formula Calculate the vertical deviation angle between the second target pixel point corresponding to the first target pixel point and the center position corresponding to the second monitoring screen; where t' is the vertical deviation angle, Y 像素 is the vertical position of the second target pixel, h is the pixel length of the second target pixel, and δ is the vertical field angle of the second target pixel. It should be noted that the device is a device corresponding to the above method, and all implementation methods in the above method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.
[0134] An embodiment of the present invention further provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the control method of the monitoring device as described above. All implementations in the above method embodiments are applicable to the embodiments of the electronic device, and can also achieve the same technical effects.
[0135] The embodiment of the present invention further provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method described above. All implementations in the above method embodiment are applicable to the embodiment of the computer-readable storage medium, and can also achieve the same technical effect.
[0136] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0137] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0138] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0141] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0142] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.
[0143] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.
[0144] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A control method for a monitoring device, characterized in that: include: Acquire a first monitoring picture of a first monitoring device within a first monitoring range; Adjusting the control parameters of the second monitoring device so that the second monitoring range of the second monitoring device includes the first monitoring range, wherein the second monitoring range of the second monitoring device includes the first monitoring range means that the second monitoring screen within the second monitoring range can contain all screen contents of the first monitoring screen within the first monitoring range; Determine a mapping relationship between a first monitoring screen within a first monitoring range and a second monitoring screen within a second monitoring range; According to the mapping relationship, controlling the second monitoring device to be adjusted in linkage with the first monitoring device; Wherein, obtaining a first monitoring screen of a first monitoring device within a first monitoring range includes: Obtaining a stream address of a first monitoring device; Obtaining a first real-time video stream of the first monitoring device according to the stream address of the first monitoring device; According to the first real-time video stream, a first monitoring picture is obtained; the first monitoring picture is a video picture of the first real-time video stream at a preset time; After obtaining the first monitoring picture of the first monitoring device within the first monitoring range, the method further includes: Obtaining a stream address of a second monitoring device; Obtaining a second real-time video stream of the second monitoring device according to the stream address of the second monitoring device, and connecting to a control interface of the second monitoring device; According to the second real-time video stream, a second monitoring screen is obtained; the second monitoring screen is a video screen of the second real-time video stream at a preset time; Wherein, determining a mapping relationship between a first monitoring screen within a first monitoring range and a second monitoring screen within a second monitoring range includes: Acquire at least four first target pixels in a first monitoring picture and acquire at least four second target pixels in a second monitoring picture, wherein one of the first target pixels and one of the second target pixels constitute a pair of target pixels, and the first target pixel and the second target pixel have the same features; Determine a mapping relationship between the first monitoring screen and the second monitoring screen according to the at least four pairs of target pixels; at least three of the at least four first target pixels are not collinear, and at least three of the at least four second target pixels are not collinear; The first monitoring device is a monitoring device with a fixed first monitoring range, and the second monitoring device is a monitoring device with a rotatable second monitoring range; After adjusting the control parameters of the second monitoring device so that the second monitoring range of the second monitoring device includes the first monitoring range, the method further includes: When the second monitoring range of the second monitoring device includes the first monitoring range, determining the horizontal angle, the pitch angle, the horizontal field angle, the vertical field angle, the pixel width and the pixel length of the second monitoring screen of the second monitoring device; According to the mapping relationship, controlling the second monitoring device to be adjusted in linkage with the first monitoring device includes: Determine the deviation angle of the second target pixel from the center position corresponding to the second monitoring screen; According to the deviation angle, an angle parameter of the second monitoring device corresponding to the first target pixel point is obtained; Controlling linkage adjustment of the second monitoring device according to an angle parameter of the second monitoring device corresponding to the first target pixel point on the first monitoring device; Determining a deviation angle between the second target pixel point and the center position corresponding to the second monitoring screen includes: By formula Calculate the horizontal deviation angle of the second target pixel point corresponding to the first target pixel point from the center position corresponding to the second monitoring screen; where p' is the horizontal deviation angle, X 像素 is the horizontal position of the second target pixel, ω is the pixel width of the second target pixel, and γ is the horizontal field angle of the second target pixel; and / or By formula Calculate the vertical deviation angle between the second target pixel point corresponding to the first target pixel point and the center position corresponding to the second monitoring screen; where t' is the vertical deviation angle, Y 像素 is the vertical position of the second target pixel, h is the pixel length of the second target pixel, and δ is the vertical field angle of the second target pixel; According to the horizontal deviation angle, the horizontal angle in the angle parameter of the second monitoring device corresponding to the first target pixel is obtained as p=α+p', wherein α is the horizontal angle of the second monitoring device when the second monitoring range of the second monitoring device includes the first monitoring range; According to the vertical deviation angle, the vertical angle in the angle parameter of the second monitoring device corresponding to the first target pixel point is obtained as t=β+t', wherein β is the pitch angle of the second monitoring device when the second monitoring range of the second monitoring device includes the first monitoring range.
2. The control method of the monitoring device according to claim 1, characterized in that: Determining a mapping relationship between the first monitoring picture and the second monitoring picture according to the at least four pairs of target pixels includes: Determine a relationship between the two-dimensional coordinates of a first target pixel point and the three-dimensional coordinates of a second target pixel point in each pair of target pixels; A mapping relationship matrix is determined according to the relationship expression and the two-dimensional coordinates of the second target pixel point.
3. The control method of the monitoring device according to claim 2, characterized in that: Determining a relationship between the two-dimensional coordinates of a first target pixel point and the three-dimensional coordinates of a second target pixel point in each pair of target pixels includes: Get the two-dimensional coordinates (x i ,y i ) and the three-dimensional coordinates (x′) of the second target pixel of the i-th pair of target pixels i ,y′ i ,z′ i ); According to the two-dimensional coordinates (x i ,y i ) and the three-dimensional coordinates of the second target pixel (x′ i ,y′ i ,z′ i ), through the formula The relationship is: Among them, x′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ) in the horizontal axis, y′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ) in the vertical coordinate, z′ i is the three-dimensional coordinate of the second target pixel (x′ i ,y′ i ,z′ i ), is the mapping relationship matrix, x i is the two-dimensional coordinate of the first target pixel (x i ,y i ) in the horizontal axis, y i is the two-dimensional coordinate of the first target pixel (x i ,y i ) in the vertical axis.
4. The control method of the monitoring device according to claim 3, characterized in that: Determining a mapping relationship matrix according to the relationship and the two-dimensional coordinates of the second target pixel point includes: According to the three-dimensional coordinates (x′ i , y′ i , z′ i ), through the formula and Determine the two-dimensional coordinates of the second target pixel point in the i-th pair of target pixel points as (u i ,v i ); The two-dimensional coordinate (x i ,y i ) and the two-dimensional coordinates of the second target pixel are (u i ,v i ), through the formula Determine the mapping relationship matrix; where a 11 , a 12 , a 13 , a 21 , a 22 , a 23 , a 31 , a 32 and a 33 is the element in the mapping relationship matrix, u i The two-dimensional coordinates of the second target pixel are (u i ,v i ), v i The two-dimensional coordinates of the second target pixel are (u i ,v i ) in the vertical axis.
5. A control device for monitoring equipment, characterized in that: The device comprises: An acquisition module, used to acquire a first monitoring picture of a first monitoring device within a first monitoring range; A processing module, configured to adjust control parameters of a second monitoring device so that a second monitoring range of the second monitoring device includes the first monitoring range, wherein the second monitoring range of the second monitoring device includes the first monitoring range means that: a second monitoring screen within the second monitoring range can contain all screen contents of the first monitoring screen within the first monitoring range; determine a mapping relationship between a first monitoring screen within the first monitoring range and a second monitoring screen within the second monitoring range; and control the second monitoring device to be linked and adjusted with the first monitoring device according to the mapping relationship; Wherein, obtaining a first monitoring screen of a first monitoring device within a first monitoring range includes: Obtaining a stream address of a first monitoring device; obtaining a first real-time video stream of the first monitoring device according to the stream address of the first monitoring device; obtaining a first monitoring screen according to the first real-time video stream; the first monitoring screen is a video screen of the first real-time video stream at a preset time; After obtaining the first monitoring picture of the first monitoring device within the first monitoring range, the method further includes: Obtaining a stream address of a second monitoring device; obtaining a second real-time video stream of the second monitoring device according to the stream address of the second monitoring device, and connecting to a control interface of the second monitoring device; obtaining a second monitoring screen according to the second real-time video stream; the second monitoring screen is a video screen of the second real-time video stream at a preset time; Wherein, determining a mapping relationship between a first monitoring screen within a first monitoring range and a second monitoring screen within a second monitoring range includes: Acquire at least 4 first target pixel points in a first monitoring picture and acquire at least 4 second target pixel points in a second monitoring picture, wherein one of the first target pixel points and one of the second target pixel points constitute a pair of target pixel points, and the first target pixel point and the second target pixel point have the same characteristics; determine a mapping relationship between the first monitoring picture and the second monitoring picture according to the at least 4 pairs of target pixel points; at least 3 of the at least 4 first target pixel points are not collinear, and at least 3 of the at least 4 second target pixel points are not collinear; The first monitoring device is a monitoring device with a fixed first monitoring range, and the second monitoring device is a monitoring device with a rotatable second monitoring range; After adjusting the control parameters of the second monitoring device so that the second monitoring range of the second monitoring device includes the first monitoring range, the method further includes: When the second monitoring range of the second monitoring device includes the first monitoring range, determining the horizontal angle, the pitch angle, the horizontal field angle, the vertical field angle, the pixel width and the pixel length of the second monitoring screen of the second monitoring device; Wherein, according to the mapping relationship, controlling the second monitoring device to be adjusted in linkage with the first monitoring device includes: determining a deviation angle of the second target pixel point from the center position corresponding to the second monitoring screen; obtaining an angle parameter of the second monitoring device corresponding to the first target pixel point according to the deviation angle; and controlling the linkage adjustment of the second monitoring device according to the angle parameter of the second monitoring device corresponding to the first target pixel point on the first monitoring device; Determining a deviation angle between the second target pixel point and the center position corresponding to the second monitoring screen includes: By formula Calculate the horizontal deviation angle of the second target pixel point corresponding to the first target pixel point from the center position corresponding to the second monitoring screen; where p' is the horizontal deviation angle, X 像素 is the horizontal position of the second target pixel, ω is the pixel width of the second target pixel, and γ is the horizontal field angle of the second target pixel; and / or By formula Calculate the vertical deviation angle between the second target pixel point corresponding to the first target pixel point and the center position corresponding to the second monitoring screen; where t' is the vertical deviation angle, Y 像素 is the vertical position of the second target pixel, h is the pixel length of the second target pixel, and δ is the vertical field angle of the second target pixel; According to the horizontal deviation angle, the horizontal angle in the angle parameter of the second monitoring device corresponding to the first target pixel is obtained as p=α+p', wherein α is the horizontal angle of the second monitoring device when the second monitoring range of the second monitoring device includes the first monitoring range; According to the vertical deviation angle, the vertical angle in the angle parameter of the second monitoring device corresponding to the first target pixel point is obtained as t=β+t', wherein β is the pitch angle of the second monitoring device when the second monitoring range of the second monitoring device includes the first monitoring range.
6. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the control method of the monitoring device as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: Instructions are stored, and when the instructions are executed on a computer, the computer executes the control method of the monitoring device according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and apparatus for controlling linkage between ball camera and gun camera, and medium
WO2020182176A1