Disclosure of Invention
It is an object of a first aspect of the present invention to provide a method that enables detection of parking spaces in complex or ambiguous environments.
A further object of the first aspect of the present invention is to provide a method for detecting a parking space with a strong recognition capability.
It is an object of a second aspect of the present invention to provide a system that is capable of detecting parking spaces in complex or ambiguous environments.
According to the first aspect, the present invention provides a parking space detection method, including:
when the vehicle enters a parking area, searching for a parking space;
recording the position of the first acquired parking space as a starting point;
recording the driving distance of the vehicle from the starting point to the current position, and collecting parking space information of a path close to the vehicle from the starting point to the current position;
calculating target parking space information according to the driving distance and the acquired parking space information, wherein the target parking space is close to the current position;
the parking space information comprises parking space types and parking space line widths.
Optionally, calculating the target parking space information according to the driving distance and the collected parking space information includes:
judging whether the number of continuous parking spaces adjacent to a path from the starting point to the current position of the vehicle exceeds a preset number or not;
if so, calculating the target parking space information according to the parking space type, the driving distance, the parking space line width and the parking space number.
Optionally, calculating the target parking space information according to the parking space type, the driving distance, the parking space line width and the parking space number includes:
judging whether two adjacent parking spaces share the same parking line at the joint position;
and if not, measuring a gap value between two adjacent parking spaces in the two adjacent parking spaces, and removing the gap value when the target parking space information is calculated.
Optionally, the collecting the parking space information of the route adjacent to the vehicle from the starting point to the current position includes:
collecting an included angle between the vehicle and a line adjacent to the vehicle from the starting point to the current position;
and judging whether each line is a vehicle line or not by combining the included angles between the vehicle and the lines.
Optionally, after acquiring an included angle between the vehicle and the vehicle, which is close to the vehicle from the starting point to the current position, the method further includes:
acquiring contrast between a line and a background color thereof;
and judging whether each line is a vehicle line or not by combining the contrast and the included angles between the vehicle and the lines.
Optionally, after measuring a gap value between two adjacent parking spaces, the method includes:
judging whether the void value is larger than a preset threshold value or not;
if yes, the parking space is searched again.
Optionally, whether each lines is the parking stall line is judged to the contained angle between the vehicle and a plurality of lines including combining the contrast:
and comparing a plurality of included angles between the vehicle and the lines and the contrast, and judging the lines with the same included angle value and the same contrast as the vehicle-to-vehicle line.
Optionally, the combination of the contrast and the included angle between vehicle and a plurality of lines judges whether each line still includes after being the parking stall line:
and verifying whether the determined parking space line is correct or not according to the width of the parking space line, the shape of the corner of the parking space line and the parking space continuity.
Optionally, after calculating the target parking space information according to the driving distance and the collected parking space information, the method further includes:
judging whether an obstacle exists on the target parking space;
if yes, recording the target parking space as the collected parking space, calculating target parking space information again according to the driving distance and the collected parking space information, or recording the position of the target parking space as a starting point to collect driving distance and parking space information again.
According to the second aspect, the present invention also provides a parking space detection system, including:
the system comprises an acquisition unit, a parking area acquisition unit and a parking position acquisition unit, wherein the acquisition unit is used for searching parking positions when a vehicle enters the parking area;
the parking space detection device comprises a control device and a processor, wherein a control program is stored in the memory, and the control program is used for realizing the parking space detection method when being executed by the processor.
The parking space detection method provided by the invention searches parking spaces when a vehicle enters a parking area, records the position of the first acquired parking space as a starting point, records the driving distance of the vehicle, acquires the parking space information adjacent to a path from the starting point to the current position of the vehicle, and calculates the target parking space information according to the driving distance and the acquired parking space information, wherein the parking spaces adjacent to the path comprise the parking spaces on two sides of the path. Through carrying out feature extraction and law summary to the parking stall that has gathered, extract out the parking stall law, for example: the parking space recognition method comprises the steps of calculating expected positions and types of target parking spaces according to type information and driving distance, accurately finding the target parking spaces, solving the problem that the parking space recognition rate is low or cannot be recognized due to the fact that certain parking space lines of the parking spaces are not clear or parking space lines reflect light caused by ambient light and the like, namely, the recognition capability of the parking spaces is improved through a deduction algorithm, recognizing original scenes which are not required and are actually the parking spaces, and improving the recognition rate.
Further, according to parking stall type, distance of traveling, parking stall line width and parking stall number calculation target parking stall information includes: if the parking space types of the previous preset number are the same type, the high probability of the target parking space type is the type; the number of parking spaces can be obtained according to the driving distance and the parking space line width, and if the number of parking spaces exceeds the preset number, information of the target parking space, such as the position and the size of the target parking space, can be further obtained. So, the credibility of the target parking stall information that quantity and combination multiple factor obtained is very high through setting up, and is all higher to the discernment ability and the recognition rate of parking stall.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
Fig. 1 is a block flow diagram of a parking space detection method according to an embodiment of the present invention. As shown in fig. 1, the present invention provides a parking space detection method, which generally includes:
s10: when the vehicle enters a parking area, searching for a parking space;
s20: recording the position of the first acquired parking space as a starting point;
s30: recording the driving distance of the vehicle from a starting point to the current position, and collecting parking space information of a path close to the vehicle from the starting point to the current position;
s40: calculating target parking space information according to the driving distance and the acquired parking space information, wherein the target parking space is close to the current position;
the parking space information comprises parking space types and parking space line widths.
The parking space detection method provided by this embodiment searches for a parking space when a vehicle enters a parking area, records the position where the first acquired parking space is located as a starting point, records the driving distance of the vehicle, acquires parking space information adjacent to a path from the starting point to the current position of the vehicle, the parking spaces adjacent to the path include parking spaces on both sides of the path, and calculates target parking space information according to the driving distance and the acquired parking space information. Through carrying out feature extraction and law summary to the parking stall that has gathered, extract out the parking stall law, for example: the parking space recognition method comprises the steps of calculating expected positions and types of target parking spaces according to type information and driving distance, accurately finding the target parking spaces, solving the problem that the parking space recognition rate is low or cannot be recognized due to the fact that certain parking space lines of the parking spaces are not clear or parking space lines reflect light caused by ambient light and the like, namely, the recognition capability of the parking spaces is improved through a deduction algorithm, recognizing original scenes which are not required and are actually the parking spaces, and improving the recognition rate.
Fig. 2 is a block flow diagram of a parking space detection method according to another embodiment of the present invention. As shown in fig. 2, in a specific embodiment, the step of calculating the target parking space information according to the driving distance and the collected parking space information includes:
s41: judging whether the number of continuous parking spaces adjacent to a path from a starting point to the current position of the vehicle exceeds a preset number or not;
s42: if so, calculating the target parking space information according to the parking space type, the driving distance, the parking space line width and the parking space number.
Preferably, the preset number is two, the collected continuous parking spaces are the basis for calculating the target parking space, and in order to improve the recognition rate and reduce the recognition error, the preset number is set to be at least two.
Specifically, according to parking stall type, distance of traveling, parking stall line width and parking stall number calculation target parking stall information includes: if the parking space types of the previous preset number are the same type, the high probability of the target parking space type is the type; the number of parking spaces can be obtained according to the driving distance and the parking space line width, and if the number of parking spaces exceeds the preset number, information of the target parking space, such as the position and the size of the target parking space, can be further obtained. So, the credibility of the target parking stall information that quantity and combination multiple factor obtained is very high through setting up, and is all higher to the discernment ability and the recognition rate of parking stall.
In a more specific embodiment, the step of calculating the target parking space information according to the parking space type, the driving distance, the parking space line width and the parking space number comprises the following steps:
judging whether two adjacent parking spaces share the same parking line at the joint position;
and if not, measuring the gap value between two adjacent parking spaces in the two adjacent parking spaces, and removing the gap value when calculating the target parking space information.
In this embodiment, if it is determined that there is a gap between two adjacent parking spaces when two adjacent parking spaces do not share the parking space line at the junction, in practice, the gap may be a flower bed, the ground, or a brick, and the influence of the gap value needs to be considered when calculating the target parking space information, particularly the size and the position of the parking space, and the gap value needs to be removed, so that the calculation accuracy can be further improved.
In a further embodiment, collecting the slot information proximate to the path of the vehicle from the origin to the current location comprises:
collecting an included angle between the vehicle and a line adjacent to the vehicle from a starting point to the current position;
and judging whether each line is the vehicle line or not by combining the included angles between the vehicle and the lines.
In this embodiment, if only a small number of lines in the plurality of lines have different included angles with the vehicle than a large number of lines, it may be determined that the small number of lines are interference lines and not vehicle-side lines.
In a further embodiment, the step of acquiring an angle between the vehicle and a line adjacent to the vehicle from the starting point to the current position further comprises:
acquiring contrast between a line and a background color thereof;
and judging whether each line is the vehicle line or not by combining the contrast and the included angle between the vehicle and the lines.
In this embodiment, the contrast is typically a line: background color greater than 1.2: when 1 hour and contained angle also accord with the condition, judge this lines and be the car position line to can get rid of interference such as non-car position line, parking stall line coverage redrawing, reflection of light in the parking stall, it is lower to disturbing parking stall release rate, can promote the recognition rate and the accuracy of parking stall.
In a preferred embodiment, the measuring a gap value between two adjacent parking spaces includes:
judging whether the void value is larger than a preset threshold value or not;
if yes, the parking space is searched again.
In this embodiment, if the gap value between two adjacent parking spaces is greater than the preset threshold, it indicates that the distance between the two adjacent parking spaces is large, for example, the two parking spaces are located in two parking areas, and then the accuracy of the target parking space calculated by the two adjacent parking spaces is low, so that the parking spaces are searched again, thereby avoiding the above situation.
The parking stall type includes: horizontal parking spaces, vertical parking spaces and inclined parking spaces. Furthermore, in order to improve the identification accuracy, a coordinate system can be established in the system, for example, the transverse direction of the vehicle can be taken as an X axis, and the parking space type can be judged according to an included angle between the parking space line and the X axis.
In one embodiment, determining whether each line is a parking space line by combining the contrast and the included angle between the vehicle and the plurality of lines comprises:
and comparing a plurality of included angles between the vehicle and the lines and the contrast, and judging the lines with the same included angle value and contrast as the vehicle-to-vehicle lines.
In a specific embodiment, after determining whether each line is a parking space line by combining the contrast and the included angle between the vehicle and the plurality of lines, the method further includes:
and verifying whether the determined parking space line is correct or not according to the width of the parking space line, the shape of the corner of the parking space line and the parking space continuity.
In a specific embodiment, after the target parking space information is estimated according to the driving distance and the collected parking space information, the method further includes:
judging whether a barrier exists on the target parking space;
if yes, recording the target parking space as the collected parking space, and calculating the target parking space information again according to the driving distance and the collected parking space information, or recording the position of the target parking space as a starting point to collect the driving distance and the parking space information again.
The present invention is applicable to an autonomous vehicle. In order to match the method, the hardware equipment adopted by the invention comprises a camera and an ultrasonic sensor, the camera is used for acquiring clear lines of a vehicle position line, the ultrasonic sensor is used for acquiring obstacles on a parking space, when the vehicle is ready to park, the camera is used for acquiring clear parking space lines, when the vehicle meets the parking space with unclear vehicle position line, the pre-parking space is deduced according to the preorder parking space, and whether the obstacles exist on the pre-parking space can be judged through the ultrasonic sensor.
In one specific embodiment, the parking space is detected by the following steps:
1. initializing a system, wherein the number of the parking space detection is N equal to 0, and the driving distance D is equal to 0;
2. entering a parking space searching mode, starting to record the driving distance D at the moment, and continuously searching the parking space if the driving distance D is smaller than a preset value D until the driving distance D is set to be 0 after the parking space is detected; if D is larger than the preset value D, it is indicated that no parking space is detected in the preset value, at this time, N is set to be 0, D is set to be 0, and the vehicle jumps to continue to search for the parking space;
3. after detecting the parking spaces, judging whether fuzzy parking spaces exist (namely, the parking space lines are not clear and interference exists), if so, judging whether N exceeds a preset number (for example, 2), if so, calculating the target parking spaces and adding 1 to the number of the parking spaces after calculation; if the N does not exceed the preset number, setting N to be 0 and D to be 0, and skipping to the parking place to be searched continuously;
4. if the parking space is judged to be a non-fuzzy parking space, the parking space type is identified, the parking space information is recorded after the parking space type is classified, and the number of the parking spaces is increased by 1;
5. detecting whether the parking space searched and released at this time and the last parking space type are released to be changed or not, if so, indicating that the parking space type is changed, and according to the preorder parking space, the target parking space cannot be calculated, so that setting N to be 0 and D to be 0, and skipping to the parking space to be searched continuously;
6. if no change exists, further judging whether N exceeds a preset number, and if N exceeds the preset number, analyzing parking space information rules and recording; and if the N is not more than the preset number, skipping to continue to search the parking spaces.
Fig. 3 is a block diagram of a parking space detection system according to an embodiment of the present invention. As shown in fig. 3, the present invention also provides a parking space detection system, which generally includes an acquisition unit 10 and a control device 20. The acquisition unit 10 is used to search for a parking space when the vehicle enters the parking area. The control device 20 includes a memory 21 and a processor 22, where the memory 21 stores a control program, and the control program is executed by the processor 22 to implement the parking space detection method according to any one of the embodiments. The processor 22 may be a Central Processing Unit (CPU), a digital processing unit, or the like. The processor 22 transceives data through the communication interface. The memory 11 is used for storing programs executed by the processor. The memory 21 is any medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, or a combination of multiple memories 21. The above-described computing program may be downloaded from a computer-readable storage medium to a corresponding computing/processing device or to a computer or external storage device via a network (e.g., the internet, a local area network, a wide area network, and/or a wireless network).
Thus, it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been illustrated and described in detail herein, many other variations or modifications consistent with the principles of the invention may be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Accordingly, the scope of the invention should be understood and interpreted to cover all such other variations or modifications.