Parking target space detection method, device, electronic device and readable storage medium
By detecting and utilizing obstacle segments on the left and right sides of the original parking space, an optimized parking target parking space is solved, and the problem of inaccurate parking spaces in the existing technology is improved, and the intelligence and safety of the parking system are improved.
Patent Information
- Application Number
- CN202411426012.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The existing automatic parking system may be inaccurate when detecting the target parking space, resulting in scratches during automatic parking.
By detecting whether there are obstacle segments on the left and right sides of the original parking space, if present, a non-interference parking target parking space is generated based on these obstacle segments to ensure that the vehicle's body width and the direction of the obstacle segment are consistent.
The accuracy of the parking target parking space is optimized, the scratches with obstacles are avoided, and the intelligence of the parking system is improved, making its direction in line with human thinking.
Smart Images

Figure CN118928376B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automatic parking, and in particular relates to a parking target space detection method, device, electronic equipment and readable storage medium. Background Art
[0002] The automatic parking system is an advanced driver assistance technology that helps the driver automatically complete the parking process through the coordinated work of on-board sensors, processors and control systems. This technology can greatly improve the convenience and safety of driving, especially for novice drivers or when parking in narrow spaces.
[0003] There are two scenarios for the automatic parking system:
[0004] 1. Moving to a parking space (the vehicle is outside the detected parking space)
[0005] In this scenario, the automatic parking system needs to first detect the target parking space and then move the vehicle towards that space.
[0006] 2. Parking space entry scene (the vehicle is in the detected parking space)
[0007] In this scenario, the automatic parking system also needs to detect the target parking space first and then drive the vehicle into the space.
[0008] However, in the prior art, the automatic parking system only generates a target parking space by detecting the lines on the actual parking space on the ground through a camera on the vehicle, or generates a target parking space through an ultrasonic radar for scenes where there are no lines on the ground. The target parking space obtained in this way may be inaccurate, resulting in scratches during the automatic parking process. Summary of the invention
[0009] Based on this, in order to solve the above technical problems, a parking target space detection method, device, electronic device and readable storage medium are provided.
[0010] The technical solution adopted by the present invention is as follows:
[0011] As a first aspect of the present invention, a method for detecting a parking target space is provided, characterized in that it includes:
[0012] S101, when the vehicle is located outside the detected original parking space or inside the detected original parking space, determining whether the original parking space is a visual parking space;
[0013] S102, if the original parking space is a visual parking space, detecting whether there is an obstacle line segment on at least one of the left and right sides of the original parking space; if so, generating a parking target parking space based on the obstacle line segment, which does not interfere with the corresponding obstacle, is in the same direction as the original parking space, and has a width not less than the body width of the vehicle; if not, using the original parking space as the parking target parking space;
[0014] S103: If the original parking space is not a visual parking space, detect whether there is an obstacle line segment on at least one of the left and right sides of the original parking space; if so, generate a parking target parking space based on the obstacle line segment, which does not interfere with the corresponding obstacle, is in the same direction as the obstacle line segment, and has a width not less than the body width of the vehicle; if not, use the original parking space as the parking target parking space.
[0015] As a second aspect of the present invention, a parking target space detection device is provided, characterized in that it includes:
[0016] The first module is used to determine whether the original parking space is a visual parking space when the vehicle is located outside the original parking space detected or inside the original parking space detected;
[0017] The second module is configured to detect whether there is an obstacle line segment on at least one of the left and right sides of the original parking space if the original parking space is a visual parking space; if so, generate a parking target parking space based on the obstacle line segment that does not interfere with the corresponding obstacle, is consistent with the direction of the original parking space, and has a width not less than the body width of the vehicle; if not, use the original parking space as the parking target parking space;
[0018] The third module is used to detect whether there is an obstacle line segment on at least one of the left and right sides of the original parking space if the original parking space is not a visual parking space. If so, a parking target parking space is generated based on the obstacle line segment, which does not interfere with the corresponding obstacle, is consistent with the direction of the obstacle line segment, and has a width not less than the body width of the vehicle. If not, the original parking space is used as the parking target parking space.
[0019] As a third aspect of the present invention, an electronic device is provided, comprising a storage module, wherein the storage module comprises instructions loaded and executed by a processor, wherein when the instructions are executed, the processor executes a parking target space detection method according to the first aspect.
[0020] As a fourth aspect of the present invention, a computer-readable storage medium is provided, which stores one or more programs. When the one or more programs are executed by a processor, a parking target space detection method according to the first aspect is implemented.
[0021] The present invention optimizes the parking target parking space through the obstacle line segments on the left and right sides of the original parking space, thereby avoiding scratches with obstacles during parking. At the same time, the direction of the optimized parking target parking space conforms to human thinking, thereby improving the intelligence of the parking system. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments:
[0023] Figure 1 A flowchart of a parking target space detection method provided by an embodiment of the present invention;
[0024] Figure 2 A schematic diagram of a parking target space detection device provided by an embodiment of the present invention;
[0025] Figure 3 A schematic diagram of an electronic device provided by an embodiment of the present invention;
[0026] Figure 4 (a) and (b) are exemplary schematic diagrams of situation Q1 and situation Q2 of an embodiment of the present invention, respectively;
[0027] Figure 5 (a) to (f) are exemplary schematic diagrams of situations Q3 to Q8 of the embodiments of the present invention, respectively;
[0028] Figure 6 (a) and (b) are exemplary schematic diagrams of situation Q9 and situation Q10 of an embodiment of the present invention, respectively;
[0029] Figure 7 (a) and (b) are exemplary schematic diagrams of situation Q11 and situation Q12 of an embodiment of the present invention, respectively;
[0030] Figure 8 (a), (b) and (c) are exemplary schematic diagrams of situation Q13, situation Q14 and situation Q15 of an embodiment of the present invention, respectively;
[0031] Fig. 9 (a) and (b) are exemplary schematic diagrams of situation Q16 and situation Q17 of an embodiment of the present invention, respectively. DETAILED DESCRIPTION
[0032] The following will illustrate the implementation methods of the present invention in conjunction with the drawings in the specification. It should be noted that the implementation methods involved in this specification are not exhaustive and do not represent the only implementation methods of the present invention. The following corresponding embodiments are only for the purpose of clearly illustrating the invention content of the patent of the present invention, and are not intended to limit its implementation methods. For ordinary technicians in this field, different forms of changes and modifications can be made on the basis of the description of this embodiment. All obvious changes or modifications that belong to the technical concept and invention content of the present invention are also within the scope of protection of the present invention.
[0033] The present application embodiment provides a parking target parking space detection method, which is used to optimize the parking target parking spaces in two scenarios in the prior art, such as Figure 1 As shown, the specific process is as follows:
[0034] S101. When the vehicle is located outside the detected original parking space or inside the detected original parking space, determine whether the original parking space is a visual parking space.
[0035] Among them, the vehicle is located outside the detected original parking space, which corresponds to the scene of moving towards the parking space, and the vehicle is located inside the detected original parking space, which corresponds to the scene of entering the parking space.
[0036] When there are actual markings on the ground, the original parking space refers to the visual parking space detected by the automatic parking system through the camera on the vehicle. When there are no actual markings on the ground, the original parking space refers to the parking space detected by the automatic parking system through the ultrasonic radar on the vehicle. How to detect the parking space by camera or radar is a conventional method and is not specifically limited here.
[0037] S102. If the original parking space is a visual parking space, detect whether there is an obstacle line segment on at least one of the left and right sides of the original parking space. If so, generate a parking target parking space based on the obstacle line segment, which does not interfere with the corresponding obstacle, is consistent with the direction of the original parking space, and has a width not less than the body width of the vehicle. If not, use the original parking space as the parking target parking space.
[0038] When the original parking space is a visual parking space (i.e., there is an actual parking space marked on the ground), step S102 optimizes the parking target parking space through the obstacle line segments on the left and right sides of the original parking space to avoid scratching against obstacles during parking. At the same time, the optimized parking target parking space is consistent with the direction of the actual marked parking space, which is in line with human thinking and improves the intelligence of the parking system.
[0039] The following describes the situations where there are obstacle segments on both sides and the situation where there is an obstacle segment on one side.
[0040] 1. Obstacle segments are detected on both sides of the original parking space
[0041] 201. When the obstacle line segments on the left and right sides are parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0042] Case Q1: If the obstacle line segments on the left and right sides do not invade the original parking space, the obstacle line segments on the left and right sides are used as the left and right boundaries to generate the parking target parking space.
[0043] For example, Figure 4 As shown in (a), the obstacle segments a and b on the left and right sides do not invade the original parking space, and the line segments a and b are used as the left and right boundaries to generate the parking target space.
[0044] Case Q2: If at least one of the obstacle line segments on the left and right sides invades the original parking space, determine whether the distance between the obstacle line segments on the left and right sides is not less than the body width of the vehicle. If so, use the obstacle line segments on the left and right sides as the left and right boundaries to generate the parking target space. Otherwise, exit if failed.
[0045] For example, Figure 4 As shown in (b), obstacle segment a invades the original parking space, and obstacle segment b does not invade the original parking space. If the distance between a and b is not less than the body width of the vehicle, segments a and b are used as left and right boundaries to generate the parking target space. If the distance between a and b is less than the body width of the vehicle, the process fails and exits.
[0046] 202. When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0047] Case Q3: If the obstacle line segments on the left and right sides do not invade the original parking space, and one of the obstacle line segments is not parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-parallel obstacle line segment that is closer to the original parking space, and the generated line segment and another parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space.
[0048] For example, Figure 5 As shown in (a), the obstacle segments a and b do not invade the original parking space, segment a is not parallel to the left and right boundaries of the original parking space, segment b is parallel to the left and right boundaries of the original parking space, and the endpoint a1 on segment a that is closer to the original parking space is generated based on endpoint a1. The target parking space is generated by using segment c and segment b as the left and right boundaries.
[0049] Case Q4: If the obstacle line segments on the left and right sides do not invade the original parking space and are not parallel to the left and right boundaries of the original parking space, then based on the endpoints of the obstacle line segments on the left and right sides that are closer to the original parking space, line segments parallel to the left and right boundaries of the original parking space are generated respectively, and the two generated line segments are used as the left and right boundaries to generate the parking target space.
[0050] For example, Figure 5 As shown in (b), the obstacle segments a and b do not invade the original parking space, and are not parallel to the left and right boundaries of the original parking space. The endpoint on segment a that is closer to the original parking space is a1, and the endpoint on segment b that is closer to the original parking space is b1. Based on endpoints a1 and b1, line segments c and d that are parallel to the left and right boundaries of the original parking space are generated respectively, and line segments c and d are used as the left and right boundaries to generate the parking target space.
[0051] Case Q5: If one of the obstacle line segments on the left and right sides invades the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment is parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-parallel obstacle line segment that invades the original parking space more, and it is determined whether the distance between the generated line segment and the other parallel obstacle line segment is not less than the body width of the vehicle. If so, the two are used as the left and right boundaries to generate the parking target parking space.
[0052] For example, Figure 5 As shown in (c), obstacle line segment a invades the original parking space and is not parallel to the left and right boundaries of the original parking space, obstacle line segment b is parallel to the left and right boundaries of the original parking space, and the endpoint a1 at which obstacle line segment a invades the original parking space the most is generated. Based on endpoint a1, a line segment c is generated that is parallel to the left and right boundaries of the original parking space. If the distance between line segment c and obstacle line segment b is not less than the body width of the vehicle, the two are used as the left and right boundaries to generate the parking target parking space. Otherwise, the program fails and exits.
[0053] Case Q6: If one of the obstacle line segments on the left and right sides does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment invades the original parking space and is parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint on the non-parallel obstacle line segment that is closer to the original parking space, and it is determined whether the distance between the generated line segment and the other parallel obstacle line segment is not less than the body width of the vehicle. If so, the two are used as the left and right boundaries to generate the parking target parking space.
[0054] For example, Figure 5As shown in (d), obstacle line segment a does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space. Obstacle line segment b invades the original parking space and is parallel to the left and right boundaries of the original parking space. The endpoint of obstacle line segment a that is closer to the original parking space is a1. Based on endpoint a1, a line segment c is generated that is parallel to the left and right boundaries of the original parking space. If the distance between line segment c and obstacle line segment b is not less than the body width of the vehicle, the two are used as the left and right boundaries to generate the parking target parking space. Otherwise, the program fails and exits.
[0055] Case Q7: If one of the obstacle line segments on the left and right sides invades the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the invading obstacle line segment that invades the original parking space more, and a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-invading obstacle line segment that is closer to the original parking space. It is determined whether the distance between the two generated line segments is not less than the body width of the vehicle. If so, the two are used as the left and right boundaries to generate the parking target parking space.
[0056] For example, Figure 5 As shown in (e), obstacle segment a invades the original parking space and is not parallel to the left and right boundaries of the original parking space, obstacle segment b does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space, the endpoint of segment a that invades the original parking space more is a1, and the endpoint of segment b that is closer to the original parking space is b1. Based on endpoints a1 and b1, line segments c and d parallel to the left and right boundaries of the original parking space are generated respectively. If the distance between line segments c and d is not less than the body width of the vehicle, the two are used as the left and right boundaries to generate the parking target parking space. Otherwise, the program fails and exits.
[0057] Case Q8: If the obstacle line segments on the left and right sides both invade the original parking space and are not parallel to the left and right boundaries of the original parking space, then based on the endpoints on the left and right sides of the obstacle line segments that invade the original parking space more, generate line segments parallel to the left and right boundaries of the original parking space, and determine whether the spacing between the two generated line segments is not less than the body width of the vehicle. If so, use the two as the left and right boundaries to generate the parking target space.
[0058] For example, Figure 5 As shown in (f), obstacle segments a and b both invade the original parking space and are not parallel to the left and right boundaries of the original parking space. The endpoints of obstacle segments a and b that invade the original parking space more are a1 and b1 respectively. Based on endpoints a1 and b1, line segments c and d parallel to the left and right boundaries of the original parking space are generated respectively. If the distance between line segments c and d is not less than the body width of the vehicle, the two are used as the left and right boundaries to generate the parking target space. Otherwise, the program fails and exits.
[0059] 2. Detect that there is an obstacle line segment on one of the left and right sides of the original parking space
[0060] 203. When the obstacle line segment is parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0061] Case Q9: If the obstacle line segment does not intrude into the original parking space, the obstacle line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located are used as the left and right boundaries to generate the parking target parking space.
[0062] For example, Figure 6 As shown in (a), the obstacle line segment a does not invade the original parking space, and the line segment a and the other side boundary b of the original parking space are used as the left and right boundaries to generate the parking target parking space.
[0063] Case Q10: If the obstacle line segment intrudes into the original parking space, determine whether the distance between the obstacle line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located is not less than the body width of the vehicle. If so, use the obstacle line segment and the above-mentioned other side boundary as the left and right boundaries to generate the parking target space. If not, based on the obstacle line segment, generate a line segment outside the above-mentioned other side boundary that is parallel to the obstacle line segment and has a distance not less than the body width of the vehicle, and use the obstacle line segment and the generated line segment as the left and right boundaries to generate the parking target space.
[0064] For example, Figure 6 As shown in (b), the obstacle line segment a invades the original parking space. If the distance between line segment a and the other side boundary b of the original parking space is not less than the body width of the vehicle, the line segment a and boundary b are used as the left and right boundaries to generate the parking target space. Otherwise, based on the line segment a, a line segment c parallel to the line segment a and with a distance not less than the body width of the vehicle is generated outside the boundary b, and the line segments a and c are used as the left and right boundaries to generate the parking target space.
[0065] 204. When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0066] Case Q11: If the obstacle line segment does not invade the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the obstacle line segment that is closer to the original parking space, and the generated line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located are used as the left and right boundaries to generate the parking target parking space.
[0067] For example, Figure 7As shown in (a), the obstacle line segment a does not invade the original parking space. The endpoint of the obstacle line segment a that is closer to the original parking space is a1. Based on the endpoint a1, a line segment b is generated that is parallel to the left and right boundaries of the original parking space. The line segment b and the other side boundary c of the original parking space relative to the side where the obstacle line segment a is located are used as the left and right boundaries to generate the parking target parking space.
[0068] Case Q12: If the obstacle line segment invades the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoints of the obstacle line segment that invade the original parking space more, and it is determined whether the distance between the generated line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located is not less than the body width of the vehicle. If so, the generated line segment and the above-mentioned other side boundary are used as the left and right boundaries to generate the parking target space. If not, a line segment parallel to the generated line segment and with a distance not less than the body width of the vehicle is generated outside the above-mentioned other side boundary based on the generated line segment, and the two generated line segments are used as the left and right boundaries to generate the parking target space.
[0069] For example, Figure 7 As shown in (b), the obstacle line segment a invades the original parking space, and the endpoint a1 on the obstacle line segment a that invades the original parking space more is generated. Based on the endpoint a1, a line segment b is generated that is parallel to the left and right boundaries of the original parking space. It is determined whether the distance between the line segment b and the other side boundary c of the original parking space relative to the side where the obstacle line segment a is located is not less than the body width of the vehicle. If so, the line segment b and the boundary c are used as the left and right boundaries to generate the parking target parking space. If not, based on the line segment b, a line segment d is generated outside the boundary c that is parallel to the line segment b and the distance is not less than the body width of the vehicle. The line segments b and d are used as the left and right boundaries to generate the parking target parking space.
[0070] S103. If the original parking space is not a visual parking space, detect whether there is an obstacle line segment on at least one of the left and right sides of the original parking space. If so, generate a parking target parking space based on the obstacle line segment, which does not interfere with the corresponding obstacle, is consistent with the direction of the obstacle line segment, and has a width not less than the body width of the vehicle. If not, use the original parking space as the parking target parking space.
[0071] When the original parking space is not a visual parking space (i.e., there is no actual parking space marked on the ground), step S103 optimizes the parking target parking space by using the obstacle line segments on the left and right sides of the original parking space to avoid scratching against obstacles during parking. At the same time, the optimized parking target parking space is consistent with the direction of the obstacle line segments (i.e., consistent with the parking directions of the vehicles on the left and right sides), which conforms to human thinking and improves the intelligence of the parking system.
[0072] The following describes the situations where there are obstacle segments on both sides and the situation where there is an obstacle segment on one side.
[0073] 1. Obstacle segments are detected on both sides of the original parking space
[0074] 301. When the obstacle line segments on the left and right sides are parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is the same as that of the above 201, which will not be described in detail here.
[0075] 302. When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0076] Case Q13: If the obstacle line segments on the left and right sides do not invade the original parking space, then select the obstacle line segment with a larger inclination angle with the left and right boundaries of the original parking space, and generate a line segment parallel to another obstacle line segment based on the endpoint of the obstacle line segment closer to the original parking space. The generated line segment and the parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space.
[0077] Among them, the obstacle line segments parallel to the left and right boundaries of the original parking space are regarded as having an inclination angle of 0 degrees, the same below.
[0078] For example, Figure 8 As shown in (a), obstacle line segments a and b do not invade the original parking space, and neither is parallel to the left and right boundaries of the original parking space. The inclination angle of obstacle line segment a is larger, and its endpoint closer to the original parking space is a1. Based on endpoint a1, a line segment c parallel to obstacle line segment b is generated, and line segment c and obstacle line segment b are used as left and right boundaries to generate the parking target space, that is, the direction of the parking target space is consistent with the obstacle line segment b with a smaller inclination angle.
[0079] Case Q14: If at least one of the obstacle line segments on the left and right sides invades the original parking space, and the obstacle line segment with a larger inclination angle to the left and right boundaries of the original parking space does not invade the original parking space, then a line segment parallel to the other obstacle line segment is generated based on the endpoint on the obstacle line segment with a larger inclination angle that is closer to the original parking space, and it is determined whether the distance between the generated line segment and the parallel obstacle line segment is not less than the body width of the vehicle. If so, the generated line segment and the parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space, otherwise, the system exits in failure.
[0080] For example, Figure 8 As shown in (b), obstacle line segment a does not invade the original parking space, but obstacle line segment b invades the original parking space. The inclination angle of obstacle line segment a is large, and its endpoint closer to the original parking space is a1. Based on endpoint a1, a line segment c parallel to obstacle line segment b is generated. If the distance between line segment c and obstacle line segment b is not less than the body width of the vehicle, line segment c and obstacle line segment b are used as left and right boundaries to generate the parking target space. Otherwise, the program fails and exits.
[0081] Case Q15: If at least one of the obstacle line segments on the left and right sides invades the original parking space, and the obstacle line segment with a larger inclination angle to the left and right boundaries of the original parking space invades the original parking space, then a line segment parallel to the other obstacle line segment is generated based on the endpoint on the obstacle line segment with a larger inclination angle that invades the original parking space more, and it is determined whether the spacing between the generated line segment and the parallel obstacle line segment is not less than the body width of the vehicle. If so, the generated line segment and the parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space, otherwise, the process fails and exits.
[0082] For example, Figure 8 As shown in (c), both obstacle segments a and b invade the original parking space. The inclination angle of obstacle segment a is larger, and the endpoint a1 that invades the original parking space more is generated based on endpoint a1. A line segment c parallel to obstacle segment b is generated based on endpoint a1. If the distance between line segment c and obstacle segment b is not less than the body width of the vehicle, line segment c and obstacle segment b are used as left and right boundaries to generate the parking target space. Otherwise, the program fails and exits.
[0083] 2. Detect that there is an obstacle line segment on one of the left and right sides of the original parking space
[0084] 303. When the obstacle line segment is parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is the same as that of the above 203, which will not be described in detail here.
[0085] 304. When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0086] Case Q16: If the obstacle line segment does not invade the original parking space, then take the other side boundary relative to the side where the obstacle line segment is located from the left and right boundaries of the original parking space, and based on the endpoint on the obstacle line segment closer to the original parking space, find the boundary line endpoint closer to the above endpoint from the above other side boundary, and generate a line segment parallel to the obstacle line segment based on the boundary line endpoint, and use the generated line segment and the obstacle line segment as the left and right boundaries to generate the parking target parking space.
[0087] For example, Fig. 9 As shown in (a), the obstacle line segment a does not invade the original parking space, and its endpoint closer to the original parking space is a1. From the left and right boundaries of the original parking space, take the other side boundary b relative to the side where the obstacle line segment a is located, find the boundary line endpoint b1 closer to the endpoint a1 on boundary b, generate a line segment c parallel to the obstacle line segment a based on the boundary line endpoint b1, and use the line segment c and the obstacle line segment a as the left and right boundaries to generate the parking target parking space.
[0088] Case Q17: If the obstacle line segment invades the original parking space, then take the other side boundary relative to the side where the obstacle line segment is located from the left and right boundaries of the original parking space, and based on the endpoint on the obstacle line segment that invades the original parking space more, find the boundary line endpoint closer to the above endpoint from the above other side boundary, and generate a line segment parallel to the obstacle line segment based on the boundary line endpoint, and determine whether the distance between the generated line segment and the obstacle line segment is not less than the body width of the vehicle. If so, use the generated line segment and the obstacle line segment as the left and right boundaries to generate the parking target parking space. If not, translate the generated line segment so that the distance between it and the obstacle line segment is not less than the body width of the vehicle, and use the translated line segment and the obstacle line segment as the left and right boundaries to generate the parking target parking space.
[0089] For example, Fig. 9 As shown in (b), the obstacle line segment a invades the original parking space, and the endpoint a1 that invades the original parking space more is taken from the left and right boundaries of the original parking space. The other side boundary b relative to the side where the obstacle line segment a is located is taken, and the boundary line endpoint b1 that is closer to the endpoint a1 is found from the boundary b. Based on the boundary line endpoint b1, a line segment c parallel to the obstacle line segment a is generated. If the distance between the line segment c and the obstacle line segment a is not less than the body width of the vehicle, the line segment c and the obstacle line segment a are used as the left and right boundaries to generate the parking target parking space. Otherwise, the line segment c is translated so that the distance between it and the obstacle line segment a is not less than the body width of the vehicle, and the translated line segment c and the obstacle line segment a are used as the left and right boundaries to generate the parking target parking space.
[0090] In this embodiment, when the vehicle is outside the detected original parking space, steps S102 and S103 detect the obstacle line segments on the left and right sides of the original parking space through the camera on the vehicle. When the vehicle is inside the detected original parking space, steps S102 and S103 detect the obstacle line segments on the left and right sides of the original parking space through the ultrasonic radar on the vehicle.
[0091] The obstacle may be a vehicle, a wall or other object. Taking a vehicle obstacle as an example, when the vehicle is outside the detected original parking space, the wheels of the vehicle obstacle can be identified in the image captured by the camera to generate an obstacle line segment. When the vehicle is inside the detected original parking space, the sound waves reflected by the vehicle obstacle are used to generate an obstacle line segment.
[0092] As can be seen from the above, a parking target space detection method provided in an embodiment of the present application optimizes the parking target space through the obstacle line segments on the left and right sides of the original parking space to avoid scratching with obstacles during parking. At the same time, the direction of the optimized parking target space is consistent with human thinking, thereby improving the intelligence of the parking system.
[0093] The following will describe in detail one or more embodiments of the parking target space detection device of the present invention. Those skilled in the art will appreciate that these detection devices can be configured using commercially available hardware components through the steps taught in this solution. Figure 2 A parking target space detection device provided by an embodiment of the present invention is shown. Figure 2 As shown, the detection device includes a first module 11 , a second module 12 and a third module 13 .
[0094] The first module 11 is used to determine whether the original parking space is a visual parking space when the vehicle is located outside the detected original parking space or inside the detected original parking space.
[0095] Among them, the vehicle is located outside the detected original parking space, which corresponds to the scene of moving towards the parking space, and the vehicle is located inside the detected original parking space, which corresponds to the scene of entering the parking space.
[0096] When there are actual markings on the ground, the original parking space refers to the visual parking space detected by the automatic parking system through the camera on the vehicle. When there are no actual markings on the ground, the original parking space refers to the parking space detected by the automatic parking system through the ultrasonic radar on the vehicle. How to detect the parking space by camera or radar is a conventional method and is not specifically limited here.
[0097] The second module 12 is used to detect whether there is an obstacle line segment on at least one of the left and right sides of the original parking space if the original parking space is a visual parking space. If so, a parking target parking space is generated based on the obstacle line segment, which does not interfere with the corresponding obstacle, is consistent with the direction of the original parking space, and has a width not less than the body width of the vehicle. If not, the original parking space is used as the parking target parking space.
[0098] When the original parking space is a visual parking space (i.e., there is an actual parking space marked on the ground), the second module 12 optimizes the parking target space through the obstacle line segments on the left and right sides of the original parking space to avoid scratching against obstacles during parking. At the same time, the optimized parking target space is consistent with the direction of the actual marked parking space, which is in line with human thinking and improves the intelligence of the parking system.
[0099] The following describes the situations where there are obstacle segments on both sides and the situation where there is an obstacle segment on one side.
[0100] 1. Obstacle segments are detected on both sides of the original parking space
[0101] 201. When the obstacle line segments on the left and right sides are parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0102] Case Q1: If the obstacle line segments on the left and right sides do not invade the original parking space, the obstacle line segments on the left and right sides are used as the left and right boundaries to generate the parking target parking space.
[0103] For example, Figure 4 As shown in (a), the obstacle segments a and b on the left and right sides do not invade the original parking space, and the line segments a and b are used as the left and right boundaries to generate the parking target space.
[0104] Case Q2: If at least one of the obstacle line segments on the left and right sides invades the original parking space, determine whether the distance between the obstacle line segments on the left and right sides is not less than the body width of the vehicle. If so, use the obstacle line segments on the left and right sides as the left and right boundaries to generate the parking target space. Otherwise, exit if failed.
[0105] For example, Figure 4 As shown in (b), obstacle segment a invades the original parking space, and obstacle segment b does not invade the original parking space. If the distance between a and b is not less than the body width of the vehicle, segments a and b are used as left and right boundaries to generate the parking target space. If the distance between a and b is less than the body width of the vehicle, the process fails and exits.
[0106] 202. When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0107] Case Q3: If the obstacle line segments on the left and right sides do not invade the original parking space, and one of the obstacle line segments is not parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-parallel obstacle line segment that is closer to the original parking space, and the generated line segment and another parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space.
[0108] For example, Figure 5 As shown in (a), the obstacle segments a and b do not invade the original parking space, segment a is not parallel to the left and right boundaries of the original parking space, segment b is parallel to the left and right boundaries of the original parking space, and the endpoint a1 on segment a that is closer to the original parking space is generated based on endpoint a1. The target parking space is generated by using segment c and segment b as the left and right boundaries.
[0109] Case Q4: If the obstacle line segments on the left and right sides do not invade the original parking space and are not parallel to the left and right boundaries of the original parking space, then based on the endpoints of the obstacle line segments on the left and right sides that are closer to the original parking space, line segments parallel to the left and right boundaries of the original parking space are generated respectively, and the two generated line segments are used as the left and right boundaries to generate the parking target space.
[0110] For example, Figure 5As shown in (b), the obstacle segments a and b do not invade the original parking space, and are not parallel to the left and right boundaries of the original parking space. The endpoint on segment a that is closer to the original parking space is a1, and the endpoint on segment b that is closer to the original parking space is b1. Based on endpoints a1 and b1, line segments c and d that are parallel to the left and right boundaries of the original parking space are generated respectively, and line segments c and d are used as the left and right boundaries to generate the parking target space.
[0111] Case Q5: If one of the obstacle line segments on the left and right sides invades the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment is parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-parallel obstacle line segment that invades the original parking space more, and it is determined whether the distance between the generated line segment and the other parallel obstacle line segment is not less than the body width of the vehicle. If so, the two are used as the left and right boundaries to generate the parking target parking space.
[0112] For example, Figure 5 As shown in (c), obstacle line segment a invades the original parking space and is not parallel to the left and right boundaries of the original parking space, obstacle line segment b is parallel to the left and right boundaries of the original parking space, and the endpoint a1 at which obstacle line segment a invades the original parking space the most is generated. Based on endpoint a1, a line segment c is generated that is parallel to the left and right boundaries of the original parking space. If the distance between line segment c and obstacle line segment b is not less than the body width of the vehicle, the two are used as the left and right boundaries to generate the parking target parking space. Otherwise, the program fails and exits.
[0113] Case Q6: If one of the obstacle line segments on the left and right sides does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment invades the original parking space and is parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint on the non-parallel obstacle line segment that is closer to the original parking space, and it is determined whether the distance between the generated line segment and the other parallel obstacle line segment is not less than the body width of the vehicle. If so, the two are used as the left and right boundaries to generate the parking target parking space.
[0114] For example, Figure 5 As shown in (d), obstacle line segment a does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space. Obstacle line segment b invades the original parking space and is parallel to the left and right boundaries of the original parking space. The endpoint of obstacle line segment a that is closer to the original parking space is a1. Based on endpoint a1, a line segment c is generated that is parallel to the left and right boundaries of the original parking space. If the distance between line segment c and obstacle line segment b is not less than the body width of the vehicle, the two are used as the left and right boundaries to generate the parking target parking space. Otherwise, the program fails and exits.
[0115] Case Q7: If one of the obstacle line segments on the left and right sides invades the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the invading obstacle line segment that invades the original parking space more, and a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-invading obstacle line segment that is closer to the original parking space. It is determined whether the distance between the two generated line segments is not less than the body width of the vehicle. If so, the two are used as the left and right boundaries to generate the parking target parking space.
[0116] For example, Figure 5 As shown in (e), obstacle segment a invades the original parking space and is not parallel to the left and right boundaries of the original parking space, obstacle segment b does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space, the endpoint of segment a that invades the original parking space more is a1, and the endpoint of segment b that is closer to the original parking space is b1. Based on endpoints a1 and b1, line segments c and d parallel to the left and right boundaries of the original parking space are generated respectively. If the distance between line segments c and d is not less than the body width of the vehicle, the two are used as the left and right boundaries to generate the parking target parking space. Otherwise, the program fails and exits.
[0117] Case Q8: If the obstacle line segments on the left and right sides both invade the original parking space and are not parallel to the left and right boundaries of the original parking space, then based on the endpoints on the left and right sides of the obstacle line segments that invade the original parking space more, generate line segments parallel to the left and right boundaries of the original parking space, and determine whether the spacing between the two generated line segments is not less than the body width of the vehicle. If so, use the two as the left and right boundaries to generate the parking target space.
[0118] For example, Figure 5 As shown in (f), obstacle segments a and b both invade the original parking space and are not parallel to the left and right boundaries of the original parking space. The endpoints of obstacle segments a and b that invade the original parking space more are a1 and b1 respectively. Based on endpoints a1 and b1, line segments c and d parallel to the left and right boundaries of the original parking space are generated respectively. If the distance between line segments c and d is not less than the body width of the vehicle, the two are used as the left and right boundaries to generate the parking target space. Otherwise, the program fails and exits.
[0119] 2. Detect that there is an obstacle line segment on one of the left and right sides of the original parking space
[0120] 203. When the obstacle line segment is parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0121] Case Q9: If the obstacle line segment does not intrude into the original parking space, the obstacle line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located are used as the left and right boundaries to generate the parking target parking space.
[0122] For example, Figure 6 As shown in (a), the obstacle line segment a does not invade the original parking space, and the line segment a and the other side boundary b of the original parking space are used as the left and right boundaries to generate the parking target parking space.
[0123] Case Q10: If the obstacle line segment intrudes into the original parking space, determine whether the distance between the obstacle line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located is not less than the body width of the vehicle. If so, use the obstacle line segment and the above-mentioned other side boundary as the left and right boundaries to generate the parking target space. If not, based on the obstacle line segment, generate a line segment outside the above-mentioned other side boundary that is parallel to the obstacle line segment and has a distance not less than the body width of the vehicle, and use the obstacle line segment and the generated line segment as the left and right boundaries to generate the parking target space.
[0124] For example, Figure 6 As shown in (b), the obstacle line segment a invades the original parking space. If the distance between line segment a and the other side boundary b of the original parking space is not less than the body width of the vehicle, the line segment a and boundary b are used as the left and right boundaries to generate the parking target space. Otherwise, based on the line segment a, a line segment c parallel to the line segment a and with a distance not less than the body width of the vehicle is generated outside the boundary b, and the line segments a and c are used as the left and right boundaries to generate the parking target space.
[0125] 204. When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0126] Case Q11: If the obstacle line segment does not invade the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the obstacle line segment that is closer to the original parking space, and the generated line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located are used as the left and right boundaries to generate the parking target parking space.
[0127] For example, Figure 7 As shown in (a), the obstacle line segment a does not invade the original parking space. The endpoint of the obstacle line segment a that is closer to the original parking space is a1. Based on the endpoint a1, a line segment b is generated that is parallel to the left and right boundaries of the original parking space. The line segment b and the other side boundary c of the original parking space relative to the side where the obstacle line segment a is located are used as the left and right boundaries to generate the parking target parking space.
[0128] Case Q12: If the obstacle line segment invades the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoints of the obstacle line segment that invade the original parking space more, and it is determined whether the distance between the generated line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located is not less than the body width of the vehicle. If so, the generated line segment and the above-mentioned other side boundary are used as the left and right boundaries to generate the parking target space. If not, a line segment parallel to the generated line segment and with a distance not less than the body width of the vehicle is generated outside the above-mentioned other side boundary based on the generated line segment, and the two generated line segments are used as the left and right boundaries to generate the parking target space.
[0129] For example, Figure 7 As shown in (b), the obstacle line segment a invades the original parking space, and the endpoint a1 on the obstacle line segment a that invades the original parking space more is generated. Based on the endpoint a1, a line segment b is generated that is parallel to the left and right boundaries of the original parking space. It is determined whether the distance between the line segment b and the other side boundary c of the original parking space relative to the side where the obstacle line segment a is located is not less than the body width of the vehicle. If so, the line segment b and the boundary c are used as the left and right boundaries to generate the parking target parking space. If not, based on the line segment b, a line segment d is generated outside the boundary c that is parallel to the line segment b and the distance is not less than the body width of the vehicle. The line segments b and d are used as the left and right boundaries to generate the parking target parking space.
[0130] The third module 13 is used to detect whether there is an obstacle line segment on at least one of the left and right sides of the original parking space if the original parking space is not a visual parking space. If so, a parking target parking space is generated based on the obstacle line segment, which does not interfere with the corresponding obstacle, is consistent with the direction of the obstacle line segment, and has a width not less than the body width of the vehicle. If not, the original parking space is used as the parking target parking space.
[0131] When the original parking space is not a visual parking space (i.e., there is no actual parking space marked on the ground), the third module 13 optimizes the parking target space through the obstacle line segments on the left and right sides of the original parking space to avoid scratching against obstacles during parking. At the same time, the optimized parking target space is consistent with the direction of the obstacle line segments (i.e., consistent with the parking direction of the vehicles on the left and right sides), which is in line with human thinking and improves the intelligence of the parking system.
[0132] The following describes the situations where there are obstacle segments on both sides and the situation where there is an obstacle segment on one side.
[0133] 1. Obstacle segments are detected on both sides of the original parking space
[0134] 301. When the obstacle line segments on the left and right sides are parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is the same as that of the above 201, which will not be described in detail here.
[0135] 302. When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0136] Case Q13: If the obstacle line segments on the left and right sides do not invade the original parking space, then select the obstacle line segment with a larger inclination angle with the left and right boundaries of the original parking space, and generate a line segment parallel to another obstacle line segment based on the endpoint of the obstacle line segment closer to the original parking space. The generated line segment and the parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space.
[0137] Among them, the obstacle line segments parallel to the left and right boundaries of the original parking space are regarded as having an inclination angle of 0 degrees, the same below.
[0138] For example, Figure 8 As shown in (a), obstacle line segments a and b do not invade the original parking space, and neither is parallel to the left and right boundaries of the original parking space. The inclination angle of obstacle line segment a is larger, and its endpoint closer to the original parking space is a1. Based on endpoint a1, a line segment c parallel to obstacle line segment b is generated, and line segment c and obstacle line segment b are used as left and right boundaries to generate the parking target space, that is, the direction of the parking target space is consistent with the obstacle line segment b with a smaller inclination angle.
[0139] Case Q14: If at least one of the obstacle line segments on the left and right sides invades the original parking space, and the obstacle line segment with a larger inclination angle to the left and right boundaries of the original parking space does not invade the original parking space, then a line segment parallel to the other obstacle line segment is generated based on the endpoint on the obstacle line segment with a larger inclination angle that is closer to the original parking space, and it is determined whether the distance between the generated line segment and the parallel obstacle line segment is not less than the body width of the vehicle. If so, the generated line segment and the parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space, otherwise, the system exits in failure.
[0140] For example, Figure 8 As shown in (b), obstacle line segment a does not invade the original parking space, but obstacle line segment b invades the original parking space. The inclination angle of obstacle line segment a is large, and its endpoint closer to the original parking space is a1. Based on endpoint a1, a line segment c parallel to obstacle line segment b is generated. If the distance between line segment c and obstacle line segment b is not less than the body width of the vehicle, line segment c and obstacle line segment b are used as left and right boundaries to generate the parking target space. Otherwise, the program fails and exits.
[0141] Case Q15: If at least one of the obstacle line segments on the left and right sides invades the original parking space, and the obstacle line segment with a larger inclination angle to the left and right boundaries of the original parking space invades the original parking space, then a line segment parallel to the other obstacle line segment is generated based on the endpoint on the obstacle line segment with a larger inclination angle that invades the original parking space more, and it is determined whether the spacing between the generated line segment and the parallel obstacle line segment is not less than the body width of the vehicle. If so, the generated line segment and the parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space, otherwise, the process fails and exits.
[0142] For example, Figure 8 As shown in (c), both obstacle segments a and b invade the original parking space. The inclination angle of obstacle segment a is larger, and the endpoint a1 that invades the original parking space more is generated based on endpoint a1. A line segment c parallel to obstacle segment b is generated based on endpoint a1. If the distance between line segment c and obstacle segment b is not less than the body width of the vehicle, line segment c and obstacle segment b are used as left and right boundaries to generate the parking target space. Otherwise, the program fails and exits.
[0143] 2. Detect that there is an obstacle line segment on one of the left and right sides of the original parking space
[0144] 303. When the obstacle line segment is parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is the same as that of the above 203, which will not be described in detail here.
[0145] 304. When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, the specific process of generating the parking target parking space is as follows:
[0146] Case Q16: If the obstacle line segment does not invade the original parking space, then take the other side boundary relative to the side where the obstacle line segment is located from the left and right boundaries of the original parking space, and based on the endpoint on the obstacle line segment closer to the original parking space, find the boundary line endpoint closer to the above endpoint from the above other side boundary, and generate a line segment parallel to the obstacle line segment based on the boundary line endpoint, and use the generated line segment and the obstacle line segment as the left and right boundaries to generate the parking target parking space.
[0147] For example, Fig. 9 As shown in (a), the obstacle line segment a does not invade the original parking space, and its endpoint closer to the original parking space is a1. From the left and right boundaries of the original parking space, take the other side boundary b relative to the side where the obstacle line segment a is located, find the boundary line endpoint b1 closer to the endpoint a1 on boundary b, generate a line segment c parallel to the obstacle line segment a based on the boundary line endpoint b1, and use the line segment c and the obstacle line segment a as the left and right boundaries to generate the parking target parking space.
[0148] Case Q17: If the obstacle line segment invades the original parking space, then take the other side boundary relative to the side where the obstacle line segment is located from the left and right boundaries of the original parking space, and based on the endpoint on the obstacle line segment that invades the original parking space more, find the boundary line endpoint closer to the above endpoint from the above other side boundary, and generate a line segment parallel to the obstacle line segment based on the boundary line endpoint, and determine whether the distance between the generated line segment and the obstacle line segment is not less than the body width of the vehicle. If so, use the generated line segment and the obstacle line segment as the left and right boundaries to generate the parking target parking space. If not, translate the generated line segment so that the distance between it and the obstacle line segment is not less than the body width of the vehicle, and use the translated line segment and the obstacle line segment as the left and right boundaries to generate the parking target parking space.
[0149] For example, Fig. 9 As shown in (b), the obstacle line segment a invades the original parking space, and the endpoint a1 that invades the original parking space more is taken from the left and right boundaries of the original parking space. The other side boundary b relative to the side where the obstacle line segment a is located is taken, and the boundary line endpoint b1 that is closer to the endpoint a1 is found from the boundary b. Based on the boundary line endpoint b1, a line segment c parallel to the obstacle line segment a is generated. If the distance between the line segment c and the obstacle line segment a is not less than the body width of the vehicle, the line segment c and the obstacle line segment a are used as the left and right boundaries to generate the parking target parking space. Otherwise, the line segment c is translated so that the distance between it and the obstacle line segment a is not less than the body width of the vehicle, and the translated line segment c and the obstacle line segment a are used as the left and right boundaries to generate the parking target parking space.
[0150] In summary, the parking target space detection device provided in the above embodiment can execute a parking target space detection method provided in the above embodiments.
[0151] The same as above concept, Figure 2 The structure of the edge straight line feature extraction device shown can be implemented as an electronic device. Figure 3 A schematic block diagram of the structure of an electronic device provided by an embodiment of the present invention is shown.
[0152] Exemplarily, the electronic device includes a storage module 21 and a processor 22, the storage module 21 includes instructions loaded and executed by the processor 22, and when the instructions are executed, the processor 22 executes the steps according to various exemplary embodiments of the present invention described in the above-mentioned parking target parking space detection method section of this specification.
[0153] It should be understood that the processor 22 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0154] A computer-readable storage medium is also provided in an embodiment of the present invention. The computer-readable storage medium stores one or more programs. When the one or more programs are executed by a processor, the steps of various exemplary embodiments of the present invention described in the above-mentioned parking target parking space detection method are implemented.
[0155] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer-readable storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0156] As is known to those of ordinary skill in the art, the term computer-readable storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0157] Exemplarily, the computer-readable storage medium may be an internal storage module of the electronic device of the aforementioned embodiment, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device.
[0158] The electronic device and computer-readable storage medium provided in the aforementioned embodiments optimize the target parking space through the obstacle line segments on the left and right sides of the original parking space to avoid scratches with obstacles during parking. At the same time, the direction of the optimized target parking space is consistent with human thinking, thereby improving the intelligence of the parking system.
[0159] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A parking target space detection method, characterized in that: include: S101, when the vehicle is located outside the detected original parking space or inside the detected original parking space, determining whether the original parking space is a visual parking space; S102, if the original parking space is a visual parking space, detecting whether there is an obstacle line segment on at least one of the left and right sides of the original parking space; if so, generating a parking target parking space based on the obstacle line segment, which does not interfere with the corresponding obstacle, is in the same direction as the original parking space, and has a width not less than the body width of the vehicle; if not, using the original parking space as the parking target parking space; S103, if the original parking space is not a visual parking space, detecting whether there is an obstacle line segment on at least one of the left and right sides of the original parking space; if so, generating a parking target parking space based on the obstacle line segment, which does not interfere with the corresponding obstacle, is in the same direction as the obstacle line segment, and has a width not less than the body width of the vehicle; if not, using the original parking space as the parking target parking space; When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, both S102 and S103 further include: When the obstacle line segments on the left and right sides are parallel to the left and right boundaries of the original parking space, if the obstacle line segments on the left and right sides do not invade the original parking space, the obstacle line segments on the left and right sides are used as the left and right boundaries to generate the parking target parking space; When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, the S102 further includes: When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space: If the obstacle line segments on the left and right sides do not intrude into the original parking space, and one of the obstacle line segments is not parallel to the left and right boundaries of the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-parallel obstacle line segment that is closer to the original parking space, and the generated line segment and another parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space; If the obstacle line segments on the left and right sides do not intrude into the original parking space and are not parallel to the left and right boundaries of the original parking space, then based on the endpoints of the obstacle line segments on the left and right sides that are closer to the original parking space, line segments parallel to the left and right boundaries of the original parking space are generated, and the target parking space is generated using the generated two line segments as the left and right boundaries; When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, both S102 and S103 further include: When the obstacle line segment is parallel to the left and right boundaries of the original parking space, if the obstacle line segment does not intrude into the original parking space, the obstacle line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located are used as the left and right boundaries to generate the parking target parking space; When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, the S102 further includes: When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, if the obstacle line segment does not intrude the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the obstacle line segment that is closer to the original parking space, and the generated line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located are used as the left and right boundaries to generate the parking target parking space; When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, the S103 further includes: When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space, if the obstacle line segments on the left and right sides do not intrude into the original parking space, the obstacle line segment with a larger inclination angle to the left and right boundaries of the original parking space is selected, and a line segment parallel to another obstacle line segment is generated based on an end point on the obstacle line segment that is closer to the original parking space, and the generated line segment and the parallel obstacle line segments are used as left and right boundaries to generate the parking target parking space; When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, the S103 further includes: When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, if the obstacle line segment does not invade the original parking space, then the other side boundary relative to the side where the obstacle line segment is located is taken from the left and right boundaries of the original parking space, based on the endpoint on the obstacle line segment closer to the original parking space, the boundary line endpoint closer to the endpoint is found from the other side boundary, and a line segment parallel to the obstacle line segment is generated based on the boundary line endpoint, and the generated line segment and the obstacle line segment are used as the left and right boundaries to generate the parking target parking space.
2. A parking target space detection method according to claim 1, characterized in that: When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, both S102 and S103 further include: When the obstacle line segments on the left and right sides are parallel to the left and right boundaries of the original parking space, if at least one of the obstacle line segments on the left and right sides intrudes into the original parking space, it is determined whether the distance between the obstacle line segments on the left and right sides is not less than the body width of the vehicle. If so, the obstacle line segments on the left and right sides are used as the left and right boundaries to generate the parking target parking space.
3. The method for detecting a parking target space according to claim 1, characterized in that: When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, the S102 further includes: When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space: If one of the obstacle line segments on the left and right sides intrudes into the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment is parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-parallel obstacle line segment that intrudes more into the original parking space, and it is determined whether the distance between the generated line segment and the other parallel obstacle line segment is not less than the body width of the vehicle. If so, the parking target parking space is generated using the two as left and right boundaries; If one of the obstacle line segments on the left and right sides does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment invades the original parking space and is parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-parallel obstacle line segment that is closer to the original parking space, and it is determined whether the distance between the generated line segment and the other parallel obstacle line segment is not less than the body width of the vehicle. If so, the parking target parking space is generated using the two as left and right boundaries; If one of the obstacle line segments on the left and right sides invades the original parking space and is not parallel to the left and right boundaries of the original parking space, and the other obstacle line segment does not invade the original parking space and is not parallel to the left and right boundaries of the original parking space, then a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the invading obstacle line segment that invades the original parking space more, and a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-invading obstacle line segment that is closer to the original parking space, and it is determined whether the distance between the two generated line segments is not less than the body width of the vehicle. If so, the parking target parking space is generated using the two line segments as the left and right boundaries; If the obstacle line segments on the left and right sides both invade the original parking space and are not parallel to the left and right boundaries of the original parking space, then based on the endpoints on the left and right sides of the obstacle line segments that invade the original parking space more, line segments parallel to the left and right boundaries of the original parking space are generated, and it is determined whether the spacing between the two generated line segments is not less than the body width of the vehicle. If so, the two are used as the left and right boundaries to generate the parking target parking space.
4. The method for detecting a parking target space according to claim 1, characterized in that: When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, both S102 and S103 further include: When the obstacle line segment is parallel to the left and right boundaries of the original parking space, if the obstacle line segment intrudes into the original parking space, it is determined whether the distance between the obstacle line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located is not less than the body width of the vehicle. If so, the obstacle line segment and the other side boundary are used as the left and right boundaries to generate the parking target parking space. If not, a line segment parallel to the obstacle line segment and with a distance not less than the body width of the vehicle is generated outside the other side boundary based on the obstacle line segment, and the obstacle line segment and the generated line segment are used as the left and right boundaries to generate the parking target parking space.
5. The method for detecting a parking target space according to claim 1, characterized in that: When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, the S102 further includes: When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, if the obstacle line segment intrudes into the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the obstacle line segment that intrudes more into the original parking space, and it is determined whether the distance between the generated line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located is not less than the body width of the vehicle. If so, the generated line segment and the other side boundary are used as the left and right boundaries to generate the parking target parking space. If not, a line segment parallel to the generated line segment and with a distance not less than the body width of the vehicle is generated outside the other side boundary based on the generated line segment, and the two generated line segments are used as the left and right boundaries to generate the parking target parking space.
6. The method for detecting a parking target space according to claim 1, characterized in that: When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, the S103 further includes: When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space: If at least one of the obstacle line segments on the left and right sides intrudes into the original parking space, and the obstacle line segment with a larger inclination angle to the left and right boundaries of the original parking space does not intrude into the original parking space, a line segment parallel to another obstacle line segment is generated based on the endpoint of the obstacle line segment with a larger inclination angle that is closer to the original parking space, and it is determined whether the distance between the generated line segment and the parallel obstacle line segment is not less than the body width of the vehicle. If so, the generated line segment and the parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space; If at least one of the obstacle line segments on the left and right sides invades the original parking space, and the obstacle line segment with a larger inclination angle to the left and right boundaries of the original parking space invades the original parking space, a line segment parallel to the other obstacle line segment is generated based on the endpoint of the obstacle line segment with a larger inclination angle that invades the original parking space more, and it is determined whether the spacing between the generated line segment and the parallel obstacle line segment is not less than the body width of the vehicle. If so, the generated line segment and the parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space.
7. The method for detecting a parking target space according to claim 1, characterized in that: When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, the S103 further includes: When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, if the obstacle line segment intrudes into the original parking space, then the other side boundary relative to the side where the obstacle line segment is located is taken from the left and right boundaries of the original parking space, and based on the endpoint on the obstacle line segment that intrudes more into the original parking space, the boundary line endpoint closer to the endpoint is found from the other side boundary, and a line segment parallel to the obstacle line segment is generated based on the boundary line endpoint, and it is determined whether the spacing between the generated line segment and the obstacle line segment is not less than the body width of the vehicle. If so, the generated line segment and the obstacle line segment are used as the left and right boundaries to generate the parking target parking space. If not, the generated line segment is translated so that the spacing between it and the obstacle line segment is not less than the body width of the vehicle, and the translated line segment and the obstacle line segment are used as the left and right boundaries to generate the parking target parking space.
8. A parking target space detection device, characterized in that: include: The first module is used for S101, when the vehicle is located outside the detected original parking space or located inside the detected original parking space, determining whether the original parking space is a visual parking space; The second module is used for S102: if the original parking space is a visual parking space, detecting whether there is an obstacle line segment on at least one of the left and right sides of the original parking space; if so, generating a parking target parking space based on the obstacle line segment, which does not interfere with the corresponding obstacle, is consistent with the direction of the original parking space, and has a width not less than the body width of the vehicle; if not, using the original parking space as the parking target parking space; The third module is used for S103: if the original parking space is not a visual parking space, detecting whether there is an obstacle line segment on at least one of the left and right sides of the original parking space; if so, generating a parking target parking space based on the obstacle line segment, which does not interfere with the corresponding obstacle, is consistent with the direction of the obstacle line segment, and has a width not less than the body width of the vehicle; if not, using the original parking space as the parking target parking space; When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, both S102 and S103 further include: When the obstacle line segments on the left and right sides are parallel to the left and right boundaries of the original parking space, if the obstacle line segments on the left and right sides do not invade the original parking space, the obstacle line segments on the left and right sides are used as the left and right boundaries to generate the parking target parking space; When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, the S102 further includes: When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space: If the obstacle line segments on the left and right sides do not intrude into the original parking space, and one of the obstacle line segments is not parallel to the left and right boundaries of the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the non-parallel obstacle line segment that is closer to the original parking space, and the generated line segment and another parallel obstacle line segment are used as the left and right boundaries to generate the parking target parking space; If the obstacle line segments on the left and right sides do not intrude into the original parking space and are not parallel to the left and right boundaries of the original parking space, then based on the endpoints of the obstacle line segments on the left and right sides that are closer to the original parking space, line segments parallel to the left and right boundaries of the original parking space are generated, and the target parking space is generated using the generated two line segments as the left and right boundaries; When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, both S102 and S103 further include: When the obstacle line segment is parallel to the left and right boundaries of the original parking space, if the obstacle line segment does not intrude into the original parking space, the obstacle line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located are used as the left and right boundaries to generate the parking target parking space; When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, the S102 further includes: When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, if the obstacle line segment does not intrude the original parking space, a line segment parallel to the left and right boundaries of the original parking space is generated based on the endpoint of the obstacle line segment that is closer to the original parking space, and the generated line segment and the other side boundary of the original parking space relative to the side where the obstacle line segment is located are used as the left and right boundaries to generate the parking target parking space; When it is detected that there are obstacle line segments on both the left and right sides of the original parking space, the S103 further includes: When at least one of the obstacle line segments on the left and right sides is not parallel to the left and right boundaries of the original parking space, if the obstacle line segments on the left and right sides do not intrude into the original parking space, the obstacle line segment with a larger inclination angle to the left and right boundaries of the original parking space is selected, and a line segment parallel to another obstacle line segment is generated based on an end point on the obstacle line segment that is closer to the original parking space, and the generated line segment and the parallel obstacle line segments are used as left and right boundaries to generate the parking target parking space; When it is detected that an obstacle line segment exists on one of the left and right sides of the original parking space, the S103 further includes: When the obstacle line segment is not parallel to the left and right boundaries of the original parking space, if the obstacle line segment does not invade the original parking space, then the other side boundary relative to the side where the obstacle line segment is located is taken from the left and right boundaries of the original parking space, based on the endpoint on the obstacle line segment closer to the original parking space, the boundary line endpoint closer to the endpoint is found from the other side boundary, and a line segment parallel to the obstacle line segment is generated based on the boundary line endpoint, and the generated line segment and the obstacle line segment are used as the left and right boundaries to generate the parking target parking space.
9. An electronic device, characterized in that: It comprises a storage module, wherein the storage module comprises instructions loaded and executed by a processor, and when the instructions are executed, the processor executes a parking target space detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing one or more programs, characterized in that: When the one or more programs are executed by the processor, a parking target space detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Vehicle attitude detection system based on ultrasonic sensor, terminal and storage medium
CN110444044A
Automatic parking control method, electronic equipment and automobile
CN110588638A
Intelligent parking method, device, equipment and medium
CN116901937A