Gimbal deviation detection method, device, equipment and readable storage medium

By determining the direction of the traffic flow in the video stream and comparing the deflection angle with the reference traffic flow direction, the problem that traditional detection algorithms are prone to misjudgment when environmental and weather changes is solved, and the accuracy of gimbal offset detection is improved.

CN114339211BActive Publication Date: 2025-03-25WELLTRANS O&E CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111652798.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-03-25
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

In the prior art, it is easy to misjudgment to detect whether there is a deviation between the actual position of the gimbal and the preset position through traditional detection algorithms, especially when the environment and weather changes.

Method used

By acquiring the video stream collected by the camera within the preset period, determining the direction of movement of the vehicle in the detection area in the video stream, and determining whether there is an offset in the gimbal based on the deflection angle between the traffic direction and the reference traffic direction.

Benefits of technology

This method uses the deflection angle between the direction of the traffic flow and the reference traffic flow direction as the judgment reference, avoiding misjudgment caused by factors such as environment and weather, and improving the accuracy of the gimbal offset detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114339211B_ABST
    Figure CN114339211B_ABST
Patent Text Reader

Abstract

The present invention provides a pan-tilt offset detection method, device, equipment and readable storage medium. The method comprises: obtaining a video stream collected by a camera within a preset time period, the camera being carried by a pan-tilt; determining the movement direction of a vehicle in a detection area in the video stream; determining the direction of traffic flow according to the movement direction of the vehicle in the detection area in the video stream; when the deflection angle between the traffic flow direction and the reference traffic flow direction is greater than a first threshold, determining that the pan-tilt offset is relative to a preset position. Through the present invention, the deflection angle between the traffic flow direction and the reference traffic flow direction is used as a judgment reference, thereby avoiding misjudgment caused by factors such as the environment and weather; and using the reference traffic flow direction as a reference, even if the pan-tilt offsets the preset position at the beginning of shooting, the deflection angle between the traffic flow direction and the reference traffic flow direction can be used to judge whether the pan-tilt offsets relative to the preset position; thereby improving the accuracy of pan-tilt offset detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video surveillance technology, and in particular to a pan / tilt offset detection method, device, equipment and a readable storage medium. Background Art

[0002] In order to quickly and accurately locate the target point in the video surveillance system, it is necessary to adopt the preset positioning method for the PTZ camera system. The monitoring personnel will aim the camera carried by the PTZ at the target monitoring area in advance, and set the PTZ position at this time to the preset position. When it is necessary to monitor the target monitoring area, it is only necessary to send a command to the PTZ control system to quickly locate the PTZ to the preset position, so that the target monitoring area can be monitored through the camera carried by the PTZ.

[0003] However, due to the mechanical gear spacing of the drive motor, the accuracy of the machine structure or belt transmission, when the pan / tilt runs for a long time, the accumulation of deviations will cause a deviation between the actual position of the pan / tilt and the preset position, resulting in a difference between the area actually monitored by the camera and the target monitoring area. Therefore, in order to ensure the quality of monitoring, it is necessary to detect whether there is a deviation between the actual position of the pan / tilt and the preset position.

[0004] Traditional detection algorithms generally detect whether there is a deviation between the actual position of the PTZ and the preset position by comparing the real-time frame captured by the camera with the historical frame. This method is prone to misjudgment. For example, when there is no deviation between the actual position of the PTZ and the preset position, the real-time frame and the historical frame are different due to changes in tree shadows or weather changes. In this case, the detection result output by the traditional detection algorithm is that there is a deviation between the actual position of the PTZ and the preset position; or, when the actual position of the PTZ has deviated from the preset position at the beginning of shooting, if the real-time frame captured subsequently is consistent with the historical frame captured at the beginning of shooting, the detection result output by the traditional detection algorithm is that there is no deviation between the actual position of the PTZ and the preset position. Summary of the invention

[0005] The main purpose of the present invention is to provide a gimbal deviation detection method, device, equipment and readable storage medium, aiming to solve the technical problem in the prior art that it is easy to make misjudgments when detecting whether there is a deviation between the actual position of the gimbal and the preset position through traditional detection algorithms.

[0006] In a first aspect, the present invention provides a gimbal offset detection method, the gimbal offset detection method comprising:

[0007] Obtaining a video stream collected by a camera within a preset time period, the camera being carried by a pan / tilt head;

[0008] Determine the direction of movement of vehicles in the detection area in the video stream;

[0009] Determine the direction of traffic flow according to the movement direction of vehicles in the detection area in the video stream;

[0010] When the magnitude of the deflection angle between the vehicle flow direction and the reference vehicle flow direction is greater than a first threshold, it is determined that the pan / tilt head is offset from the preset position.

[0011] In a second aspect, the present invention further provides a gimbal offset detection device, the gimbal offset detection device comprising:

[0012] An acquisition module, used to acquire a video stream collected by a camera within a preset period of time, wherein the camera is carried by a pan / tilt head;

[0013] A first determination module is used to determine the movement direction of a vehicle in a detection area in a video stream;

[0014] A second determination module is used to determine the direction of vehicle flow according to the movement direction of vehicles in the detection area in the video stream;

[0015] The third determination module is used to determine that the pan / tilt head is offset from the preset position when the magnitude of the deflection angle between the vehicle flow direction and the reference vehicle flow direction is greater than a first threshold.

[0016] In a third aspect, the present invention also provides a gimbal offset detection device, comprising a processor, a memory, and a gimbal offset detection program stored in the memory and executable by the processor, wherein when the gimbal offset detection program is executed by the processor, the steps of the gimbal offset detection method as described above are implemented.

[0017] In a fourth aspect, the present invention further provides a readable storage medium, on which a gimbal offset detection program is stored, wherein when the gimbal offset detection program is executed by a processor, the steps of the gimbal offset detection method as described above are implemented.

[0018] In the present invention, a video stream collected by a camera within a preset time period is obtained, and the camera is carried by a pan-tilt head; the movement direction of vehicles in the detection area in the video stream is determined; the direction of traffic flow is determined according to the movement direction of vehicles in the detection area in the video stream; when the deflection angle between the direction of traffic flow and the reference direction of traffic flow is greater than a first threshold, it is determined that the pan-tilt head is offset relative to the preset position. Through the present invention, the size of the deflection angle between the direction of traffic flow and the reference direction of traffic flow is used as a judgment reference, thereby avoiding misjudgment caused by environmental, weather and other factors; and with the reference direction of traffic flow as a reference, even if the pan-tilt head is offset from the preset position when shooting begins, the size of the deflection angle between the direction of traffic flow and the reference direction of traffic flow can be used to judge whether the pan-tilt head is offset relative to the preset position; thereby improving the accuracy of pan-tilt head offset detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1Schematic diagram of the hardware structure of the gimbal deviation detection device involved in the embodiment of the present invention;

[0020] Figure 2 It is a flowchart of a first embodiment of a gimbal deviation detection method of the present invention;

[0021] Figure 3 A schematic diagram of setting a detection area and a reference vehicle flow direction in an embodiment of a pan / tilt offset detection method of the present invention;

[0022] Figure 4 A schematic diagram of a scene for determining a deflection angle in an embodiment of a pan / tilt offset detection method of the present invention;

[0023] Figure 5 It is a flow chart of a second embodiment of a method for detecting a pan / tilt deviation according to the present invention;

[0024] Figure 6 Schematic diagram of functional modules of an embodiment of a gimbal deviation detection device of the present invention.

[0025] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0026] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0027] In a first aspect, an embodiment of the present invention provides a gimbal offset detection device, which may be a device having a data processing function, such as a personal computer (PC), a laptop computer, or a server.

[0028] Reference Figure 1 , Figure 1The hardware structure diagram of the gimbal deviation detection device involved in the embodiment of the present invention is shown in FIG. 1 . In the embodiment of the present invention, the gimbal deviation detection device may include a processor 1001 (e.g., a central processing unit (CPU)), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a wireless fidelity WIreless-FIdelity, WI-FI interface); the memory 1005 may be a high-speed random access memory (random access memory, RAM), or a stable memory (non-volatile memory), such as a disk storage. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001. Those skilled in the art will understand that Figure 1 The hardware structure shown in the figure does not constitute a limitation of the present invention, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0029] Continue to refer to Figure 1 , Figure 1 The memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a pan / tilt offset detection program. The processor 1001 may call the pan / tilt offset detection program stored in the memory 1005 and execute the pan / tilt offset detection method provided in the embodiment of the present invention.

[0030] In a second aspect, an embodiment of the present invention provides a gimbal offset detection method.

[0031] In one embodiment, referring to Figure 2 , Figure 2 FIG. 1 is a flow chart of the first embodiment of the pan / tilt offset detection method of the present invention. Figure 2 As shown, the gimbal offset detection method includes:

[0032] Step S10, obtaining a video stream collected by a camera within a preset period of time, wherein the camera is carried by a pan / tilt head;

[0033] In this embodiment, the preset time period is set according to actual needs, and the preset time period can be periodic. The camera can be turned on only during the preset time period, and the video stream collected during the preset time period is sent to the execution subject of this embodiment; the camera can also be turned on continuously, and the execution subject of this embodiment obtains the video stream collected by the camera during the preset time period from the complete video stream collected by the camera. The camera is carried by the pan / tilt.

[0034] Step S20, determining the movement direction of the vehicle in the detection area in the video stream;

[0035] In this embodiment, only the trajectory of the vehicle in the detection area in the video stream is tracked to determine the movement direction of the vehicle in the detection area in the video stream. Specifically, the vehicle in the detection area in the video stream is first identified by a deep learning algorithm, and then the detected vehicle is tracked by a target tracking algorithm to determine the movement direction of the vehicle in the detection area in the video stream.

[0036] The video stream is composed of several picture frames, and the detection area is a certain area in each picture frame. The detection area can be set manually.

[0037] Furthermore, in one embodiment, the detection area is an area where a lane is located in a video stream captured by the camera when the pan / tilt head is not offset from a preset position, and the reference traffic direction is a planned driving direction of a lane in a video stream captured by the camera when the pan / tilt head is not offset from a preset position.

[0038] In this embodiment, the video stream collected by the camera when the pan / tilt position is not offset relative to the preset position is obtained. It is easy to understand that when the pan / tilt position is not offset relative to the preset position, each lane area in each image frame in the video stream is in a fixed area in each image frame. Therefore, the area where a lane is located in the video stream collected by the camera when the pan / tilt position is not offset relative to the preset position is taken as the detection area. On this basis, the reference traffic direction is the planned driving direction of a lane in the video stream collected by the camera when the pan / tilt position is not offset relative to the preset position.

[0039] Reference Figure 3 , Figure 3 FIG. 1 is a schematic diagram of setting a detection area and a reference vehicle flow direction in an embodiment of a pan / tilt offset detection method of the present invention. Figure 3 As shown in FIG. 1 , any picture frame can be selected from the video stream collected by the camera when the PTZ is not offset relative to the preset position, and then the lane line in the picture frame can be identified by image recognition. Then, the area where the lane is located in the picture frame is determined according to the lane line, so that the area where the lane is located in the picture frame is taken as the detection area ( Figure 3The dashed box in the image). Since the lane is located in the same area in each image frame, the detection area is also located in the same area in each image frame. Then the planned driving direction of the lane is used as the reference traffic direction ( Figure 3 ).

[0040] Figure 3 FIG. 1 shows only a scenario of how to set the detection area and the reference traffic direction when the picture frame includes one lane. However, it is easy to understand that when the picture frame includes multiple lanes, the detection area and the reference traffic direction corresponding to each lane can also be set in a similar manner.

[0041] Step S30, determining the direction of vehicle flow according to the movement direction of vehicles in the detection area in the video stream;

[0042] In this embodiment, for example, through step S20, the moving direction 1 of vehicle 1, the moving direction 2 of vehicle 2, the moving direction 3 of vehicle 3, the moving direction 4 of vehicle 4, and the moving direction 5 of vehicle 5 are determined, and the traffic flow direction can be obtained according to the five moving directions. For example, the average moving direction of the five moving directions is taken as the traffic flow direction.

[0043] Furthermore, in one embodiment, step S30 includes:

[0044] Step S301, determining the deflection angle between the movement direction of each vehicle in the detection area in the video stream and the reference traffic direction;

[0045] In this embodiment, taking five movement directions as an example, the deflection angle between each movement direction and the reference traffic flow direction is first obtained.

[0046] Step S302, sorting the movement directions of the vehicles in descending order or in ascending order according to the deflection angles to obtain a movement direction sorting queue;

[0047] In this embodiment, the movement directions of the vehicles are sorted in descending order or in descending order according to the deflection angles to obtain a movement direction sorting queue, for example:

[0048] Movement direction 3, movement direction 5, movement direction 2, movement direction 4, movement direction 1.

[0049] Step S303: remove the first N and last N movement directions in the movement direction sorting queue, and calculate the average value of the remaining movement directions as the vehicle flow direction.

[0050] In this embodiment, the N value can be flexibly adjusted according to the number of obtained motion directions. For example, the N value corresponding to each numerical range is preset, and the execution entity can determine the N value according to the numerical range in which the number of obtained motion directions lies.

[0051] For example, when the motion direction sorting queue is as shown above, N is 1, then the first and last motion directions in the motion direction sorting queue are eliminated, and the average value of the remaining motion directions 5, 2, and 4 is calculated as the traffic direction.

[0052] Furthermore, in one embodiment, after step S302, the method further includes:

[0053] Step S304: The moving direction in the middle of the moving direction sorting queue is taken as the vehicle flow direction.

[0054] In this embodiment, the moving direction in the middle of the moving direction sorting queue is taken as the vehicle flow direction. When the moving direction sorting queue is as shown above, the moving direction 2 is taken as the vehicle flow direction.

[0055] Through this embodiment, the influence of the abnormal motion direction determined due to tracking abnormality on the gimbal offset detection result can be reduced.

[0056] Step S40: When the deflection angle between the vehicle flow direction and the reference vehicle flow direction is greater than a first threshold, it is determined that the pan / tilt head is offset from the preset position.

[0057] In this embodiment, refer to Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a scene for determining a deflection angle in an embodiment of a pan / tilt offset detection method of the present invention. Figure 4 As shown, the solid arrow is the reference traffic direction, the dotted box is the detection area, the dotted arrow is the traffic direction determined based on the video stream collected by the camera within a preset time period, the traffic direction is compared with the reference traffic direction, and the deflection angle of the two is obtained, and the deflection angle includes the deflection direction and angle of the traffic direction relative to the reference traffic direction; or the deflection angle includes the deflection direction and angle of the reference traffic direction relative to the traffic direction.

[0058] When the deflection angle between the vehicle flow direction and the reference vehicle flow direction is greater than a first threshold, it is determined that the PTZ is offset relative to the preset position, wherein the first threshold is set according to actual needs.

[0059] In this embodiment, a video stream collected by a camera within a preset time period is obtained, and the camera is carried by a pan-tilt head; the movement direction of vehicles in the detection area in the video stream is determined; the direction of traffic flow is determined according to the movement direction of vehicles in the detection area in the video stream; when the deflection angle between the direction of traffic flow and the reference direction of traffic flow is greater than a first threshold, it is determined that the pan-tilt head is offset relative to the preset position. Through this embodiment, the size of the deflection angle between the direction of traffic flow and the reference direction of traffic flow is used as a judgment reference, thereby avoiding misjudgment caused by environmental, weather and other factors; and using the reference direction of traffic flow as a reference, even if the pan-tilt head is offset from the preset position when shooting begins, the size of the deflection angle between the direction of traffic flow and the reference direction of traffic flow can be used to judge whether the pan-tilt head is offset relative to the preset position; thereby improving the accuracy of pan-tilt head offset detection.

[0060] Furthermore, in one embodiment, after step S40, the method further includes:

[0061] The gimbal is adjusted based on the deflection angle.

[0062] In this embodiment, when the deflection angle includes the deflection direction of the traffic flow direction relative to the reference traffic flow direction and the angle, the PTZ is deflected by the angle in the deflection direction. For example, if the deflection direction of the traffic flow direction relative to the reference traffic flow direction is to the right and the angle is 20°, the PTZ is deflected 20° to the right.

[0063] When the deflection angle includes the deflection direction and angle of the reference traffic direction relative to the traffic direction, the PTZ is deflected by the angle in the opposite direction of the deflection direction. For example, if the deflection direction of the reference traffic direction relative to the traffic direction is to the left and the angle is 20°, the PTZ is deflected 20° to the right.

[0064] Further, in one embodiment, referring to Figure 5 , Figure 5 FIG. 2 is a flow chart of a second embodiment of a method for detecting a pan / tilt deviation according to the present invention. Figure 5 As shown, after step S10, it also includes:

[0065] Step S50, determining the number of abnormal vehicles according to the video stream, wherein the abnormal vehicles are vehicles that are located within the detection area in one picture frame included in the video stream and are located outside the detection area in another picture frame included in the video stream;

[0066] In this embodiment, the video stream is analyzed frame by frame. First, the deep learning algorithm is used to identify the vehicles in the detection area in the video stream. For example, the vehicle 1 in the detection area is identified in the i-th frame, and then the detected vehicle 1 is tracked by the target tracking algorithm to determine the position of the vehicle 1 in the subsequent frames. If the position of the vehicle 1 is detected outside the detection area in a subsequent frame, the vehicle 1 can be determined to be an abnormal vehicle. By analogy, all abnormal vehicles in the video stream can be determined.

[0067] Step S60: When the number of abnormal vehicles is greater than a second threshold, it is determined that the pan / tilt head is offset from the preset position.

[0068] In this embodiment, when the number of abnormal vehicles is greater than the second threshold, it means that the lane area in each frame of the video stream collected by the camera within the preset period is deviated from the detection area, and it can be determined that the PTZ is offset relative to the preset position. The second threshold is set according to actual needs.

[0069] Furthermore, in one embodiment, after step S60, the method further includes:

[0070] Determine the movement direction of the vehicle in the detection area in the video stream; determine the traffic direction according to the movement direction of the vehicle in the detection area in the video stream; determine the deflection angle between the traffic direction and the reference traffic direction; and adjust the pan / tilt based on the deflection angle.

[0071] In this embodiment, the specific embodiments can refer to the above content and will not be described in detail here.

[0072] In a third aspect, an embodiment of the present invention further provides a gimbal deviation detection device.

[0073] In one embodiment, referring to Figure 6 , Figure 6 Schematic diagram of functional modules of an embodiment of a pan / tilt offset detection device of the present invention. Figure 6 As shown, the gimbal deviation detection device includes:

[0074] An acquisition module 10 is used to acquire a video stream collected by a camera within a preset period of time, wherein the camera is carried by a pan / tilt head;

[0075] A first determination module 20, used to determine the movement direction of a vehicle in the detection area in the video stream;

[0076] A second determination module 30, for determining the direction of vehicle flow according to the movement direction of vehicles in the detection area in the video stream;

[0077] The third determination module 40 is used to determine that the pan / tilt head is offset from the preset position when the deflection angle between the vehicle flow direction and the reference vehicle flow direction is greater than a first threshold.

[0078] Furthermore, in one embodiment, the detection area is an area where a lane is located in a video stream captured by the camera when the pan / tilt head is not offset from a preset position, and the reference traffic direction is a planned driving direction of a lane in a video stream captured by the camera when the pan / tilt head is not offset from a preset position.

[0079] Furthermore, in one embodiment, the gimbal offset detection device further includes:

[0080] a fourth determination module, configured to determine the number of abnormal vehicles according to the video stream, wherein the abnormal vehicles are vehicles that are located within the detection area in one picture frame included in the video stream and are located outside the detection area in another picture frame included in the video stream;

[0081] The fifth determination module is used to determine that the pan / tilt head is offset from the preset position when the number of abnormal vehicles is greater than a second threshold.

[0082] Furthermore, in one embodiment, the gimbal offset detection device further includes a first correction module, which is used to:

[0083] Determine the movement direction of the vehicle in the detection area in the video stream; determine the traffic direction according to the movement direction of the vehicle in the detection area in the video stream; determine the deflection angle between the traffic direction and the reference traffic direction; and adjust the pan / tilt based on the deflection angle.

[0084] Furthermore, in one embodiment, the second determining module 30 is configured to:

[0085] Determine the deflection angle between the movement direction of each vehicle in the detection area in the video stream and the reference traffic direction;

[0086] The moving directions of the vehicles are sorted in descending order or in ascending order according to the deflection angles to obtain a moving direction sorting queue;

[0087] The first N and last N movement directions in the movement direction sorting queue are eliminated, and the average value of the remaining movement directions is calculated as the traffic flow direction.

[0088] Furthermore, in one embodiment, the second determining module 30 is configured to:

[0089] The moving direction in the middle of the moving direction sorting queue is the traffic direction.

[0090] Furthermore, in one embodiment, the gimbal offset detection device further includes a second correction module, which is used to:

[0091] The gimbal is adjusted based on the deflection angle.

[0092] Among them, the functional implementation of each module in the above-mentioned gimbal offset detection device corresponds to the steps in the above-mentioned gimbal offset detection method embodiment, and its functions and implementation processes are no longer repeated here.

[0093] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium.

[0094] The readable storage medium of the present invention stores a gimbal deviation detection program, wherein when the gimbal deviation detection program is executed by a processor, the steps of the gimbal deviation detection method as described above are implemented.

[0095] Among them, the method implemented when the gimbal deviation detection program is executed can refer to the various embodiments of the gimbal deviation detection method of the present invention, and will not be repeated here.

[0096] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0097] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present invention.

[0099] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for detecting pan / tilt offset, characterized in that: The gimbal deviation detection method comprises: Obtaining a video stream collected by a camera within a preset time period, the camera being carried by a pan / tilt head; Determine the movement direction of a vehicle in a detection area in the video stream, wherein the detection area is an area where a lane is located in the video stream collected by the camera when the pan / tilt head is not offset relative to a preset position; Determine the direction of traffic flow according to the movement direction of vehicles in the detection area in the video stream; When the deflection angle between the traffic flow direction and the reference traffic flow direction is greater than a first threshold, it is determined that the pan / tilt head is offset relative to the preset position, and the reference traffic flow direction is the planned driving direction of a lane in the video stream collected by the camera when the pan / tilt head is not offset relative to the preset position; After the step of obtaining the video stream collected by the camera within a preset time period and the camera being carried by the pan / tilt head, the method further includes: Determine the number of abnormal vehicles according to the video stream, wherein the abnormal vehicles are vehicles that are located within the detection area in one picture frame included in the video stream and are located outside the detection area in another picture frame included in the video stream; When the number of abnormal vehicles is greater than a second threshold, it is determined that the pan / tilt head is offset from the preset position.

2. The method for detecting pan / tilt deviation according to claim 1, wherein: The step of determining the direction of the traffic flow according to the movement direction of the vehicles in the detection area in the video stream comprises: Determine the deflection angle between the movement direction of each vehicle in the detection area in the video stream and the reference traffic direction; The moving directions of the vehicles are sorted in descending order or in ascending order according to the deflection angles to obtain a moving direction sorting queue; The first N and last N movement directions in the movement direction sorting queue are eliminated, and the average value of the remaining movement directions is calculated as the traffic flow direction.

3. The pan / tilt offset detection method according to claim 1, wherein: The step of determining the direction of the traffic flow according to the movement direction of the vehicles in the detection area in the video stream comprises: Determine the deflection angle between the movement direction of each vehicle in the detection area in the video stream and the reference traffic direction; The moving directions of the vehicles are sorted in descending order or in ascending order according to the deflection angles to obtain a moving direction sorting queue; The moving direction in the middle of the moving direction sorting queue is the traffic direction.

4. The method for detecting pan / tilt deviation according to any one of claims 1 to 3, characterized in that: After the step of determining that the pan / tilt platform is offset from the preset position, the method further includes: The gimbal is adjusted based on the deflection angle.

5. A pan / tilt deviation detection device, characterized in that: The pan / tilt deviation detection device comprises: An acquisition module, used to acquire a video stream collected by a camera within a preset period of time, wherein the camera is carried by a pan / tilt head; A first determination module is used to determine the movement direction of a vehicle in a detection area in a video stream, wherein the detection area is an area where a lane is located in a video stream collected by a camera when the pan / tilt head has no offset relative to a preset position; A second determination module is used to determine the direction of vehicle flow according to the movement direction of vehicles in the detection area in the video stream; A third determination module is used to determine that the pan / tilt head is offset from the preset position when the deflection angle between the traffic direction and the reference traffic direction is greater than a first threshold, and the reference traffic direction is the planned driving direction of a lane in the video stream collected by the camera when the pan / tilt head is not offset from the preset position; The gimbal deviation detection device also includes: a fourth determination module, configured to determine the number of abnormal vehicles according to the video stream, wherein the abnormal vehicles are vehicles that are located within the detection area in one picture frame included in the video stream and are located outside the detection area in another picture frame included in the video stream; The fifth determination module is used to determine that the pan / tilt head is offset from the preset position when the number of abnormal vehicles is greater than a second threshold.

6. A pan / tilt offset detection device, characterized in that: The gimbal offset detection device includes a processor, a memory, and a gimbal offset detection program stored in the memory and executable by the processor, wherein when the gimbal offset detection program is executed by the processor, the steps of the gimbal offset detection method as described in any one of claims 1 to 4 are implemented.

7. A readable storage medium, characterized in that: The readable storage medium stores a gimbal deviation detection program, wherein when the gimbal deviation detection program is executed by a processor, the steps of the gimbal deviation detection method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Method and device for disappeared direction determination and method and device for camera self-calibration

    CN102789642A

  • Camera automatic engineering investigation method and device, electronic equipment, chip and storage medium

    CN113206994A