Control method and device of holder equipment and storage medium
By obtaining the junction coordinates of the gimbal device and planning the rotation configuration group, the problem of inefficient manual configuration of traditional gimbal devices is solved, automatic rotation scanning is realized, and monitoring efficiency is improved.
Patent Information
- Application Number
- CN202411622668.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2024-12-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional gimbal equipment needs to manually configure rotation parameters when monitoring vast areas, resulting in inefficiency and a lot of human resources, especially when the terrain is complex or multiple gimbals need to work together.
By obtaining the coordinates of the junction of the first area and the second area under the coordinate system of the gimbal device, the rotation configuration group of the gimbal device is planned, and the gimbal device is controlled to scan according to the configuration group to realize an automated rotation configuration.
It improves the scanning efficiency of the gimbal equipment, reduces manual operation requirements, improves operating efficiency, and can cover specific areas more efficiently.
Smart Images

Figure CN119165892A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment control, and in particular to a control method, device and storage medium for a pan / tilt device. Background Art
[0002] With the development of modern automation and intelligent technology, the demand for efficient and accurate monitoring and management of specific areas is growing. Especially in application scenarios that require continuous monitoring of a wide area, such as geographic surveying and mapping, environmental monitoring, industrial testing, and safety inspections, traditional manual scanning methods are not only inefficient, but also easily interfered by human factors, resulting in limitations in monitoring quality and coverage.
[0003] To solve this problem, automated pan-tilt devices have attracted widespread attention due to their ability to remotely control and automatically scan specific areas. These devices are usually equipped with high-precision sensors and cameras, and can perform precise rotation and tilt in the horizontal and vertical directions to cover the predetermined monitoring area.
[0004] However, although these PTZ devices provide automated scanning capabilities, in actual operation, users often need to manually configure the rotation parameters, including setting the rotation boundaries to avoid areas of no interest, such as the sky or other non-target areas. This process becomes particularly cumbersome when the terrain is complex or the monitoring area is vast, especially when multiple PTZs are required to work together to cover a larger area. The workload of manual configuration increases significantly, resulting in inefficiency and a large consumption of human resources. Summary of the invention
[0005] In order to solve the above technical problems, the technical solution adopted in this application is: to provide a control method, device and storage medium for a pan-tilt device, so as to at least solve the problem in the related technology that the pan-tilt scanning configuration scheme needs to be manually configured, resulting in low efficiency and consuming a lot of human resources.
[0006] According to an embodiment of the present invention, a method for controlling a pan / tilt device is provided, comprising: Obtaining the coordinates of the intersection point of the first area and the second area in the coordinate system of the pan / tilt device, and obtaining the pan / tilt coordinates of the intersection point; Planning a rotation configuration group of the pan-tilt device based on the pan-tilt coordinates of the intersection point; Control the pan / tilt device to scan the first area or the second area according to the rotation configuration group.
[0007] In order to solve the above technical problems, a technical solution adopted in the present application is: to provide an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, it is used to implement the control method of the pan-tilt device in the above technical solution.
[0008] In order to solve the above technical problems, a technical solution adopted in the present application is: to provide a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, it is used to implement the control method of the pan-tilt device in the above technical solution.
[0009] Through the above scheme, the beneficial effect of the present application is: the control method of the gimbal device provided by the present application obtains the coordinates of the intersection point of the first area and the second area in the coordinate system of the gimbal device to obtain the gimbal coordinates of the intersection point, plans the rotation configuration group of the gimbal device based on the gimbal coordinates of the intersection point, and controls the gimbal device to scan the first area or the second area according to the rotation configuration group; in this way, the rotation configuration group of the gimbal device based on the gimbal coordinates of the intersection point can be automatically planned, and the scanning work of a specific area can be realized more efficiently, thereby reducing the need for manual operation and further improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them: Figure 1 It is a flow chart of an embodiment of a control method of a pan / tilt device provided by the present application; Figure 2 is a simplified schematic diagram of a visible light picture provided by the present application; Figure 3 It is a structural schematic diagram of calculating angle difference provided by the present application; Figure 4 It is a flow chart of another embodiment of the control method of the pan / tilt device provided by the present application; Figure 5 A schematic diagram of a skyline image provided by the present application; Figure 6 A schematic diagram of the positional relationship between a skyline and a straight line provided for this application; Figure 7 Another schematic diagram of the positional relationship between a skyline and a straight line provided for this application; Figure 8 It is a flowchart of a planning method for a horizontal rotation configuration group provided by the present application; Fig. 9 is a structural schematic diagram of an embodiment of an electronic device provided by the present application; Fig.10 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0011] The present application is further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present application, but are not intended to limit the scope of the present application. Similarly, the following examples are only some embodiments of the present application rather than all embodiments, and all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0012] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0013] It should be noted that the terms "first", "second", etc. in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second", etc. can explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0014] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a control method for a pan / tilt device provided in the present application. It should be noted that if there are substantially the same results, this embodiment is not limited to Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes: S110: Acquire the coordinates of the intersection point between the first area and the second area in the coordinate system of the gimbal device, and obtain the gimbal coordinates of the intersection point.
[0015] In the application of pan-tilt devices, such as environmental monitoring, security monitoring or geographic mapping, specific operations or analyses may be required for different areas. The first area and the second area refer to two different spatial areas divided within the monitoring or scanning range of the pan-tilt device. The set of intersection points of the first area and the second area is the boundary line between the first area and the second area, so that specific areas can be explored according to actual needs to achieve more precise control, monitoring or analysis.
[0016] In one example, in the application scenario of forest fire monitoring, the scanning area is divided into the sky area and the ground area. The ground area is where the fire may occur, while the sky area is an area of no interest. By distinguishing these two areas, false alarms can be reduced and the accuracy and efficiency of fire monitoring can be improved. The boundary formed by the sky area and the ground area, that is, the skyline, is an important feature that needs special attention during the monitoring process. The location of the skyline can help determine the key areas for fire monitoring and can be used to assist in the location and analysis of fires.
[0017] In another example, urban buildings can also be monitored for abnormal situations, and the scanning area can be divided into building areas and non-building areas. The building areas are where abnormal situations may occur, while the non-building areas do not need to be focused on.
[0018] In addition, in practical applications, the scanning area can be divided into three or more areas, and different scanning items and monitoring indicators can be set for different areas to meet diverse project requirements.
[0019] In one embodiment, the preset areas that the gimbal device needs to scan are taken as the first area and the second area. A visible light image of the preset area captured by the gimbal device is obtained, wherein the preset area includes the intersection point of the first area and the second area, the intersection point of the first area and the second area in the visible light image is identified, and the coordinates of the intersection point in the visible light image are converted to the gimbal coordinates of the intersection point. Since the converted gimbal coordinates of the intersection point provide a precise way to locate the position of the intersection point in the real world, by converting the coordinates of the intersection point from a two-dimensional image to a gimbal coordinate system, the automatic control system of the gimbal device can automatically adjust the position of the gimbal device or perform tasks such as scanning in a specified area based on these precise coordinates, thereby reducing manual intervention.
[0020] In one example, a visible light camera of a gimbal is used to capture an image of a preset area. Preferably, the lens magnification of the visible light channel is set to 1x, i.e., the widest angle state of the lens, so that all details of the boundary between the first area and the second area are displayed in the captured visible light image as much as possible to facilitate subsequent identification and analysis.
[0021] An image processing algorithm is executed to identify the boundary between the first area and the second area. For example, edge detection, color segmentation and other techniques are used to process the visible light image. In the processed image, the intersection points of the first area and the second area are detected, and the pixel coordinates of these intersection points in the image are obtained.
[0022] There are many types of coordinate systems for gimbal devices, such as PT coordinate system, spherical coordinate system, pixel coordinate system, geodetic coordinate system, and gimbal attitude angle coordinate system, etc., which play a key role in the operation and control of gimbal devices.
[0023] Based on the coordinates of the intersection point in the visible light image and the parameters of the gimbal device when collecting the visible light image, calculate the deviation coordinates of the intersection point relative to the center of the optical axis of the current gimbal device; calculate the angular difference of the intersection point relative to the center of the optical axis based on the deviation coordinates; map the angular difference of the intersection point to the coordinate system of the gimbal device to obtain the gimbal coordinates of the intersection point.
[0024] Taking the PT coordinate system of the PT device as the PT coordinate system, the PT coordinates of the intersection of the first area and the second area are calculated as an example. The intersection point is mapped to the PT coordinate system through the coordinates of the intersection point in the visible light image, combined with the PT coordinates of the current PT device and the visible light field of view of the PT device, to obtain the PT coordinates of the intersection point.
[0025] For example, for any intersection point A (x, y) in the visible light image, the deviation coordinates Δx and Δy of A relative to the optical axis center of the gimbal device are calculated. Figure 2 and Figure 3 , Figure 2 is a simplified schematic diagram of a visible light image provided by this application, Figure 3 1 is a schematic diagram of a structure for calculating an angle difference provided by the present application. As shown in the figure, the horizontal deflection angle α and the vertical deflection angle β of point A relative to the center of the optical axis are calculated by the following formulas (1) and (2).
[0026] α = arcsin(Δx * w / (2 * sinθ)) (1) β = arcsin(Δy * w / (2 * sinθ)) (2) Among them, w is the visible light image resolution width, θ is half of the horizontal field of view, Δx is the deviation coordinate of point A in the horizontal direction relative to the center of the optical axis, and Δy is the deviation coordinate of point A in the vertical direction relative to the center of the optical axis.
[0027] The angle difference (α, β) of the intersection point A relative to the center of the optical axis is calculated, and the angle difference is further superimposed on the PT coordinates (P0, T0) of the current gimbal to obtain the position (P, T) of the intersection point A in the PT coordinate system, where P = P0+α; T = T0+β.
[0028] The above method can be used to convert the coordinates of the intersection point of the first area and the second area in the visible light image into coordinates in the coordinate system of the gimbal device to obtain the gimbal coordinates of the intersection point. In addition, the present application can also convert the intersection point in the image image into other types of coordinate systems of the gimbal device to obtain the gimbal coordinates of the intersection point, which is not limited here.
[0029] S120: Planning a rotation configuration group of the gimbal device based on the gimbal coordinates of the intersection point.
[0030] When performing scanning tasks, the PTZ device can cover a specific monitoring area by precisely controlling its horizontal (Pan) and vertical (Tilt) rotation. Whether scanning line by line in the horizontal or vertical direction, a specific area can be carefully monitored. The scanning direction of the PTZ device is determined according to monitoring requirements. It can be horizontal or vertical, or other preset directions set manually.
[0031] The PTZ device is equipped with a scanning module, such as a thermal imager. Since the scanning module needs to perform precise scanning in a specific direction, a smaller field of view can provide higher resolution and more detailed scanning results. Therefore, the scanning module usually has a smaller field of view than a visible light lens. When performing a scanning task, the PTZ device can rotate horizontally or scan vertically based on the visible light image to determine the two boundary lines of the scanning area in the first direction or the second direction.
[0032] In one embodiment, two boundary lines of a scanning area of the gimbal device in a first direction are determined, and the scanning area is the first area or the second area; the area between the two boundary lines is divided along the first direction to obtain at least one second direction rotation path, wherein the second direction is perpendicular to the first direction.
[0033] In one example, the first direction is a vertical direction and the second direction is a horizontal direction, the two boundary lines of the scanning area in the first direction are two horizontal lines, defining the upper and lower boundaries of the scanning area, and dividing the area between the two horizontal boundaries along the vertical direction to obtain at least one horizontal rotation path.
[0034] The number of final horizontal rotation paths is determined according to the relationship between the area between the two boundary lines and the field of view angle of the scanning module of the pan-tilt device. If the field of view angle of the scanning module in the first direction can cover the area between the two boundary lines, the area between the two boundary lines is used as the rotation path of the pan-tilt device; if the field of view angle of the scanning module in the first direction cannot completely cover the area between the two boundary lines, the area between the two boundary lines is divided along the first direction based on the field of view angle of the scanning module in the first direction to obtain at least two second direction rotation paths, wherein the set of at least two second direction rotation paths can completely cover the scanning area.
[0035] In another example, the first direction may also be a horizontal direction, and the second direction may be a vertical direction. Then, the two boundary lines of the scanning area in the first direction are two vertical lines, defining the left and right boundaries of the scanning area, and the area between the two vertical boundaries is divided along the horizontal direction to obtain at least one vertical rotation path. The specific division method and the number of divisions are similar to the previous example and will not be described in detail here.
[0036] It should be noted that, whether it is a horizontal rotation path or a vertical rotation path, when there are multiple of them, these rotation paths can be set to overlap in some areas, or each rotation path can be spliced, but ultimately the set of at least two rotation paths must be able to completely cover the scanning area.
[0037] Based on the pan / tilt coordinates of the intersection point on the second direction rotation path, a scanning path of the pan / tilt coordinates on the second direction rotation path is determined to obtain a rotation configuration group of the pan / tilt coordinates.
[0038] In one embodiment, based on the positional relationship between the line connecting the intersection points and a boundary of the rotation path in the first direction, a set of gimbal coordinates of the scanning area on the second direction rotation path in the coordinate system of the gimbal device is determined and used as the scanning path on the second direction rotation path.
[0039] Since the first area and the second area may be irregular areas, in multiple rotation paths, the entire rotation path may be or may not be a scanning area, and a rotation path may have multiple segmented scanning paths. For each segmented path determined as a scanning area, its gimbal coordinate set in the gimbal device coordinate system is calculated.
[0040] In one example, assuming that the scanning area is the second area, a boundary of the rotation path in the first direction is the lower boundary, and the portion above the line connecting the intersection points is the first area, and the portion below the line connecting the intersection points is the second area.
[0041] If there is no or only one intersection between a boundary in the first direction of the current rotation path and the line connecting the intersection points, and the line connecting the intersection points is always located above the lower boundary of the rotation path, indicating that there is always a second area in the second direction in the rotation path, then it is determined that the entire area of the current rotation path is the scanning area, and the gimbal coordinate set is the gimbal coordinates of the left boundary and the right boundary of the rotation path and the gimbal coordinates of the current gimbal, etc.
[0042] If there is no or only one intersection point between a boundary in the first direction of the current rotation path and the line connecting the intersection points, and the line connecting the intersection points is always located below the lower boundary of the rotation path, it means that there is no second area in the second direction in the rotation path, and it is determined that the entire current rotation path does not need to be scanned.
[0043] If there are more than one intersection points between a boundary in the first direction of the current rotation path and the line connecting the intersection points, the scanning area on the second direction rotation path is determined based on the positional relationship between the intersection point corresponding to the midpoint between adjacent intersection points and a boundary in the first direction of the rotation path. Exemplarily, if the intersection point corresponding to the midpoint between adjacent intersection points is located below a boundary in the first direction of the rotation path, it means that the line connecting the intersection points in the section between adjacent intersection points is located below the lower boundary of the rotation path, further indicating that the section area is the first area, i.e., the non-scanning area; if the intersection point corresponding to the midpoint between adjacent intersection points is located above a boundary in the first direction of the rotation path, it means that the line connecting the intersection points in the section between adjacent intersection points is located above the lower boundary of the rotation path, further indicating that the section area is the second area, i.e., the scanning area, and the gimbal coordinates of the adjacent intersection points and the gimbal coordinates of the current gimbal are recorded.
[0044] All intersections on all rotation paths are traversed, and the pan-tilt coordinate set of the scanning area in the coordinate system of the pan-tilt device is recorded as the scanning path on the second direction rotation path. In this way, a rotation configuration group of all scanning areas of the pan-tilt device in the preset area is planned, so as to control the pan-tilt device to scan the first area or the second area according to the rotation configuration group.
[0045] S130: Control the pan / tilt device to scan the first area or the second area according to the rotation configuration group.
[0046] The PTZ device has multiple scanning modes, and different modes can meet different application scenarios and monitoring requirements, and perform efficient and intelligent monitoring and scanning. After obtaining the rotation configuration group of the preset area, the PTZ device can be controlled to scan the first area or the second area based on the rotation configuration group through preset points, pattern scanning, cruise scanning, automatic scanning, vertical scanning or panoramic scanning.
[0047] The pan-tilt device is equipped with a scanning module, and the scanning module of the pan-tilt device is controlled to scan the first area or the second area. In one example, the scanning module is a thermal imager, and the pan-tilt device is equipped with a thermal imager. Since the thermal imager can passively receive the infrared thermal radiation of the target itself and does not require an external light source, it can work normally at night or in adverse weather conditions (such as rain, fog, smoke, etc.), and can also capture information that traditional visible light cameras cannot capture, such as weak thermal radiation or objects hidden in the shadows, so that the pan-tilt device can adapt to more complex monitoring needs and perform more effective monitoring and scanning work.
[0048] In one embodiment, the thermal imager configured on the pan / tilt device is controlled to scan the first area or the second area according to the rotation configuration group. Through the above step S120, it can be obtained that the rotation configuration group records the path to be scanned in the first area or the second area, and the thermal imager is controlled to scan when passing through the scanning path; preferably, the thermal imager is controlled to run quickly when passing through the non-scanning path, and the thermal imager's baffle is closed to avoid unnecessary pan / tilt centering or lens burns caused by targets such as the sun.
[0049] To better illustrate the technical solution of the present application, an application scenario of using a pan-tilt head to monitor fire conditions in the field of forest fire prevention is provided below, and the rotation configuration group is exemplified by taking the configuration of a horizontal rotation group as an example.
[0050] Since any object with a temperature above absolute zero will radiate infrared light, and the higher the temperature, the higher the infrared intensity, thermal imaging technology can be used to monitor fire points. The thermal imaging fire detection PTZ currently used in the field of forest fire prevention is generally equipped with cameras with two channels, visible light and thermal imaging. The visible light channel is a variable-magnification lens, while the thermal imaging channel is generally a fixed-focus lens.
[0051] In the field of forest fire prevention, a fire prevention PTZ needs to monitor a wide area (usually up to 3 to 5 km), so its thermal imaging lens focal length is generally large, and the corresponding field of view is much smaller than that of the visible light channel. In order to maximize the fire detection area, users use a lens with a small field of view to scan an area within 5 km, and generally configure the fire detection function in conjunction with the horizontal rotation function of the PTZ.
[0052] In the process of realizing automatic horizontal rotation configuration, users need to manually configure each circle of horizontal rotation according to the scanning area. Taking into account the changes in terrain height, some horizontal rotations also need to be configured with corresponding left and right boundaries to avoid areas of no interest (such as the sky). The operation is relatively cumbersome. When multiple gimbals work together to scan a large area, they need to be manually configured one by one, which is very labor-intensive.
[0053] Specifically, see Figure 4 , Figure 4 FIG. 1 is a flow chart of another embodiment of the control method of the pan / tilt device provided in the present application. It should be noted that if there are substantially the same results, this embodiment is not limited to the above. Figure 4 The process sequence shown is limited. Figure 4 As shown, this embodiment includes: S201: PTZ equipment initialization.
[0054] When starting the automatic configuration, the system first initializes the PTZ device. For example, the system controls the PTZ device to be located at a preset reference point, which can usually be set to (0,0), which represents the origin of the coordinate system of the PTZ device and represents the initial position of the PTZ device. This initial position ensures that all subsequent movements and scans can be based on this known starting point.
[0055] To monitor the fire, it is necessary to capture as many details of the interface between the sky and the ground as possible in the monitoring scene. Preferably, the lens zoom of the visible light channel of the PTZ device is set to 1x, that is, the widest angle state of the lens, so that when the PTZ device is stationary, the most skyline information can be obtained in the vertical direction, and the movement of the PTZ device in the T-axis (i.e., the vertical axis) direction can be minimized to obtain a wider field of view.
[0056] S202: Analyze the visible light image currently collected by the PTZ device to obtain the coordinates of the intersection point between the sky area and the ground area in the visible light image.
[0057] After the gimbal device is initialized and the parameters of the visible light lens are set, the skyline analysis algorithm is executed on the currently collected visible light image to obtain the coordinates of the intersection point of the sky area and the ground area in the visible light image. Among them, skyline analysis is an image processing technology that can identify and analyze the boundary area between the sky and the ground in the image. This algorithm usually involves image segmentation technology to distinguish the sky and the ground based on color, brightness or texture features.
[0058] In one example, see Figure 5 , Figure 5 The present application provides a schematic diagram of a skyline image. After the PTZ device rotates to a preset reference point, the intelligent analysis algorithm is called to obtain an identification matrix based on the current visible light image collected by the PTZ device, which is used to distinguish the sky area from the ground area in the visible light image. The value of the element in the matrix is 0 for the sky area, and 1 for the ground area. After obtaining the identification matrix, the intersection point of the sky area and the ground area is searched column by column in the matrix, and the pixel coordinates of the intersection point are obtained to obtain the coordinates of the intersection point of the sky area and the ground area in the visible light image.
[0059] S203: Convert the coordinates of the intersection point in the visible light image into coordinates in the PT coordinate system to obtain the PT coordinates of the intersection point.
[0060] In the control of the gimbal device, the PT coordinate system is used to specify the rotation position of the gimbal. P and T refer to the horizontal (Pan) coordinate and vertical (Tilt) coordinate of the gimbal respectively. These two coordinate values define the position of the gimbal in the horizontal and vertical directions, so that the gimbal can accurately point to a specific target or area.
[0061] In one embodiment, the intersection point is mapped to the PT coordinate system by the coordinates of the intersection point in the visible light image, combined with the PT coordinates of the current PT device and the visible light field of view of the PT device, to obtain the PT coordinates of the intersection point. The specific method of converting the coordinates of the intersection point can be found in S110 above, which will not be repeated here.
[0062] S204: Obtain the PT coordinates of the complete skyline and stitch the complete skyline.
[0063] Through step S203, the PT coordinates of all the intersection points in the current visible light image are collected, and all the calculated (P, T) coordinate points are connected to form a continuous line to generate a skyline in the PT coordinate system to piece together the complete skyline in the front-scanning area.
[0064] After completing the calculation of the skyline coordinates of a picture, control the gimbal device to rotate a preset angle, such as 1 degree or other preset values, to ensure that the entire 360-degree range is covered. Repeat the above step S203 to perform the calculation again, and calculate the skyline PT coordinates for the picture captured at the new position. Continue to rotate the gimbal device, repeating step S203 after each rotation until a full circle of rotation is completed. After each rotation, add the newly calculated PT coordinates of the intersection point to the total skyline PT coordinate set. Gather the skyline PT coordinates at all rotation positions to obtain a PT coordinate set of the complete skyline within a 360-degree range, and connect all the PT coordinate points in the set to form a complete skyline.
[0065] S205: Planning a horizontal rotation configuration group of the PT device based on the PT coordinates of the complete skyline.
[0066] 1. Determine the highest point T of the skyline top .
[0067] Traverse the T coordinates (i.e. vertical coordinates) of all PT coordinates of the skyline and select the point with the largest T coordinate as the T top , find the highest point T of the skyline top .
[0068] 2. Calculate the lower boundary of the current rotation path.
[0069] Starting from the highest point of the skyline, according to the vertical field of view (fovV) of the thermal imaging lens, the T value T corresponding to the lower edge of the field of view when the upper edge of the field of view of the thermal imaging lens is exactly at the highest point of the skyline is calculated in the PT coordinate system based on the following formula (3) (subsequent operations are all implemented in the PT coordinate system and are no longer emphasized in this embodiment). img , which is the lower boundary of the current rotation path.
[0070] T img = T top -fov V (3) 3. Calculate and count the skyline curve and straight line T=T in the current rotation path img The set S of all intersection points of .
[0071] The skyline is composed of a series of intersection points. The intersection points of the skyline and the line can be calculated by the following method: traverse all the intersection points from large to small according to the coordinates of P. If a point a and its adjacent point b are on both sides of the line T, then it is considered that the ab segment of the skyline has an intersection with the line T. Assume that a(P a , T a ), b(P b , T b ), calculate the equation Y of the straight line ab between points a and b using the following formula (4).
[0072] (T b -T a ) / (P b -P a ) X + T a -P a *(T b -T a ) / (P b -P a ) = Y(4) When the equation Y of line ab is equal to the equation of line T, that is, Y=T img , the intersection point (X, Y) with the target straight line T can be calculated using the following formulas (5) and (6).
[0073] X = (T img – T a + P a * (T b -T a ) / (P b -P a ) ) (P b -P a ) / (T b -T a )(5) Y=T img (6) 4. Plan the horizontal rotation configuration of the current rotation path of the PTZ device.
[0074] If the number of intersections in set S is less than 2, it is necessary to determine the skyline and line T img The positional relationship between determines the horizontal rotation configuration of the current rotation path. Figure 6 , Figure 6 A schematic diagram of the positional relationship between a skyline and a straight line is provided for this application. As shown in the figure, if the skyline is above the straight line, it means that the horizontal direction is basically the ground, and configuring the current rotation path requires the pan-tilt device to perform a full circle scan.
[0075] See also Figure 7 , Figure 7 Another schematic diagram of the position relationship between a skyline and a straight line provided in this application. If the number of intersections in the set S is greater than or equal to 2, then traverse each intersection, calculate the midpoint between it and the next intersection, and determine the skyline corresponding to the midpoint position and the straight line T img The positional relationship between them is determined, and the section that needs to be scanned in the current rotation path is determined based on the judgment result to plan the horizontal rotation configuration of the current rotation path of the pan / tilt device.
[0076] ① If the position of the skyline here is on the straight line T img Above, configure the PTZ device to scan the area corresponding to the segment, for example Figure 7 The Rotation 1 and Rotation 2 sections in ; ② If the position of the skyline here is on the straight line T img If the PTZ device is configured to scan the area corresponding to this segment, for example Figure 7 From the end position of rotation 1 to the start position of rotation 2; ③ Since the P direction of the gimbal is connected end to end, when traversing each intersection, it is necessary to traverse in a circular manner with the end to end connected. Therefore, the first intersection and the last intersection need to be specially judged. For example, the first intersection is judged at the midpoint with P=0, and the last intersection is judged at P=360.
[0077] After obtaining the area to be scanned based on the intersection, the horizontal rotation path corresponding to the area is calculated based on the field of view of the thermal imaging lens. For example, assuming that the horizontal field of view of the thermal imaging lens is fovH, the current P coordinate of the gimbal device is P0, and the highest point of the skyline is T top The corresponding P coordinate is P top .
[0078] The left boundary P value (P_left) and the right boundary P value (P_right) can be calculated by the following formula (7): P_left=P top – fovH / 2;P_right =P top + fovH / 2 (7) In this way, the scanning range that the PTZ device needs to rotate in the horizontal direction is from P_left to P_right. The data such as the T position, left boundary P value and right boundary P value of the PTZ device in the current rotation path are recorded to obtain the horizontal rotation configuration of the current rotation path.
[0079] 5. Traverse all rotation paths and plan the horizontal rotation configuration group of the gimbal device.
[0080] Based on the vertical field of view (fovV) of the thermal imaging lens, all T img , and repeat the above steps 3 and 4 to obtain all horizontal rotation configuration sets, that is, to plan the horizontal rotation configuration group of the pan-tilt device.
[0081] S206: Control the thermal imager to scan according to the horizontal rotation configuration group.
[0082] After obtaining the horizontal rotation configuration group of the pan / tilt device, the thermal imager can be controlled to perform scanning work on the specified path according to the horizontal rotation configuration group.
[0083] Preferably, when the pan / tilt head switches between horizontal rotation paths, Figure 7 From left to right, rotation 1 and rotation 2 represent the scanning area in the rotation path, and the position from the end of rotation 1 to the beginning of rotation 2 is the non-scanning area in the rotation path. When scanning the non-scanning area, it runs at a faster speed and the thermal imaging shield is closed during the process to avoid unnecessary gimbal centering or lens burns caused by targets such as the sun.
[0084] In the above step S205, to better illustrate the planning method of the horizontal rotation configuration group of the pan / tilt device of the present application, please refer to Figure 8 , Figure 8 This is a flow chart of a planning method for a horizontal rotation configuration group provided by this application: (1) Get the T coordinate value T of the vertex of the skyline top , according to the vertical field of view fov of thermal imaging V Calculate the upper boundary of the screen T = T top When the T coordinate value corresponding to the lower boundary of the screen is T img .
[0085] (2) Configure the lower limit T of the PTZ device scanning T value bottom , usually the lower limit of the entire scanning area is set according to the actual situation of the detection area.
[0086] (3) Determine the T coordinate value T corresponding to the lower boundary of the screen img The lower limit T of the T value scanned by the PTZ device bottom relationship.
[0087] If at this time T img Less than T bottom , indicating that the lower boundary of the field of view of the current thermal imaging screen has been able to cover the lower edge of the scanning area, ending the current planning process.
[0088] If at this time T img Greater than T bottom , calculate T img The set S of intersection points with the skyline curve and the number of intersection points Num go to the following step (4).
[0089] (4) Based on the number of intersection points Num, determine whether the current rotation path can be directly planned or partially planned as a scanning area.
[0090] ①When Num=0 or Num=1, further determine the T coordinate value T corresponding to the lower boundary of the current screen img Is it below the skyline: If T img If the current rotation path is below the skyline, it is determined that all the areas that need to be monitored need to be planned as scanning areas, thereby generating a 360-degree horizontal rotation configuration; if T img If it is above the skyline, it is determined that the current rotation path is in the sky area and no monitoring is required.
[0091] Control the PTZ device to move to the next horizontal rotation path. In this example, take half of the vertical field angle of the thermal image as the gradient, subtract the T value corresponding to half of the vertical field angle of the thermal image from the T value corresponding to the lower boundary of the current image, and obtain the lower boundary of the image for the next horizontal rotation path, and return to the aforementioned step (3).
[0092] ② When Num=0 or Num=1 is not true, that is, when the number of intersections Num is greater than or equal to 2, traverse each intersection S(i) in the set of intersections S and obtain the skyline T coordinate T of the midpoint between S(i) and S(i+1) mid , where i is a positive integer.
[0093] Further judgement of T mid The T coordinate value T corresponding to the lower boundary of the current screen img position relationship.
[0094] A. If T mid In T img Next, skip the current intersection S(i), set i=i+1, return each intersection S(i) in the set S of traversed intersections, and obtain the skyline T coordinate T of the midpoint between S(i) and S(i+1).mid , and the step of determining the positional relationship between the midpoint of the next intersection point S(i) and S(i+1) and the skyline; B. If T mid In T img If the P coordinate difference between S(i) and S(i+1) is less than or equal to the horizontal field of view fovH of the thermal imaging, then skip the current intersection point S(i), set i=i+1, return each intersection point S(i) in the set S of traversed intersection points, and obtain the skyline T coordinate T of the midpoint between S(i) and S(i+1). mid , and the step of determining the positional relationship between the midpoint of the next intersection point S(i) and S(i+1) and the skyline; C. If T mid In T img If the P coordinate difference between S(i) and S(i+1) is greater than the horizontal field of view fovH of the thermal imaging, then according to the current T mid , the P coordinate difference of S(i) and S(i+1) and the horizontal field of view fovH plan to generate a horizontal rotation configuration. The specific planning generation method has been described in detail in the above step S205 and will not be repeated here. Control the PTZ device to move to the next horizontal rotation path. In this example, half of the vertical field of view of the thermal imaging is used as the gradient. The T value corresponding to the lower boundary of the current screen is subtracted from the T value corresponding to half of the vertical field of view of the thermal imaging to obtain the lower boundary of the screen of the next horizontal rotation path, and return to the above step (3).
[0095] Execute the above steps in sequence until T img Less than T bottom , indicating that the lower boundary of the field of view of the current thermal imaging screen has been able to cover the lower edge of the scanning area, ending the current planning process.
[0096] Through the technical solution of the above embodiment, it is possible to realize the automatic planning of the rotation configuration group of the scanning area of the pan-tilt device, and more efficiently realize the scanning work of a specific area, thereby reducing the need for manual operation and further improving work efficiency.
[0097] See also Fig. 9 , Fig. 9 It is a structural diagram of an embodiment of an electronic device provided in the present application. The electronic device 60 includes a memory 61 and a processor 62 connected to each other. The memory 61 is used to store a computer program. When the computer program is executed by the processor 62, it is used to implement the control method of the pan-tilt device in the above embodiment.
[0098] The above-mentioned method is an embodiment, which can exist in the form of a computer program. Therefore, the present application proposes a computer-readable storage medium. Fig.10 , Fig.10It is a structural diagram of an embodiment of a computer-readable storage medium provided in the present application. The computer-readable storage medium 80 is used to store a computer program 81, which can be executed to implement the control method of the pan-tilt device in the above embodiment.
[0099] The computer-readable storage medium 80 may be a server, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which may store program codes.
[0100] The above description is only an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for controlling a pan / tilt device, It is characterized in that include: Obtaining the coordinates of the intersection point of the first area and the second area in the coordinate system of the pan / tilt device, and obtaining the pan / tilt coordinates of the intersection point; Planning a rotation configuration group of the pan-tilt device based on the pan-tilt coordinates of the intersection point; Control the pan / tilt device to scan the first area or the second area according to the rotation configuration group.
2. The method according to claim 1, It is characterized in that The step of acquiring the coordinates of the intersection point of the first area and the second area in the coordinate system of the pan / tilt device to obtain the pan / tilt coordinates of the intersection point includes: Acquire a visible light image of a preset area collected by the PTZ device, wherein the preset area includes a junction point between the first area and the second area; Identifying a boundary point between the first area and the second area in the visible light picture; The coordinates of the intersection point in the visible light picture are converted into the pan / tilt coordinates of the intersection point.
3. The method according to claim 2, It is characterized in that The step of converting the coordinates of the intersection point in the visible light picture into the pan / tilt coordinates of the intersection point comprises: Calculate the deviation coordinates of the intersection point relative to the center of the optical axis of the current pan-tilt device based on the coordinates of the intersection point in the visible light picture and the parameters of the pan-tilt device when collecting the visible light picture; Calculate the angular difference of the intersection point relative to the center of the optical axis based on the deviation coordinates; The angle difference of the intersection point is mapped to the coordinate system of the gimbal device to obtain the gimbal coordinates of the intersection point.
4. The method according to claim 1, It is characterized in that The step of planning a rotation configuration group of the pan-tilt device based on the pan-tilt coordinates of the intersection point includes: Determine two boundary lines of a scanning area of the PTZ device in a first direction, the scanning area being the first area or the second area; Dividing the area between the two boundary lines along the first direction to obtain at least one second direction rotation path, where the second direction is perpendicular to the first direction; Based on the pan / tilt coordinates of the intersection point on the second direction rotation path, a scanning path of the pan / tilt coordinates on the second direction rotation path is determined to obtain a rotation configuration group of the pan / tilt coordinates.
5. The method according to claim 4, It is characterized in that The controlling the pan / tilt device to scan the first area or the second area according to the rotation configuration group includes: The pan-tilt device is configured with a scanning module, and the scanning module of the pan-tilt device is controlled to scan the first area or the second area; The step of dividing the area between the two boundary lines along the first direction to obtain at least one second direction rotation path includes: If the field of view angle of the scanning module in the first direction can cover the area between the two boundary lines, the area between the two boundary lines is used as the rotation path of the pan / tilt device; If the field of view angle of the scanning module in the first direction cannot completely cover the area between the two boundary lines, the area between the two boundary lines is divided along the first direction based on the field of view angle of the scanning module in the first direction to obtain at least two second direction rotation paths, and the set of the at least two second direction rotation paths completely covers the scanning area.
6. The method according to claim 4, It is characterized in that The determining, based on the pan / tilt coordinates of the intersection point on the second direction rotation path, a scanning path of the pan / tilt coordinates on the second direction rotation path comprises: Based on the positional relationship between the line connecting the intersection points and a boundary in the first direction of the rotation path, the gimbal coordinate set of the scanning area on the second direction rotation path in the coordinate system of the gimbal device is determined and used as the scanning path on the second direction rotation path.
7. The method according to claim 6, It is characterized in that The method further comprises: determining a set of pan-tilt coordinates of a scanning area on the second direction rotation path in a coordinate system of the pan-tilt device based on a positional relationship between a line connecting the intersection points and a boundary in the first direction of the rotation path, and using the set as a scanning path on the second direction rotation path; If there is more than one intersection point between a boundary in the first direction of the current rotation path and a line connecting the intersection points, determining a scanning area on the rotation path in the second direction based on a positional relationship between the intersection point corresponding to a midpoint between adjacent intersection points and a boundary in the first direction of the rotation path; A pan-tilt coordinate set of the scanning area in the coordinate system of the pan-tilt device is recorded as a scanning path on the second direction rotation path.
8. The method according to claim 1, It is characterized in that The pan-tilt device is configured with a thermal imager, and controlling the pan-tilt device to scan the first area or the second area according to the rotation configuration group includes: The rotation configuration group records the scanning path in the first area or the second area; Controlling the thermal imager to scan when passing through the scanning path; The thermal imager is controlled to run quickly when passing through a non-scanning path, and a baffle of the thermal imager is closed.
9. An electronic device, It is characterized in that The electronic device includes a processor and a memory, wherein the processor is coupled to the memory, and the processor is configured to execute one or more steps of the control method of the pan-tilt device according to any one of claims 1 to 8 based on instructions stored in the memory.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the control method of the pan-tilt head device according to any one of claims 1 to 8.
Citation Information
Patent Citations
Cloud desk operation method and system for cross-domain video cascading system
CN104699120A
Dynamic planning method and system for full-section scanning path
CN110672608A
Target positioning method and device based on gunlock and pan-tilt camera linkage
CN116977443A
Control method and device of holder equipment and medium
CN117670919A
Point cloud scanning method and system
CN117948952A
Cited By
Holder preset point configuration method, electronic equipment and storage medium
CN119851107A
