Disclosure of Invention
In order to solve the technical problems, the application provides a parking space detection method, a parking space detection system, a parking space detection terminal and a storage medium, so that the parking space detection rate and the detection precision are improved.
The application provides a parking space detection method, including: acquiring parking space angular point information, wherein the parking space angular point information comprises current detection angular point information and historical detection angular point information; outputting target corner information according to the matching condition of the current detection corner information and the historical detection corner information; carrying out corner classification according to the corner direction in the target corner information; and performing angular point matching and outputting parking space information according to the angular point classification result and the angular point position in the target angular point information.
In an embodiment, the step of outputting the target corner information according to the matching condition between the current detected corner information and the historical detected corner information includes: acquiring first corner information which is successfully matched with the current detection corner information and the historical detection corner information; acquiring second corner information which is failed to be matched with the current detection corner information in the historical detection corner information and has historical matching success times larger than preset times; and outputting the first corner point information and the second corner point information.
In an embodiment, before the step of obtaining the first corner information that is successfully matched with the current detected corner information and the historical detected corner information, the method includes: predicting the historical detection corner information to obtain predicted corner information; updating the historical detection corner information into the prediction corner information; before outputting the first corner information, the method includes: and performing smooth optimization on the first corner information.
In an embodiment, the step of outputting the target corner information according to the matching condition between the current detected corner information and the historical detected corner information includes: and acquiring third corner point information which fails to be matched with the historical detection corner point information in the current detection corner point information, and storing the third corner point information into the historical detection corner point information.
In an embodiment, the step of classifying the corner points according to the corner point direction in the target corner point information includes: if the angle difference between the directions of any two corner points in the target corner point information meets a first threshold range, the corresponding two corner points are homodromous corner points; and if the angle difference between the directions of any two corner points in the target corner point information meets a second threshold range, the corresponding two corner points are reverse corner points.
In an embodiment, the step of performing corner matching and outputting parking space information according to the corner classification result and the corner position in the target corner information includes: respectively acquiring the distance between adjacent angular points in the same-direction angular points and the distance between adjacent angular points in the reverse angular points according to the angular point classification result and the angular point position in the target angular point information; and matching the adjacent angular points of which the distances among the equidirectional angular points meet a third threshold range and the adjacent angular points of which the distances among the opposite angular points meet a fourth threshold range, and outputting the angular point positions and the parking space sizes of the same parking space.
In an embodiment, the step of performing corner matching and outputting parking space information according to the corner classification result and the corner position in the target corner information further includes: acquiring the distance between adjacent corners in the same-direction corner or the opposite-direction corner according to the corner classification result and the corner position in the target corner information; outputting the angular point position of the same parking space according to the information of the adjacent angular points of which the distance in the equidirectional angular points meets a third threshold range and the preset parking space size; or outputting the angular point position of the same parking stall according to the information of the adjacent angular points of which the distance in the reverse angular points meets a fourth threshold range and the preset parking stall size.
The application also provides a parking space detection system which comprises an acquisition module, an angular point tracking module, an angular point classification module and an angular point matching module; the acquisition module is used for acquiring parking space angular point information, wherein the parking space angular point information comprises current detection angular point information and historical detection angular point information; the corner tracking module is used for outputting target corner information according to the matching condition of the current detection corner information and the historical detection corner information; the corner point classification module is used for performing corner point classification according to the corner point direction in the target corner point information; and the angular point matching module is used for performing angular point matching and outputting parking space information according to the angular point classification result and the angular point position in the target angular point information.
The application also provides a terminal, the terminal comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, and the processor executes the computer program to realize the steps of the parking space detection method.
The application also provides a storage medium, wherein the storage medium stores a computer program, and the computer program realizes the steps of the parking space detection method when being executed by the processor.
According to the parking space detection method, the parking space detection system, the parking space detection terminal and the storage medium, the parking space angular point information identified by the deep learning model is tracked and screened, the false detection angular point information can be filtered, the missing detection angular point information is predicted, angular point matching is carried out according to angular point classification and angular point positions, and the parking space detection rate and the detection precision are improved.
Detailed Description
The technical solution of the present application is further described in detail with reference to the drawings and specific embodiments of the specification. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, "and/or" includes any and all combinations of one or more of the associated listed items.
Fig. 1 is a schematic view of a panoramic image according to an embodiment of the present disclosure. The panoramic image is obtained by splicing pictures collected by four fisheye cameras arranged on a vehicle, wherein the four fisheye cameras are respectively arranged right in front of the vehicle, right behind the vehicle, left in front of the vehicle and right in front of the vehicle, and the left in front of the vehicle and the right in front of the vehicle are respectively positioned on a left rearview mirror and a right rearview mirror of the vehicle; optionally, an image coordinate system is established by taking the upper left corner of the panoramic image as the origin of coordinates, and the parking space detection method provided by the embodiment of the application is realized based on the image coordinate system of the panoramic image; in fig. 1, O denotes a coordinate origin, X denotes an X-axis of an image coordinate system, Y denotes a Y-axis of the image coordinate system, P denotes a parking space, and C denotes a vehicle to be parked.
Fig. 2 is a schematic flow chart of a parking space detection method according to an embodiment of the present application. As shown in fig. 2, the parking space detection method of the present application may include the following steps:
step S101: acquiring parking space angular point information, wherein the parking space angular point information comprises current detection angular point information and historical detection angular point information;
optionally, detecting parking space angular point information by performing image segmentation processing on the panoramic image through a deep learning model, wherein the current detection angular point information is parking space angular point information obtained by real-time detection; the historical detection angular point information is parking space angular point information obtained by historical detection; the parking space angle point information comprises coordinates and directions of the parking space angle points under an image coordinate system.
Step S102: outputting target corner information according to the matching condition of the current detection corner information and the historical detection corner information;
in one embodiment, step S102 includes:
acquiring first corner information which is successfully matched in the current detection corner information and the historical detection corner information;
acquiring second corner information which is failed to be matched with the current detection corner information in the historical detection corner information, wherein the historical matching success times are greater than the preset times;
and outputting the first corner information and the second corner information.
In an embodiment, before the step of obtaining the first corner information that is successfully matched between the current detected corner information and the historical detected corner information, the method includes:
predicting historical detection corner information to obtain predicted corner information;
updating historical detection corner information into prediction corner information;
before outputting the first corner point information, the method comprises the following steps: and performing smooth optimization on the first corner point information.
In one embodiment, step S102 includes:
and acquiring third corner point information which fails to be matched with the historical detection corner point information in the current detection corner point information, and storing the third corner point information into the historical detection corner point information.
Optionally, prediction of the historical detection corner information and smooth optimization of the first corner information are implemented through a kalman filter. Carrying out smooth filtering on the corner information successfully matched with the current detection corner information and the historical corner information and then outputting the corner information; further judging the history matching success times aiming at the history corner information which is not successfully matched with the current detection corner information, and outputting the history matching success times when the history matching success times are more than the preset times, such as 5 times; and storing the current detection corner information which is not successfully matched with the historical corner information into the historical detection corner information, and temporarily not outputting.
Exemplarily, the current detection corner information of the first frame image comprises A1 corner information and B1 corner information, and because the first frame image is matched without historical detection corner information, the current detection corner information of the first frame image is stored in the historical detection corner information and is not output temporarily; the current detection corner information of the second frame image comprises A2 corner information, B2 corner information and C2 corner information; predicting historical detection corner information stored in a first frame image, if A1 corner information and B1 corner information in the first frame image and prediction corner information in a second frame image are respectively A2 corner information and B2 corner information, matching A2 corner information and B2 corner information in the second frame image with A1 corner information and B1 corner information in the historical corner information is successful, outputting A2 corner information and B2 corner information, respectively updating A1 corner information and B1 corner information in the historical corner information into A2 corner information and B2 corner information, and storing C2 corner information which is not successfully matched with the historical detection corner information in the second frame image into the historical detection information, wherein the historical detection corner information stored in the final corner of the second frame image comprises the A2 corner information, the B2 information and the C2 information; and (3) historical detection corner information saved for the second frame image: the history matching success times of the A2 corner information, the B2 corner information, the C2 corner information, the predicted corner information in the third frame image, such as the A3 corner information, the B3 corner information, and the C3 corner information, are 1, and 0, respectively.
Step S103: carrying out corner classification according to the corner direction in the target corner information;
in one embodiment, step S103 includes:
if the angle difference between the directions of any two corner points in the target corner point information meets a first threshold range, the corresponding two corner points are homodromous corner points;
and if the angle difference between the directions of any two corner points in the target corner point information meets the second threshold range, the corresponding two corner points are reverse corner points.
Optionally, a Clustering algorithm (dbsc) is adopted to classify the corners in the target corner information through a dbsc can classifier to obtain similar corner information and heterogeneous corner information, wherein the similar corner information, i.e., the same-direction corner information, can be directly output; further judging whether an angle difference value between the directions of any two corner points meets a second threshold range or not aiming at the heterogeneous corner point information, and outputting reverse corner point information of which the angle difference value meets the second threshold range; optionally, the first threshold range is [0,30] and the second threshold range is [150,200] in degrees.
As shown in fig. 3, A1, B1, C1, and D1 are equidirectional corner points, A1', B1', C1', and D1' are equidirectional corner points, any one of A1, B1, C1, and D1 and any one of A1', B1', C1', and D1' are reversal corner points, and an arrow in fig. 3 represents a direction carried by the corner point.
Step S104: and performing angle point matching and outputting parking space information according to the angle point classification result and the angle point position in the target angle point information.
Optionally, the parking space information includes positions of four corner points of the parking space in the image coordinate system and length and width dimensions of the parking space.
In one embodiment, step S104 includes:
respectively acquiring the distance between adjacent angular points in the same-direction angular point and the distance between adjacent angular points in the reverse angular point according to the angular point classification result and the angular point position in the target angular point information;
and matching the adjacent angular points of which the distances among the equidirectional angular points meet the third threshold range and the adjacent angular points of which the distances among the opposite angular points meet the fourth threshold range, and outputting the angular point positions and the parking space sizes of the same parking space.
Optionally, calculating a distance between any two adjacent corner points in the same-direction corner points according to the corner point classification result and the corner point positions in the target corner point information, pairing adjacent corner points of which the distances in the same-direction corner points meet a third threshold range, calculating a distance between any two adjacent corner points in the reverse corner points, and pairing adjacent corner points of which the distances in the reverse corner points meet a fourth threshold range; and then matching the same-direction angular points successfully matched with the reverse angular points successfully matched, outputting angular point information capable of forming the same parking space, and calculating the size of the parking space according to the output angular point information.
As shown in fig. 4, the co-directional corner points successfully paired include B1 and B2, B2 and B3, B3 and B4, B1 'and B2', B2 'and B3', and B3 'and B4', and the counter corner points successfully paired include B1 and B1', B2 and B2', B3 and B3', and B4', and the co-directional corner points successfully paired are matched with the counter corner points successfully paired, so as to obtain a corner point combination capable of forming the same parking space, including B1, B2, B1 'and B2'; b2, B3, B2 'and B3'; b3, B4, B3 'and B4'; in fig. 4, arrows indicate directions carried by corner points, and P indicates a detected parking space.
It is worth mentioning that the parking space detection method provided by the application does not rely on the calibration value of the parking space size, when the corner points are paired, the corner point distance judgment can be carried out on the basis of the corner point classification, the corner point distance meets the threshold range, the pairing success can be confirmed, then the same-direction corner points and the reverse corner points which are paired successfully are matched, the corner point information which can form the same parking space is output, and the problem that the parking space detection precision is not enough due to the error of the parking space size calibration value can be solved.
In one embodiment, step S104 further includes:
acquiring the distance between adjacent angular points in the same-direction angular point or the reverse angular point according to the angular point classification result and the angular point position in the target angular point information;
outputting the angular point position of the same parking stall according to the information of the adjacent angular points of which the distances among the equidirectional angular points meet a third threshold range and the preset parking stall size; or
And outputting the angle point position of the same parking stall according to the information of the adjacent angle points of which the distance in the reverse angle points meets the fourth threshold range and the preset parking stall size.
Optionally, under the condition that four angular points of the same parking space cannot be acquired simultaneously, if any two adjacent angular points in the same direction or the opposite direction angular points are successfully paired, the positions of the other two angular points can be deduced by combining the preset parking space size, and the problem of missed detection caused by shielding of part of the angular points in the traditional parking space detection method can be avoided.
Optionally, the third threshold range is [2.10,2.92], and the fourth threshold range is [5.85,6.56] in meters.
According to the parking space detection method, the current detection angular point information is tracked and screened through the historical detection angular point information, the false detection angular point information is filtered out, the missing detection angular point information is predicted and supplementarily output, angular point matching is carried out according to the angular point classification and the angular point positions, and the parking space detection rate and the detection precision are improved.
Fig. 5 is a schematic structural diagram of a parking space detection system provided in the second embodiment of the present application. As shown in fig. 5, the parking space detection system of the present application includes an acquisition module 11, an angular point tracking module 12, an angular point classification module 13, and an angular point matching module 14;
the acquisition module 11 is configured to acquire parking space angular point information, where the parking space angular point information includes current detection angular point information and historical detection angular point information;
the corner tracking module 12 is configured to output target corner information according to a matching condition of the current detected corner information and the historical detected corner information;
the corner classification module 13 is configured to classify corners according to the corner directions in the target corner information;
the angular point matching module 14 is configured to perform angular point matching and output parking space information according to the angular point classification result and an angular point position in the target angular point information.
The specific implementation method of this embodiment refers to the first embodiment, and is not described herein again.
The parking space detection system provided by the embodiment of the application carries out tracking and screening on parking space angular point information through interaction among the acquisition module, the angular point tracking module, the angular point classification module and the angular point matching module, filters out false detection angular point information, predicts missed detection angular point information, carries out angular point matching according to angular point classification and angular point positions, and improves parking space detection rate and detection precision.
Fig. 6 is a schematic structural diagram of a terminal provided in this application. The terminal of the application includes: a processor 110, a memory 111 and a computer program 112 stored in said memory 111 and executable on said processor 110. The processor 110 executes the computer program 112 to implement the steps in the above-mentioned embodiments of the parking space detection method.
The terminal may include, but is not limited to, a processor 110, a memory 111. Those skilled in the art will appreciate that fig. 6 is only an example of a terminal and is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or different components, e.g., the terminal may also include input-output devices, network access devices, buses, etc.
The Processor 110 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 111 may be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal. The memory 111 may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the memory 111 may also include both an internal storage unit and an external storage device of the terminal. The memory 111 is used for storing the computer programs and other programs and data required by the terminal. The memory 111 may also be used to temporarily store data that has been output or is to be output.
The present application further provides a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the parking space detection method are implemented.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
As used herein, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, including not only those elements listed, but also other elements not expressly listed.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.