Camera tilt detection method and device

By identifying the position information of the parking space frame and calculating the inclination angle, the problem of camera tilt affecting parking space detection and license plate recognition is solved, and the accurate judgment of the camera tilt state is achieved, which improves the accuracy of the parking lot management system.

CN119254946APending Publication Date: 2025-01-03SHENZHEN JIESHUN SCI & TECH IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411389596.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the parking lot, the camera's tilt installation results in a non-vertical shooting angle, affecting the accuracy of parking space detection and license plate recognition.

Method used

By acquiring the surveillance image collected by the camera, identifying the position information of the parking space frame, calculating the tilt angle of the parking space frame, and determining whether the camera is in the tilted state based on the preset threshold.

Benefits of technology

Accurately determine whether the camera is tilted, improve the accuracy of parking space detection and license plate recognition, and ensure the effectiveness of parking lot management systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254946A_ABST
    Figure CN119254946A_ABST
Patent Text Reader

Abstract

The invention discloses a camera inclination detection method and device. The method comprises the following steps: acquiring a monitoring image acquired by a camera; the monitoring image is recognized, parking space recognition information is obtained, and the parking space recognition information comprises first position information of a parking space frame; and determining a tilt detection result of the camera based on the first position information. Whether the camera is in the inclined state or not is accurately judged through the first position information of the parking space frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of camera monitoring technology, and in particular to a camera tilt detection method and device. Background Art

[0002] In modern parking lot management systems, cameras are key equipment for efficient parking lot management. They monitor the status of parking spaces in real time and provide drivers with accurate parking space information, thereby optimizing the parking process and improving parking efficiency. Cameras are usually installed at key locations in parking lots. By capturing real-time images, they detect vehicles entering the parking lot, identify license plate numbers, and determine whether the parking space is occupied. However, in actual applications, the installation position of the camera in the parking lot may be tilted, resulting in the camera's shooting angle not being completely perpendicular to the parking space, which in turn affects the accuracy of parking space detection and license plate recognition. Summary of the invention

[0003] Based on this, it is necessary to provide a camera tilt detection method and device for the above-mentioned technical problems to solve at least one of the above-mentioned technical problems.

[0004] The present invention provides a camera tilt detection method, comprising:

[0005] Get the surveillance image captured by the camera;

[0006] Identify the monitoring image to obtain parking space identification information, wherein the parking space identification information includes first position information of the parking space frame;

[0007] Based on the first position information, a tilt detection result of the camera is determined.

[0008] Optionally, according to a camera tilt detection method provided by the present invention, determining the tilt detection result of the camera based on the first position information includes:

[0009] Based on the first position information of each parking space frame, determining a tilt angle of the parking space frame;

[0010] Based on the tilt angle of the parking space frame, a tilt detection result of the camera is determined.

[0011] Optionally, according to a camera tilt detection method provided by the present invention, the step of determining the tilt angle of the parking space frame based on the first position information of each parking space frame includes:

[0012] Based on the first position information of each parking space frame, determining the coordinates of the center of gravity of each parking space frame;

[0013] Determine a first horizontal angle corresponding to a connecting line between the coordinates of the centroids of each two adjacent parking space frames and a horizontal line, wherein the horizontal line refers to a reference line parallel to the X-axis direction of a preset coordinate system;

[0014] Based on each of the first horizontal angles, the inclination angle of the parking space frame is determined.

[0015] Optionally, according to a camera tilt detection method provided by the present invention, the step of determining the tilt angle of the parking space frame based on the first position information of each parking space frame includes:

[0016] Based on the first position information of each parking space frame, determine the vertical angle between the side lines of each parking space frame and the vertical line, wherein the vertical line refers to a reference line parallel to the Y-axis direction of the preset coordinate system;

[0017] Based on each of the vertical angles, the inclination angle of the parking space frame is determined.

[0018] Optionally, according to a camera tilt detection method provided by the present invention, determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes:

[0019] Determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information;

[0020] If the number of the parking space frames is greater than a first preset number threshold, and the number of the parking space number frames is not greater than a second preset number threshold, comparing the tilt angle of the parking space frame with the first preset angle threshold;

[0021] If the tilt angle of the parking space frame is greater than the first preset angle threshold, the tilt detection result is determined as the camera is in a tilted state, wherein the tilt angle of the parking space frame is determined based on the coordinates of the center of gravity of each of the parking space frames, and the coordinates of the center of gravity of the parking space frame are determined based on the first position information of the parking space frame.

[0022] Optionally, according to a camera tilt detection method provided by the present invention, determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes:

[0023] Determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information;

[0024] If the number of the parking space frames is greater than a first preset number threshold, and the number of the parking space number frames is greater than a second preset number threshold, determining the second position information of each parking space number frame in the parking space identification information, and determining the inclination angle of the parking space number frame based on the second position information of each parking space number frame;

[0025] If the inclination angle of the parking space frame is greater than the first preset angle threshold, and the inclination angle of the parking space number frame is greater than the second preset angle threshold, the inclination detection result is determined as the camera is in a tilted state, wherein the inclination angle of the parking space frame is determined based on the coordinates of the center of gravity of each of the parking space frames, and the coordinates of the center of gravity of the parking space frame are determined based on the first position information of the parking space frame.

[0026] Optionally, according to a camera tilt detection method provided by the present invention, determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes:

[0027] Determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information;

[0028] If the number of the parking space frames is not greater than a first preset number threshold, and the number of the parking space number frames is not greater than a second preset number threshold, comparing the tilt angle of the parking space frame with a third preset angle threshold;

[0029] If the tilt angle of the parking space frame is greater than the third preset angle threshold, the tilt detection result is determined as the camera is in a tilted state, wherein the tilt angle of the parking space frame is determined based on the vertical angle between the two side lines of each parking space frame and the vertical line.

[0030] Optionally, according to a camera tilt detection method provided by the present invention, determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes:

[0031] If the number of the parking space frames is not greater than a first preset number threshold, and the number of the parking space number frames is greater than a second preset number threshold, determining the second position information of each parking space number frame in the parking space identification information, and determining the inclination angle of the parking space number frame based on the second position information of each parking space number frame;

[0032] If the inclination angle of the parking space frame is greater than the third preset angle threshold, and the inclination angle of the parking space number frame is greater than the second preset angle threshold, the inclination detection result is determined to be that the camera is in a tilted state, wherein the inclination angle of the parking space frame is determined based on the vertical angle between the two side lines of each parking space frame and the vertical line.

[0033] Optionally, according to a camera tilt detection method provided by the present invention, the step of determining the tilt angle of the parking space number frame based on the second position information of each parking space number frame includes:

[0034] Based on the second position information of each parking space number frame, determining a second horizontal angle between each parking space number frame and the horizontal line;

[0035] Based on each of the second horizontal angles, the inclination angle of the parking space number frame is determined.

[0036] The present invention also provides a camera tilt detection device, comprising:

[0037] An acquisition module is used to acquire the surveillance images collected by the camera;

[0038] an identification module, configured to identify the monitoring image to obtain parking space identification information, wherein the parking space identification information includes first position information of the parking space frame;

[0039] A determination module is used to determine a tilt detection result of the camera based on the first position information.

[0040] The present invention also provides a computer device, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-mentioned camera tilt detection method when executing the computer-readable instructions.

[0041] The present invention also provides one or more readable storage media storing computer-readable instructions, and when the computer-readable instructions are executed by a processor, the above-mentioned camera tilt detection method is implemented.

[0042] The camera tilt detection method and device include: acquiring a surveillance image captured by a camera; identifying the surveillance image to obtain parking space identification information, wherein the parking space identification information includes first position information of a parking space frame; and determining the tilt detection result of the camera based on the first position information. The present invention accurately determines whether the camera is in a tilted state through the first position information of the parking space frame. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0044] Figure 1 is one of the flow charts of a camera tilt detection method in one embodiment of the present invention;

[0045] Figure 2 is a second flow chart of a camera tilt detection method according to an embodiment of the present invention;

[0046] Figure 3 This is a scene effect diagram provided by an embodiment of the present invention;

[0047] Figure 4 FIG3 is a flow chart of a camera tilt detection method according to an embodiment of the present invention;

[0048] Figure 5 FIG4 is a fourth flow chart of a camera tilt detection method according to an embodiment of the present invention;

[0049] Figure 6 FIG5 is a fifth flow chart of a camera tilt detection method according to an embodiment of the present invention;

[0050] Figure 7 FIG6 is a sixth flow chart of a camera tilt detection method according to an embodiment of the present invention;

[0051] Figure 8 is a structural schematic diagram of a camera tilt detection device in one embodiment of the present invention;

[0052] Fig. 9 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] The terms used in one or more embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present invention. The singular forms of "a", "said" and "the" used in one or more embodiments of the present invention are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and includes any or all possible combinations of one or more associated listed items.

[0055] In one embodiment, if Figure 1 As shown, Figure 1 FIG. 1 is a flow chart of a camera tilt detection method according to an embodiment of the present invention. The present invention provides a camera tilt detection method, comprising the following steps:

[0056] Step S11, obtaining a surveillance image captured by a camera;

[0057] It should be noted that the camera is pre-installed in the parking lot, and the camera can capture monitoring images of the parking space.

[0058] Step S12, identifying the monitoring image to obtain parking space identification information;

[0059] It should be noted that the parking space identification information includes the first position information of the parking space frame, wherein the parking space frame refers to a virtual or actual boundary used to identify the parking space in the monitoring image. Usually, this boundary will be depicted in a rectangular frame or other shapes to facilitate the vehicle driver to quickly identify and locate the vacant parking space. In image processing and computer vision, the first position information of the parking space frame refers to the pixel coordinates of the parking space in the image, that is, the coordinates corresponding to the upper left corner, lower left corner, upper right corner and lower right corner of the parking space frame. In other embodiments, the parking space identification information may also include the second position information of the parking space number frame, and the parking space number refers to the unique identifier of each parking space in the parking lot, which is usually located above or beside the parking space frame. The parking space number helps the vehicle driver to quickly find his parking space, and the second position information refers to the pixel coordinates of the parking space number in the image, wherein the second position information of the parking space number frame includes the coordinates corresponding to the upper left corner, lower left corner, upper right corner and lower right corner of the parking space number frame.

[0060] In one embodiment, a deep learning model is used to detect the monitoring image to detect the parking space frame in the monitoring image to extract the first position information corresponding to the parking space frame, and the parking space number frame in the monitoring image can also be detected to extract the second position information corresponding to the parking space number frame, wherein the commonly used models include target detection models such as YOLO (You Only Look Once), SSD (Single Shot MultiBox Detector) or Faster R-CNN (Region-based Convolutional Neural Network). In order to improve the accuracy and efficiency of image processing, the monitoring image can be pre-processed by graying, filtering and denoising before image detection. In one embodiment, after the first position information corresponding to the parking space frame and the second position information corresponding to the parking space number frame are detected, the intersection-and-union ratio between the parking space frame and the parking space number frame can be calculated based on the first position information and the second position information, wherein the intersection-and-union ratio is used to measure the degree of overlap between the positions corresponding to the parking space frame and the parking space number frame, and then the first position information of the parking space frame corresponding to the same parking space and the second position information of the parking space number frame are associated according to the intersection-and-union ratio.

[0061] Step S13: determining a tilt detection result of the camera based on the first position information.

[0062] Specifically, based on the first position information of each parking space frame, the parking space frame tilt angle is calculated, and then based on the parking space frame tilt angle, it is determined whether the camera is in a tilted state. In more detail: In one embodiment, the coordinates of the center of gravity of the parking space frame can be determined according to the first position information of the parking space frame, and then the first horizontal angle corresponding to the connecting line between the coordinates of the center of gravity of any two adjacent parking space frames and the horizontal line is calculated, and the first horizontal angle is used as the parking space frame tilt angle; if the first average angle is greater than the first preset angle threshold, it is determined that the tilt detection result is that the camera is in a tilted state. Wherein, the horizontal line refers to a reference line parallel to the X-axis direction of the preset coordinate system. For example, the preset coordinate system uses the right horizontal direction of the image as the X-axis and the downward vertical direction of the image as the Y-axis, that is, the direction of the X-axis is from the left boundary to the right boundary of the image; the direction of the Y-axis is from the upper boundary to the lower boundary of the image, and the origin of the preset coordinate system can be set in combination with actual conditions, for example, the pixel point in the upper left corner of the image is used as the origin of the preset coordinate system. In another embodiment, according to the first position information of the parking space frame, the horizontal connecting line corresponding to the upper and lower sides of the parking space frame is determined, and then the first horizontal angle between the horizontal connecting line corresponding to the parking space frame and the horizontal line is calculated, and the first horizontal angles are averaged to obtain a first average angle, and the first horizontal angle is used as the tilt angle of the parking space frame; if the first average angle is greater than the first preset angle threshold, the tilt detection result is determined to be that the camera is in a tilted state.

[0063] In another embodiment, when the parking space identification information includes the second position information of the parking space number frame, the tilt angle of the parking space number frame can be determined based on the second position information of each parking space number frame; more specifically: according to the second position information of the parking space number frame, the horizontal connection line corresponding to the upper and lower edges of the parking space number frame is determined, and then the second horizontal angle between the horizontal connection line corresponding to the parking space number frame and the horizontal line is calculated, and each second horizontal angle is averaged to obtain a second average angle, and the second average angle is used as the tilt angle of the parking space number frame. If the second average angle is greater than the second preset angle threshold, it is determined that the tilt detection result is that the camera is in a tilted state, wherein the second preset angle threshold and the first preset angle threshold can be set to the same angle threshold according to actual conditions, for example, set to 8°, or can be set to different angle thresholds. In other embodiments, when the second position information of the identified parking space number frame is large, the second average angle can also be calculated according to the coordinates of the center of gravity of the parking space number frame, and then based on the second average angle, the tilt detection result of the camera is determined. The specific determination process is similar to the implementation process of determining the tilt detection result of the camera according to the coordinates of the center of gravity of the parking space frame, and will not be repeated here.

[0064] In one embodiment, in order to improve the accuracy of the camera's tilt detection result, the tilt angle of the parking space frame and the tilt angle of the parking space number frame can be combined to jointly determine the camera's tilt detection result. For example, if the tilt angle of the parking space frame is greater than a first preset angle threshold, and the tilt angle of the parking space number frame is greater than a second preset angle threshold, the tilt detection result is determined to be that the camera is in a tilted state.

[0065] In another embodiment, the tilt detection result of the camera can also be determined in combination with the angle between the left and right sides of the parking space frame and the vertical line. In more detail: based on the first position information of the parking space frame, the side lines of the parking space frame are determined. For example, the side line on the left side is determined according to the coordinates of the upper left corner and the lower left corner in the first position information; then the vertical angle between the side lines of the two sides and the vertical line is calculated, and the vertical line refers to the reference line parallel to the Y-axis direction of the preset coordinate system. The preset coordinate system has been specifically described in the above embodiment; then the vertical angle with the largest angle is used as the tilt angle of the parking space frame. If the vertical angle is greater than the third preset angle threshold, the tilt detection result is directly determined to be that the camera is in a tilted state, wherein the third preset angle threshold can be set according to actual conditions, for example, set to 40°. In addition, it should be noted that the tilt detection result of the camera can also be determined in combination with the vertical angle between the side lines of the parking space number frame and the vertical line. However, under normal circumstances, the parking space number frame corresponding to the parking space is generally small, so the distance between the side lines of the two sides is relatively close, resulting in errors in the tilt detection result of the camera.

[0066] In other embodiments, in order to improve the accuracy of the camera's tilt detection result, the vertical angle between the two side lines and the vertical line in the parking space frame and the second average angle of the parking space number frame can be combined to jointly determine the camera's tilt detection result. For example, if the second average angle is greater than the second preset angle threshold, and there is any side line whose corresponding vertical angle is greater than the third preset angle threshold, then the tilt detection result is determined to be that the camera is in a tilted state.

[0067] The embodiment of the present invention, through the above scheme, includes: obtaining a monitoring image captured by a camera; recognizing the monitoring image to obtain parking space recognition information, wherein the parking space recognition information includes first position information of a parking space frame; and determining a tilt detection result of the camera based on the first position information. The present invention can determine whether the camera is in a tilted state through the first position information of the parking space frame.

[0068] like Figure 2 As shown, Figure 2 FIG. 2 is a flow chart of a camera tilt detection method according to an embodiment of the present invention. In an embodiment of the present invention, determining a tilt detection result of a camera based on first position information includes:

[0069] Step S21, determining the tilt angle of each parking space frame based on the first position information of each parking space frame;

[0070] In one embodiment, based on the first position information of each parking space frame, the coordinates of the center of gravity of each parking space frame are calculated, which can be referred to Figure 3 , Figure 3 It is a scene effect diagram provided by an embodiment of the present invention. Further, the coordinates of the center of gravity of any two adjacent parking space frames are connected, and then the first horizontal angles between each connecting line and the horizontal line are calculated respectively, and the horizontal line refers to a reference line parallel to the X-axis direction of the preset coordinate system, and the first horizontal angles are averaged to obtain the inclination angle of the parking space frame.

[0071] In one embodiment, based on the first position information of the parking space frame, the coordinates of the upper left corner, the lower left corner, the upper right corner and the lower right corner in the parking space frame are determined, and then the left sideline is determined based on the coordinates of the upper left corner and the lower left corner, and the right sideline is determined based on the coordinates of the upper right corner and the lower right corner. Then, the vertical angle between the vertical line and the left sideline and the vertical angle between the vertical line and the right sideline are calculated, and the vertical line refers to a reference line parallel to the Y-axis direction of the preset coordinate system. Then, based on the vertical angles of the left and right sidelines of each parking space frame, the tilt angle of the parking space frame is determined, for example, among the vertical angles of the left and right sidelines of each parking space frame, the vertical angle with the largest angle is selected as the tilt angle of the parking space frame.

[0072] Step S22: determining the tilt detection result of the camera based on the tilt angle of the parking space frame.

[0073] In one embodiment, the tilt angle of the parking space frame is compared with a preset angle threshold, so as to determine the tilt detection result of the camera according to the comparison result. Optionally, when the tilt angle of the parking space frame is determined based on the coordinates of the center of gravity of each parking space frame, the tilt angle of the parking space frame is compared with a first preset angle threshold; when the tilt angle of the parking space frame is determined based on the vertical angle between the side lines on both sides of each parking space frame and the vertical line, the tilt angle of the parking space frame is compared with a third preset angle threshold, and the first preset angle threshold and the third preset angle threshold are different angle thresholds, for example, the first preset angle threshold is 8°, and the third preset angle threshold is 40°. Further, if the tilt angle of the parking space frame is greater than the angle threshold, the tilt detection result is determined to be that the camera is in a tilted state.

[0074] In other embodiments, in the process of identifying the surveillance image, the second position information of the parking space number frame may be identified. Then, based on the second position information of each parking space number frame, the second horizontal angle between each parking space number frame and the horizontal line is calculated; then, the second horizontal angles are averaged to obtain the tilt angle of the parking space number frame. In order to improve the accuracy of the camera tilt determination, the tilt angle of the parking space frame and the tilt angle of the parking space number frame can be combined to determine the tilt detection result of the camera. For example, in the case where the tilt angle of the parking space frame is determined based on the coordinates of the center of gravity of each parking space frame; if the tilt angle of the parking space frame is greater than the first preset angle threshold, and the tilt angle of the parking space number frame is greater than the second preset angle threshold, then the tilt detection result is determined to be that the camera is in a tilted state; in the case where the tilt angle of the parking space frame is determined based on the vertical angle between the side lines on both sides of each parking space frame and the vertical line: if the tilt angle of the parking space frame is greater than the third preset angle threshold, and the tilt angle of the parking space number frame is greater than the second preset angle threshold, then the tilt detection result is determined to be that the camera is in a tilted state.

[0075] In other embodiments, since the parking space number frames are usually small, when the number of parking space number frames is small, it may cause errors in the tilt detection result of the camera. Then, the tilt detection result of the camera is determined in combination with the number of parking space frames, the number of parking space number frames and the tilt angle of the parking space frames. The specific camera tilt determination process is specifically described in the following embodiments and will not be repeated here.

[0076] The embodiment of the present invention uses the above solution to calculate the tilt angle of the parking space frame through the first position information of the parking space frame, and then judge whether the camera is in a tilted state according to the tilt angle.

[0077] like Figure 4 As shown, Figure 4 FIG3 is a flow chart of a camera tilt detection method according to an embodiment of the present invention. In an embodiment of the present invention, based on the tilt angle of the parking space frame, determining the tilt detection result of the camera includes:

[0078] Step S31, determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information;

[0079] Step S32: if the number of parking space frames is greater than a first preset number threshold, and the number of parking space number frames is not greater than a second preset number threshold, then comparing the tilt angle of the parking space frame with the first preset angle threshold;

[0080] Step S33: if the tilt angle of the parking space frame is greater than the first preset angle threshold, it is determined that the tilt detection result is that the camera is in a tilted state.

[0081] It should be noted that, in the process of identifying the surveillance image, the second position information of the parking space number frame may be identified, and at this time, the parking space identification information includes the second position information of the identified parking space number frame. Specifically, when the tilt angle of the parking space frame is determined based on the coordinates of the center of gravity of each parking space frame: determine the number of parking space frames in the parking space identification information, and determine the number of parking space number frames in the parking space identification information; then compare the number of parking space frames with the first preset number threshold, and compare the number of parking space number frames with the second preset number threshold. If the number of parking space frames is greater than the first preset number threshold, and the number of parking space number frames is not greater than the second preset number threshold, then compare the tilt angle of the parking space frame with the first preset angle threshold; if the tilt angle of the parking space frame is greater than the first preset angle threshold, then determine that the tilt detection result is that the camera is in a tilted state, and the first preset angle threshold can be set according to actual conditions, for example, set to 8°.

[0082] According to the above scheme, after the inclination angle of the parking space frame is determined according to the coordinates of the center of gravity of the parking space frame, if the number of parking space frames is greater than the first preset number threshold and the number of parking space number frames is not greater than the second preset number threshold, whether the camera is in a tilted state is accurately determined directly according to the comparison result between the inclination angle of the parking space frame and the first preset angle threshold.

[0083] like Figure 5 As shown, Figure 5 FIG4 is a flow chart of a camera tilt detection method according to an embodiment of the present invention. In an embodiment of the present invention, based on the tilt angle of the parking space frame, determining the tilt detection result of the camera includes:

[0084] Step S41, determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information;

[0085] Step S42: if the number of parking space frames is greater than a first preset number threshold, and the number of parking space number frames is greater than a second preset number threshold, determining the second position information of each parking space number frame in the parking space identification information, and determining the inclination angle of the parking space number frame based on the second position information of each parking space number frame;

[0086] Step S43: if the tilt angle of the parking space frame is greater than the first preset angle threshold, and the tilt angle of the parking space number frame is greater than the second preset angle threshold, it is determined that the tilt detection result is that the camera is in a tilted state.

[0087] Specifically, when the inclination angle of the parking space frame is determined based on the coordinates of the center of gravity of each parking space frame: determine the number of parking space frames in the parking space identification information, and determine the number of parking space number frames in the parking space identification information; then compare the number of parking space frames with a first preset number threshold, and compare the number of parking space number frames with a second preset number threshold. If the number of parking space frames is greater than the first preset number threshold, and the number of parking space number frames is greater than the second preset number threshold, determine the second position information of each parking space number frame in the parking space identification information, and then calculate the second horizontal angle between each parking space number frame and the horizontal line based on the second position information of each parking space number frame; then average the second horizontal angles to obtain the inclination angle of the parking space number frame.

[0088] Furthermore, the inclination angle of the parking space frame is compared with the first preset angle threshold, and the inclination angle of the parking space number frame is compared with the second preset angle threshold; if the inclination angle of the parking space frame is greater than the first preset angle threshold, and the inclination angle of the parking space number frame is greater than the second preset angle threshold, then the tilt detection result is determined to be that the camera is in a tilted state. The first preset angle threshold and the second preset angle threshold can be set to different angle thresholds according to actual conditions, or can be set to the same angle threshold. For example, the first preset angle threshold and the second preset angle threshold can both be set to 8°.

[0089] According to the above scheme, after the inclination angle of the parking space frame is determined according to the coordinates of the center of gravity of the parking space frame, if the number of parking space frames is greater than a first preset number threshold, and the number of parking space number frames is greater than a second preset number threshold, the inclination angle of the parking space frame and the inclination angle of the parking space number frame are combined to accurately determine whether the camera is in a tilted state.

[0090] like Figure 6 As shown, Figure 6 FIG5 is a flowchart of a camera tilt detection method according to an embodiment of the present invention. In an embodiment of the present invention, based on the tilt angle of the parking space frame, determining the tilt detection result of the camera includes:

[0091] Step S51, determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information;

[0092] Step S52: if the number of parking space frames is not greater than the first preset number threshold, and the number of parking space number frames is not greater than the second preset number threshold, then compare the parking space frame tilt angle with the third preset angle threshold;

[0093] Step S53: if the tilt angle of the parking space frame is greater than a third preset angle threshold, it is determined that the tilt detection result is that the camera is in a tilted state.

[0094] Specifically, when the parking space frame tilt angle is determined based on the vertical angle between the side lines on both sides of each parking space frame and the vertical line: determine the number of parking space frames in the parking space identification information, and determine the number of parking space number frames in the parking space identification information; then compare the number of parking space frames with the first preset number threshold, and compare the number of parking space number frames with the second preset number threshold, if the number of parking space frames is not greater than the first preset number threshold, and the number of parking space number frames is not greater than the second preset number threshold, then compare the parking space frame tilt angle with the third preset angle threshold; further, if the parking space frame tilt angle is greater than the third preset angle threshold, then determine that the tilt detection result is that the camera is in a tilted state. The third preset angle threshold can be set according to actual conditions, for example, set to 40°.

[0095] According to the above scheme, after the inclination angle of the parking space frame is determined according to the vertical angle between the side lines on both sides and the vertical line in each parking space frame, if the number of parking space frames is not greater than the first preset number threshold, and the number of parking space number frames is not greater than the second preset number threshold, whether the camera is in a tilted state is directly determined according to the comparison result between the inclination angle of the parking space frame and the third preset angle threshold.

[0096] like Figure 7 As shown, Figure 7 FIG6 is a flowchart of a camera tilt detection method according to an embodiment of the present invention. In an embodiment of the present invention, based on the tilt angle of the parking space frame, determining the tilt detection result of the camera includes:

[0097] Step S61, determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information;

[0098] Step S62: if the number of parking space frames is not greater than the first preset number threshold, and the number of parking space number frames is greater than the second preset number threshold, determining the second position information of each parking space number frame in the parking space identification information, and determining the inclination angle of the parking space number frame based on the second position information of each parking space number frame;

[0099] Step S63: if the tilt angle of the parking space frame is greater than the third preset angle threshold, and the tilt angle of the parking space number frame is greater than the second preset angle threshold, it is determined that the tilt detection result is that the camera is in a tilted state.

[0100] Specifically, when the inclination angle of the parking space frame is determined based on the vertical angle between the side lines on both sides of each parking space frame and the vertical line: the number of parking space frames in the parking space identification information is determined, and the number of parking space number frames in the parking space identification information is determined; then the number of parking space frames is compared with a first preset number threshold, and the number of parking space number frames is compared with a second preset number threshold. If the number of parking space frames is not greater than the first preset number threshold, and the number of parking space number frames is greater than the second preset number threshold, it is proved that there are fewer parking space frames and more parking space number frames. In order to improve the accuracy of detection, the parking space number inclination angle and the parking space number frame inclination angle are combined to determine whether the camera is tilted, and then the second position information of each parking space number frame in the parking space identification information is determined, and then based on the second position information of each parking space number frame, the second horizontal angle between each parking space number frame and the horizontal line is calculated; and then the second horizontal angles are averaged to obtain the inclination angle of the parking space number frame.

[0101] Furthermore, the tilt angle of the parking space frame is compared with a first preset angle threshold, and the tilt angle of the parking space number frame is compared with a second preset angle threshold; if the tilt angle of the parking space frame is greater than the third preset angle threshold, and the tilt angle of the parking space number frame is greater than the second preset angle threshold, the tilt detection result is determined to be that the camera is in a tilted state.

[0102] Through the above, the embodiment of the present invention realizes that after determining the inclination angle of the parking space frame according to the vertical angle between the two side lines and the vertical line in each parking space frame, when the number of parking space frames is not greater than the first preset number threshold, and the number of parking space number frames is greater than the second preset number threshold, the inclination angle of the parking space frame and the inclination angle of the parking space number frame are combined to accurately determine whether the camera is in a tilted state.

[0103] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0104] In one embodiment, a camera tilt detection device is provided, which corresponds one-to-one to the camera tilt detection method in the above embodiment. Figure 8 As shown, Figure 8 : is a schematic diagram of a structure of a camera tilt detection device in one embodiment of the present invention, the camera tilt detection device comprises:

[0105] An acquisition module 71 is used to acquire the surveillance image captured by the camera;

[0106] The recognition module 72 is used to recognize the monitoring image and obtain parking space recognition information, wherein the parking space recognition information includes the first position information of the parking space frame;

[0107] The determination module 73 is used to determine the tilt detection result of the camera based on the first position information.

[0108] The determination module 73 is also used for:

[0109] Based on the first position information of each parking space frame, determining the tilt angle of the parking space frame;

[0110] Based on the tilt angle of the parking space frame, the tilt detection result of the camera is determined.

[0111] The determination module 73 is also used for:

[0112] Based on the first position information of each parking space frame, determining the coordinates of the center of gravity of each parking space frame;

[0113] Determine a first horizontal angle corresponding to a connecting line between the coordinates of the centroids of each two adjacent parking space frames and a horizontal line, wherein the horizontal line refers to a reference line parallel to the X-axis direction of the preset coordinate system;

[0114] Based on each first horizontal angle, an inclination angle of the parking space frame is determined.

[0115] The determination module 73 is also used for:

[0116] Based on the first position information of each parking space frame, determine the vertical angle between the side lines on both sides of each parking space frame and the vertical line, wherein the vertical line refers to a reference line parallel to the Y-axis direction of the preset coordinate system;

[0117] Based on each vertical angle, the inclination angle of the parking space frame is determined.

[0118] The determination module 73 is also used for:

[0119] Determine the number of parking space frames in the parking space identification information, and determine the number of parking space number frames in the parking space identification information;

[0120] If the number of parking space frames is greater than a first preset number threshold, and the number of parking space number frames is not greater than a second preset number threshold, comparing the tilt angle of the parking space frame with the first preset angle threshold;

[0121] If the tilt angle of the parking space frame is greater than a first preset angle threshold, the tilt detection result is determined as the camera is in a tilted state, wherein the tilt angle of the parking space frame is determined based on the coordinates of the center of gravity of each parking space frame, and the coordinates of the center of gravity of the parking space frame are determined based on the first position information of the parking space frame.

[0122] The determination module 73 is also used for:

[0123] Determine the number of parking space frames in the parking space identification information, and determine the number of parking space number frames in the parking space identification information;

[0124] If the number of parking space frames is greater than a first preset number threshold, and the number of parking space number frames is greater than a second preset number threshold, determining the second position information of each parking space number frame in the parking space identification information, and determining the inclination angle of the parking space number frame based on the second position information of each parking space number frame;

[0125] If the tilt angle of the parking space frame is greater than the first preset angle threshold, and the tilt angle of the parking space number frame is greater than the second preset angle threshold, the tilt detection result is determined as the camera is in a tilted state, wherein the tilt angle of the parking space frame is determined based on the coordinates of the center of gravity of each parking space frame, and the coordinates of the center of gravity of the parking space frame are determined based on the first position information of the parking space frame.

[0126] The determination module 73 is also used for:

[0127] Determine the number of parking space frames in the parking space identification information, and determine the number of parking space number frames in the parking space identification information;

[0128] If the number of parking space frames is not greater than a first preset number threshold, and the number of parking space number frames is not greater than a second preset number threshold, comparing the parking space frame tilt angle with a third preset angle threshold;

[0129] If the tilt angle of the parking space frame is greater than the third preset angle threshold, the tilt detection result is determined as the camera is in a tilted state, wherein the tilt angle of the parking space frame is determined based on the vertical angle between the side lines on both sides of each parking space frame and the vertical line.

[0130] The determination module 73 is also used for:

[0131] The method of determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes:

[0132] Determine the number of parking space frames in the parking space identification information, and determine the number of parking space number frames in the parking space identification information;

[0133] If the number of parking space frames is not greater than a first preset number threshold, and the number of parking space number frames is greater than a second preset number threshold, determining the second position information of each parking space number frame in the parking space identification information, and determining the inclination angle of the parking space number frame based on the second position information of each parking space number frame;

[0134] If the tilt angle of the parking space frame is greater than the third preset angle threshold, and the tilt angle of the parking space number frame is greater than the second preset angle threshold, the tilt detection result is determined to be that the camera is in a tilted state, wherein the tilt angle of the parking space frame is determined based on the vertical angle between the two side lines and the vertical line in each parking space frame.

[0135] The determination module 73 is also used for:

[0136] Based on the second position information of each parking space number frame, determining a second horizontal angle between each parking space number frame and the horizontal line;

[0137] Based on each second horizontal angle, the inclination angle of the parking space number frame is determined.

[0138] For the specific definition of the camera tilt detection device, please refer to the definition of the camera tilt detection method above, which will not be repeated here. Each module in the above-mentioned camera tilt detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0139] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown, Fig. 9 : is a schematic diagram of a computer device in an embodiment of the present invention. The computer device includes a processor, a memory, a network interface and a database connected by a device bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating device, a computer-readable instruction and a database. The internal memory provides an environment for the operation of the operating device and the computer-readable instructions in the readable storage medium. The database of the computer device is used to store data involved in the camera tilt detection method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instruction is executed by the processor, a camera tilt detection method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0140] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, and a network interface connected through a device bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a camera tilt detection method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0141] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor implements the steps of the above-mentioned camera tilt detection method when executing the computer-readable instructions.

[0142] In one embodiment, a readable storage medium is provided, the readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the camera tilt detection method as described above are implemented. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0143] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0144] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.

Claims

1. A camera tilt detection method, characterized in that: include: Get the surveillance image captured by the camera; Identify the monitoring image to obtain parking space identification information, wherein the parking space identification information includes first position information of the parking space frame; Based on the first position information, a tilt detection result of the camera is determined.

2. The camera tilt detection method according to claim 1, characterized in that: The step of determining a tilt detection result of the camera based on the first position information includes: Based on the first position information of each parking space frame, determining a tilt angle of the parking space frame; Based on the tilt angle of the parking space frame, a tilt detection result of the camera is determined.

3. The camera tilt detection method according to claim 2, characterized in that: The determining the tilt angle of the parking space frame based on the first position information of each parking space frame includes: Based on the first position information of each parking space frame, determining the coordinates of the center of gravity of each parking space frame; Determine a first horizontal angle corresponding to a connecting line between the coordinates of the centroids of each two adjacent parking space frames and a horizontal line, wherein the horizontal line refers to a reference line parallel to the X-axis direction of a preset coordinate system; Based on each of the first horizontal angles, the inclination angle of the parking space frame is determined.

4. The camera tilt detection method according to claim 2, characterized in that: The determining the tilt angle of the parking space frame based on the first position information of each parking space frame includes: Based on the first position information of each parking space frame, determine the vertical angle between the side lines of each parking space frame and the vertical line, wherein the vertical line refers to a reference line parallel to the Y-axis direction of the preset coordinate system; Based on each of the vertical angles, the inclination angle of the parking space frame is determined.

5. The camera tilt detection method according to claim 2, characterized in that: The determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes: Determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information; If the number of the parking space frames is greater than a first preset number threshold, and the number of the parking space number frames is not greater than a second preset number threshold, comparing the tilt angle of the parking space frame with the first preset angle threshold; If the tilt angle of the parking space frame is greater than the first preset angle threshold, the tilt detection result is determined as the camera is in a tilted state, wherein the tilt angle of the parking space frame is determined based on the coordinates of the center of gravity of each of the parking space frames, and the coordinates of the center of gravity of the parking space frame are determined based on the first position information of the parking space frame.

6. The camera tilt detection method according to claim 2, characterized in that: The determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes: Determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information; If the number of the parking space frames is greater than a first preset number threshold, and the number of the parking space number frames is greater than a second preset number threshold, determining the second position information of each parking space number frame in the parking space identification information, and determining the inclination angle of the parking space number frame based on the second position information of each parking space number frame; If the inclination angle of the parking space frame is greater than the first preset angle threshold, and the inclination angle of the parking space number frame is greater than the second preset angle threshold, the inclination detection result is determined as the camera is in a tilted state, wherein the inclination angle of the parking space frame is determined based on the coordinates of the center of gravity of each of the parking space frames, and the coordinates of the center of gravity of the parking space frame are determined based on the first position information of the parking space frame.

7. The camera tilt detection method according to claim 2, characterized in that: The determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes: Determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information; If the number of the parking space frames is not greater than a first preset number threshold, and the number of the parking space number frames is not greater than a second preset number threshold, comparing the tilt angle of the parking space frame with a third preset angle threshold; If the tilt angle of the parking space frame is greater than the third preset angle threshold, the tilt detection result is determined as the camera is in a tilted state, wherein the tilt angle of the parking space frame is determined based on the vertical angle between the two side lines of each parking space frame and the vertical line.

8. The camera tilt detection method according to claim 2, characterized in that: The determining the tilt detection result of the camera based on the tilt angle of the parking space frame includes: Determining the number of parking space frames in the parking space identification information, and determining the number of parking space number frames in the parking space identification information; If the number of the parking space frames is not greater than a first preset number threshold, and the number of the parking space number frames is greater than a second preset number threshold, determining the second position information of each parking space number frame in the parking space identification information, and determining the inclination angle of the parking space number frame based on the second position information of each parking space number frame; If the inclination angle of the parking space frame is greater than the third preset angle threshold, and the inclination angle of the parking space number frame is greater than the second preset angle threshold, the inclination detection result is determined to be that the camera is in a tilted state, wherein the inclination angle of the parking space frame is determined based on the vertical angle between the two side lines of each parking space frame and the vertical line.

9. The camera tilt detection method according to claim 6 or 8, characterized in that: The step of determining the tilt angle of the parking space number frame based on the second position information of each parking space number frame comprises: Based on the second position information of each parking space number frame, determining a second horizontal angle between each parking space number frame and the horizontal line; Based on each of the second horizontal angles, the inclination angle of the parking space number frame is determined.

10. A camera tilt detection device, characterized in that: include: An acquisition module is used to acquire the surveillance images collected by the camera; an identification module, configured to identify the monitoring image to obtain parking space identification information, wherein the parking space identification information includes first position information of the parking space frame; A determination module is used to determine a tilt detection result of the camera based on the first position information.