Parking space detection method and electronic equipment

By using circumferential stitching images and pre-trained parking space detection models in mechanical parking space detection, the pixel positions of the parking space and slopes are determined and position compensation is performed, the problem of low mechanical parking space detection accuracy is solved, and the vehicle's accurate parking and the accuracy of the detection results are improved.

CN120182948APending Publication Date: 2025-06-20ECARX (HUBEI) TECHCO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510238741.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The prior art has problems with low accuracy when detecting mechanical parking spaces, which makes it difficult for vehicles to berth accurately, especially in mechanical parking spaces with raised edges and slopes.

Method used

By acquiring the surround stitching image of the vehicle, using a pre-trained parking space detection model, the pixel positions of the parking space and the slope are determined, and the physical positions are calculated based on these positions, and finally position compensation is performed to obtain the final detection position.

Benefits of technology

Accurate inspection of mechanical parking spaces with slopes and without slopes is achieved, and multiple types of parking space inspections are supported to ensure that vehicles can accurately park in parking spaces and improve the accuracy of the inspection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182948A_ABST
    Figure CN120182948A_ABST
Patent Text Reader

Abstract

The invention provides a parking space detection method and electronic equipment, and the method comprises the steps: obtaining a look-around spliced image of a vehicle, determining the pixel positions of a parking space and a slope in front of the parking space in the look-around spliced image based on a pre-trained parking space detection model, and carrying out the detection of the parking space according to the pixel positions of the parking space and the slope. According to the method, the physical positions of the parking space and the slope in the vehicle coordinate system are determined, the corresponding position compensation amount is determined according to the physical positions, the physical positions of the parking space and the slope are compensated according to the corresponding position compensation amount, the final detection positions of the parking space and the slope are obtained, and identification of the parking space with the slope or without the slope is achieved. Multi-scene and multi-type parking space detection can be supported, the problem that in the prior art, a mechanical parking space is difficult to accurately detect is solved, and a vehicle can be accurately parked in the parking space subsequently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent driving technology, and in particular to a parking space detection method and electronic equipment. Background Art

[0002] With the development of intelligent driving technology, automatic parking has become one of the essential functions of intelligent driving vehicles. At present, urban traffic congestion and parking difficulties are becoming more and more serious. Drivers need automatic parking functions to reduce the burden of driving. Moreover, automatic parking technology can help drivers automatically complete parking actions in narrow parking spaces, greatly improving the convenience and safety of parking. Parking space detection is the premise of automatic parking function. Only when the system gives the precise location and attributes of the parking space can the subsequent automatic parking process be completed.

[0003] At present, the visual perception and recognition technology for ordinary parking spaces is relatively mature. However, for mechanical parking spaces, the following problems exist due to the complexity of the scene: 1. There are protrusions on the two edges of the mechanical parking spaces. If the detection is inaccurate, a slight deviation may cause the tires to scratch and collide when the vehicle is parked; 2. There are slopes in front of some mechanical parking spaces. The inability to identify the slope leads to incomplete mechanical parking space information and difficulty for vehicles to park accurately; 3. Mechanical parking spaces have rich scenes and types, making it difficult to accurately identify various mechanical parking space information. Summary of the invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, the present application aims to provide a parking space detection method and electronic device to solve the problem that vehicles are difficult to park accurately due to inaccurate mechanical parking space detection.

[0005] The present application provides a parking space detection method, which includes:

[0006] Obtaining a surround stitching image of the vehicle;

[0007] Based on a pre-trained parking space detection model, determining pixel positions of a parking space and a slope in front of the parking space in the surround view stitched image;

[0008] Determining physical positions of the parking space and the slope in a vehicle coordinate system based on pixel positions of the parking space and the slope;

[0009] A corresponding position compensation amount is determined based on the physical positions of the parking space and the slope, and the physical positions of the parking space and the slope are compensated according to the corresponding position compensation amount to obtain the final detected positions of the parking space and the slope.

[0010] Optionally, based on a pre-trained parking space detection model, determining pixel positions of a parking space and a slope in front of the parking space in the surround view stitched image includes:

[0011] Input the panoramic stitching image into the parking space detection model to obtain the model inference result, where the model inference result includes the corner points of each parking space target, the corner points of each ramp target, and the confidence of each target;

[0012] Based on the model inference result, determine the pixel positions of the parking space and the ramp in the panoramic stitching image.

[0013] Optionally, determining the pixel positions of the parking space and the ramp in the panoramic stitching image based on the model inference result includes:

[0014] In the model inference result, eliminate the targets with a confidence lower than the preset confidence threshold;

[0015] For the remaining parking space targets in the model inference result, based on the intersection over union (IoU) between each parking space target and a preset first IoU threshold, eliminate some of the parking space targets;

[0016] For the remaining ramp targets in the model inference result, based on the distance intersection over union (DIoU) between each ramp target and a preset second IoU threshold, eliminate some of the ramp targets;

[0017] Determine the pixel position of the parking space based on the corner points of the remaining parking space targets in the model inference result, and determine the pixel position of the ramp based on the corner points of the remaining ramp targets in the model inference result.

[0018] Optionally, determining the corresponding position compensation amount based on the physical positions of the parking space and the ramp includes:

[0019] Based on the physical positions of the parking space and the ramp, determine the distances of the parking space and the ramp relative to the vehicle;

[0020] According to the distances of the parking space and the ramp relative to the vehicle, determine the current compensation areas where the parking space and the ramp are located in each preset compensation area of the vehicle;

[0021] Based on the current compensation areas of the parking space and the ramp, determine the corresponding position compensation amount.

[0022] Optionally, before inputting the panoramic stitching image into the parking space detection model, it further includes:

[0023] Record the original size of the panoramic stitching image and convert the panoramic stitching image to a preset size;

[0024] After determining the pixel positions of the parking space and the ramp in the panoramic stitching image based on the model inference result, it further includes:

[0025] Convert the panoramic stitching image to the original size, and determine the pixel positions of the parking space and the ramp in the converted panoramic stitching image.

[0026] Optionally, the training process of the parking space detection model includes:

[0027] Determine multiple data collection scenarios based on each preset weather or each preset light intensity;

[0028] For each data collection scenario, when the posture of the collection vehicle meets the preset posture, perform image collection to obtain a sample stitching image, and determine the label corresponding to the sample stitching image;

[0029] Train the parking space detection model based on the sample stitching image and the corresponding label;

[0030] Wherein, the preset posture includes that the driving direction of the collection vehicle is perpendicular to the parking space, the angle between the driving direction of the collection vehicle and the perpendicular direction of the parking space is within a preset range, and the collection vehicle is parked in the parking space.

[0031] Optionally, training the parking space detection model based on the sample stitching image and the corresponding label includes:

[0032] Construct a parking space detection network, wherein the parking space detection network includes a backbone module, an intermediate module and an output module, the output module includes a convolutional unit of a first scale and a convolutional unit of a second scale, and the convolutional unit includes three output layers, and the three output layers respectively output the corner points of each parking space target, the corner points of each ramp target, and the parking space type and confidence of the target;

[0033] Construct a data set based on each sample stitching image and the corresponding label, and train the parking space detection network based on the data set to obtain the parking space detection model.

[0034] Optionally, training the parking space detection network based on the data set to obtain the parking space detection model includes:

[0035] Divide the data set into a training set and a validation set, and use the training set to perform iterative training on the parking space detection network;

[0036] When the number of iterations reaches the preset number threshold, select the parking space detection network with the highest validation accuracy for the validation set in multiple iteration rounds, and record the corresponding training loss value;

[0037] Determine multiple continuously recorded training loss values as the current judgment group. If there is no downward trend in the training loss values within the current judgment group, and the verification accuracy of the first parking space detection network within the current judgment group is the highest, then determine the first parking space detection network within the current judgment group as the parking space detection model.

[0038] Optionally, after obtaining the parking space detection model, it further includes:

[0039] Obtain multiple quantization correction images;

[0040] Perform parameter quantization on the parking space detection model based on the quantization correction images, so as to quantize the parameters of some output layers in the backbone module, the intermediate module, and the output module into a first data format, and quantize the parameters of the remaining output layers in the output module into a second data format, where the accuracy of the first data format is lower than the accuracy of the second data format.

[0041] The embodiment of the present application further provides an electronic device, and the electronic device includes:

[0042] A processor and a memory;

[0043] The processor is used to execute the steps of the parking space detection method provided in any embodiment of the present application by calling the program or instruction stored in the memory.

[0044] The embodiment of the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores a program or instruction, and the program or instruction causes a computer to execute the steps of the parking space detection method provided in any embodiment of the present application.

[0045] In summary, the present application proposes a parking space detection method. This method obtains the panoramic stitching image of the vehicle, and then based on the pre-trained parking space detection model, determines the pixel positions of the parking space and the ramp in front of the parking space in the panoramic stitching image. Then, according to the pixel positions of the parking space and the ramp, determines the physical positions of the parking space and the ramp in the vehicle coordinate system, determines the corresponding position compensation amount according to the physical positions, and compensates the physical positions of the parking space and the ramp according to the corresponding position compensation amount to obtain the final detection positions of the parking space and the ramp, realizing the recognition of parking spaces with ramps, without ramps, etc., and being able to support the detection of multiple scenarios and multiple types of parking spaces, solving the problem that it is difficult to accurately detect mechanical parking spaces in the prior art, enabling the vehicle to accurately park in the parking space subsequently. And, after obtaining the physical positions of the parking space and the ramp relative to the vehicle, considering the distortion of the panoramic stitching image, corrects and compensates the physical positions, further improving the detection accuracy of the parking space and the ramp in the vehicle coordinate system, making the output final parking space detection result more accurate. Description of the Drawings

[0046] To more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0047] Figure 1 It is a flowchart of a parking space detection method provided by an embodiment of the present application;

[0048] Figure 2 It is a schematic diagram of a preset posture provided by an embodiment of the present application;

[0049] Figure 3 It is a schematic diagram of a mechanical parking space with a ramp provided by an embodiment of the present application;

[0050] Figure 4 It is a schematic diagram of a mechanical parking space without a ramp provided by an embodiment of the present application;

[0051] Figure 5 It is a schematic diagram of a special type of ramp provided by an embodiment of the present application;

[0052] Figure 6 It is a schematic diagram of a model structure provided by an embodiment of the present application;

[0053] Figure 7 It is a schematic diagram of a preset compensation area provided by an embodiment of the present application;

[0054] Figure 8 It is a parking space detection process provided by an embodiment of the present application;

[0055] Figure 9 It is a schematic diagram of the structure of a parking space detection device provided by an embodiment of the present application;

[0056] Figure 10 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Specific Embodiments

[0057] The following will further elaborate on the present application in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the relevant invention and are not intended to limit the invention. Additionally, it should be noted that for the sake of convenience of description, only the parts related to the invention are shown in the drawings.

[0058] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The following will detail the present application with reference to the drawings and in conjunction with the embodiments.

[0059] As mentioned in the background art, in view of the problems in the prior art, the present application proposes a parking space detection method. Figure 1 It is a flowchart of a parking space detection method provided by an embodiment of the present application. Refer to Figure 1 The parking space detection method specifically includes:

[0060] S110. Obtain the panoramic stitching image of the vehicle.

[0061] Among them, the panoramic stitching image can be an image obtained by performing IPM (Inverse Projective Mapping) and stitching on the images collected by each camera in the vehicle. For example, after the vehicle starts to search for a parking space, each camera can collect the environment respectively, and then perform IPM transformation on the collected images, and combine the images after IPM transformation to form a panoramic image presenting the view around the vehicle, that is, the panoramic stitching image.

[0062] In the embodiment of the present application, considering that the types or parameters of the cameras installed on different vehicle models are different, therefore, the resolution sizes of the panoramic stitching images of different vehicles may be different. For example, the resolution of the panoramic stitching image can be 640×640, 800×640, 800×800, 960×640, 1024×1024, etc.

[0063] For the convenience of online inference of the model, the panoramic stitching image can be converted into a preset size. For example, the panoramic stitching image is converted into 512×512 to unify the size of the panoramic stitching image input into the model and ensure the efficiency and accuracy of subsequent model inference.

[0064] S120. Based on the pre-trained parking space detection model, determine the pixel positions of the parking space and the slope in front of the parking space in the panoramic stitching image.

[0065] Among them, the parking space detection model can be a pre-trained neural network model, and the parking space detection model can be used to identify the parking space and the slope in front of the parking space in the input panoramic stitching image. Exemplarily, the parking space detection model can be a corner detection model, and the parking space detection model can identify the parking space target and the slope target in front of the parking space in the panoramic stitching image, and output the corner points of each target, the type of the parking space target, etc.

[0066] In a specific implementation manner, the training process of the parking space detection model includes the following steps:

[0067] Step 11. Determine a plurality of data collection scenarios based on each preset weather or each preset light intensity;

[0068] Step 12: For each data collection scenario, when the attitude of the collection vehicle meets the preset attitude, image collection is performed to obtain a sample mosaic image, and the label corresponding to the sample mosaic image is determined.

[0069] Step 13: A parking space detection model is trained based on the sample mosaic image and the corresponding label.

[0070] Among them, the preset weather can be the weather type for data collection set in advance, such as sunny, rainy, cloudy, etc., and the preset light intensity can be the light intensity level for data collection set in advance, such as bright, dim, etc.

[0071] In Step 11, considering that the preset weather can reflect the brightness of the environment to a certain extent, therefore, multiple data collection scenarios can be generated based on each preset weather and whether it is indoor or outdoor, or multiple data collection scenarios can be generated based on each preset light intensity and whether it is indoor or outdoor. For example, outdoor sunny, outdoor rainy, outdoor cloudy, outdoor dim, indoor bright, indoor dim, etc.

[0072] Furthermore, in Step 12, for each data collection scenario, the collection vehicle can be controlled to perform image collection with different preset attitudes to obtain the sample mosaic image after stitching by each camera. Among them, the preset attitudes include that the driving direction of the collection vehicle is perpendicular to the parking space, the angle between the driving direction of the collection vehicle and the perpendicular direction of the parking space is within a preset range, and the collection vehicle parks in the parking space.

[0073] Figure 2 It is a schematic diagram of the preset attitude provided by the embodiment of the present application. Among them, when the driving direction of the collection vehicle is perpendicular to the parking space, it can be understood that the collection vehicle is in the best attitude for searching for a parking space, that is, the collection vehicle is in the stage of searching for a parking space. When the angle between the driving direction of the collection vehicle and the perpendicular direction of the parking space is within the preset range (-45° to 45°), it can be understood that the collection vehicle is searching for a parking space obliquely, that is, the collection vehicle is in the stage of entering the warehouse. When the collection vehicle parks in the parking space, it can be understood that the collection vehicle is in the parking stage.

[0074] In the embodiments of the present application, images in three parking stages can be collected respectively in each data collection scenario. The three parking stages are: the parking space search stage, the parking-in stage, and the parking stage. The parking space search stage is the first stage of the automatic parking function. The parking space perception accuracy in this stage first determines whether the attitude of the vehicle itself in the first stage of parking can be adjusted to an ideal position. If the accuracy in this stage is high enough (corner accuracy < 2 cm), one-step parking can be achieved. The parking-in stage and the parking stage belong to the adjustment stages in the automatic parking process. The characteristics of these two stages are: 1. The scenario is not as rich as that in the parking space search stage and has certain limitations. For example, the relative position of the vehicle itself in a certain section of the parking space; 2. Accuracy is also relatively important. For mechanical parking spaces, it is difficult to ensure one-step parking with the accuracy in the first stage. Therefore, a sufficient data set is required to ensure the parking space perception accuracy in the parking-in stage and the parking stage.

[0075] Considering that the scenario in the parking space search stage is more diverse, including vertical parking space search, inclined parking space search, horizontal parking space search, etc., and the amount of training data required is larger, while the scenarios in the parking-in stage and the parking stage are relatively fixed, mainly focusing on the accuracy of the target parking space. Compared with the parking space search stage, the relative position and attitude of the vehicle itself and the target parking space are more fixed. Therefore, according to the experience of preparing the perception data set and model training, the ratio of the data amounts in the three stages can be set to 2:1:1, which can ensure the perception accuracy in the parking space search stage. At the same time, it can ensure that the accuracy of the target parking space in the parking-in stage and the parking stage can also reach a relatively high level. When the ratio of the data amounts in the three stages is 4:1:1, the perception accuracy of the parking space search is better, but the accuracy of the target parking space in the parking-in stage and the parking stage is insufficient.

[0076] After collecting the sample mosaic images in different stages in each data collection scenario, all the sample mosaic images can be labeled to obtain the labels corresponding to the sample mosaic images. Among them, the labels corresponding to the sample mosaic images can include the position of the parking space, the position of the ramp in front of the parking space, and the type of the parking space.

[0077] In the embodiments of the present application, the types of parking spaces include mechanical parking spaces with ramps, mechanical parking spaces without ramps, and non-mechanical parking spaces. Exemplarily, Figure 3 is a schematic diagram of a mechanical parking space with a ramp provided by an embodiment of the present application. The position of the mechanical parking space can be described by a rectangular frame formed by ABCD, and the ramp in front of the mechanical parking space can be described by a rectangular frame formed by EFGH; Figure 4 is a schematic diagram of a mechanical parking space without a ramp provided by an embodiment of the present application. The mechanical parking space is a rectangular frame composed of ABCD.

[0078] In addition, considering that there are also some special types of ramps, that is, multiple separated ramps, Figure 5 is a schematic diagram of a special type of ramp provided by an embodiment of the present application, such asFigure 5 As shown, the slopes in front of the mechanical parking spaces are separated into multiple ones. For such slopes, a rectangular frame belonging to the slopes of the parking space can be marked as a whole. In addition, for slopes that cannot be distinguished due to no demarcation, the position of the slope may not be directly marked, but the type of the parking space is still marked as a mechanical parking space with a slope.

[0079] After completing the annotation of the sample spliced image, further, in step 13, a parking space detection model can be trained through the sample spliced image and the corresponding label. Through the above steps 11 - step 13, data collection under various weather or light intensities can be achieved, and the acquisition vehicle can also be controlled to perform image acquisition in different vehicle body postures, which can ensure the richness of the samples used for training, so that the trained model can accurately identify parking spaces in different scenarios and at different stages.

[0080] Regarding the above step 13, in one example, training a parking space detection model based on the sample spliced image and the corresponding label includes the following steps:

[0081] Step 131: Construct a parking space detection network;

[0082] Step 132: Construct a dataset based on each sample spliced image and the corresponding label, and train the parking space detection network based on the dataset to obtain a parking space detection model.

[0083] Among them, the parking space detection network includes a backbone module, an intermediate module and an output module. The output module includes a convolutional unit of the first scale and a convolutional unit of the second scale. The convolutional unit includes three output layers, and the three output layers respectively output the corner points of each parking space target, the corner points of each slope target, and the parking space type and confidence of the target.

[0084] Specifically, in step 131, the backbone module can adopt the backbone of YOLOV8, and the intermediate module (neck) can adopt the SPP (Spatial Pyramid Pooling) and FPN (Feature Pyramid Network) of YOLOV8. The output module (head) can include convolutional units of two scales, and each convolutional unit includes three output layers, which respectively output the corner points of each parking space target, the corner points of each slope target, and the parking space type and confidence of the target. Among them, the parking space type can be a mechanical parking space with a slope, a mechanical parking space without a slope, and a non - mechanical parking space. In addition, the vehicle exterior type can also describe the parking state of the parking space, such as, empty parking space, occupied parking space, parking space with a ground lock, parking space with traffic cones, parking space with other obstacles, etc.

[0085] In the embodiments of the present application, the first scale may be 16×16, and the second scale may be 32×32. In the embodiments of the present application, the reason for the output module to adopt convolutional units of two scales is as follows: Considering that the detection of parking spaces and slopes in images belongs to the type of non-small targets, which will not be output on the large-scale head, while the feature map of 64×64 outputs targets with small target sizes (such as 8×8 to 16×16) in pixels. The size of the parking space on the stitched image is more than 100×60 pixels, and the size of the slope on the stitched image is more than 80×25 pixels. Therefore, in order to save model training resources and optimize the model inference speed, convolutional units of two scales can be set, and the output of the 64×64 scale can be deleted.

[0086] Moreover, the reason for each convolutional unit in the output module to adopt three output layers is as follows: Compared with using a single output layer to output the detection box of the parking space, by increasing the output layers, the three output layers can respectively output the corner points of each parking space target, the corner points of each slope target, and the parking space type and confidence of the target. Furthermore, the separate detection of the parking space and the slope can be realized, the detection accuracy of the mechanical parking space by the model can be improved, and the reliability of subsequent automatic parking can be ensured.

[0087] Exemplarily, Figure 6 is a schematic diagram of a model structure provided by the embodiments of the present application. As Figure 6 shown, the backbone module can adopt CSPDarknet, the intermediate module can adopt FPN and PAN (Path Aggregation Network), and the backbone module is connected to the intermediate module. The output module includes convolutional units of two scales and is connected to the intermediate module. Among them, scale 1 is 16×16, and scale 2 is 32×32. For each convolutional unit, it includes three output layers, which respectively output the corner points of the parking space target, the corner points of the slope target, and the parking space type and confidence.

[0088] Furthermore, in step 132, a dataset can be constructed through each sample stitched image and the corresponding label, and then the parking space detection network can be trained to obtain a parking space detection model. Through the above steps 131 - 132, the network including convolutional units of two scales can be trained, saving model training resources and optimizing the model inference speed. Moreover, the separate detection of the parking space and the slope can be realized, ensuring the detection accuracy of the mechanical parking space and facilitating the subsequent automatic parking of the vehicle.

[0089] Regarding step 132, optionally, training the parking space detection network based on the dataset to obtain a parking space detection model includes the following steps:

[0090] Step 1321: Divide the dataset into a training set and a validation set, and use the training set to perform iterative training on the parking space detection network;

[0091] Step 1322: When the number of iterations reaches the preset number threshold, select the parking space detection network with the highest verification accuracy for the validation set among multiple iteration rounds, and record the corresponding training loss value.

[0092] Step 1323: Determine the continuously recorded multiple training loss values as the current judgment group. If there is no downward trend in the training loss values within the current judgment group, and the verification accuracy of the first parking space detection network within the current judgment group is the highest, then determine the first parking space detection network within the current judgment group as the parking space detection model.

[0093] In step 1321, the data set can be divided into a training set and a validation set according to a certain ratio. For example, 85% of the data set is used as the training set, and 15% of the data set is used as the validation set; then use the training set to perform iterative training on the parking space detection network.

[0094] Among them, the input size of the vehicle detection network can be set to 512×512, and the sample splicing images are uniformly adjusted to 512×512. The loss function used during training can adopt focal loss, and the activation function can adopt leaky relu. Compared with sigmoid, it can make the accuracy achieved by model training higher.

[0095] During the training process, a set strategy can also be adopted to stop the training. Specifically, in step 1322, when the number of iterations reaches the preset number threshold (such as 400), every certain number of iteration rounds (such as 5), select the parking space detection network with the highest verification accuracy for the validation set and record the corresponding training loss value.

[0096] Furthermore, in step 1323, the continuously recorded multiple training loss values (such as 3 losses) can be determined as the current judgment group. If there is no downward trend in the training loss values within the current judgment group, and the verification accuracy of the first recorded parking space detection network within the current judgment group is the highest, then the training can be stopped, and the first parking space detection network within the current judgment group is determined as the parking space detection model.

[0097] Through the above steps 1321 - 1323, when the number of training iterations reaches a certain number of epochs or more, select a network with the highest accuracy on the validation set every certain number of times, record the corresponding training loss value, and stop the training when the continuously recorded training loss values no longer decrease and the first recorded network has the highest accuracy on the validation set, and select this network as the training result, which can ensure the reliability of model training and thus ensure the parking space detection accuracy of the model.

[0098] After training the parking space detection model, the parking space detection model can be deployed on the vehicle-side mobile platform. Considering the limited resources of the vehicle-side mobile platform, in order to ensure the efficiency of model inference and avoid occupying too much hardware resources, the parking space detection model can also be quantized, that is, convert the parameters in the parking space detection model into low-precision parameters, such as quantizing from FP32 to INT8.

[0099] In order to ensure the corner accuracy of the model output, a partial quantization method can also be used. In one example, after obtaining the parking space detection model, the following steps are further included:

[0100] Step 133, obtain multiple quantization correction images;

[0101] Step 134, perform parameter quantization on the parking space detection model based on the quantization correction images, so as to quantize the parameters of some output layers in the backbone module, intermediate module, and output module into the first data format, and quantize the parameters of the remaining output layers in the output module into the second data format, where the accuracy of the first data format is lower than that of the second data format.

[0102] Among them, in step 133, sample mosaic images under different data collection scenarios can be selected from the training set. For example, for scenarios such as outdoor sunny and bright, outdoor rainy, outdoor cloudy, outdoor dim, indoor bright, and indoor dim, 50 frames of marked mechanical parking spaces with slopes and mechanical parking spaces without slopes are respectively selected.

[0103] Furthermore, for a group of images selected under each data collection scenario, the average image brightness can be calculated for all sample mosaic images in the group, and then sorted in descending order of brightness, and the sample mosaic images with the set rankings are selected. Taking a group of 50-frame sample mosaic images as an example, the sample mosaic images ranked 1, 10, 20, 30, 40, and 50 can be selected; then perform histogram equalization on the selected sample mosaic images to obtain the corresponding equalized images, and use the selected sample mosaic images and the corresponding equalized images as the quantization correction images under this group.

[0104] For example, if the number of data collection scenarios is 6, the number of parking space types is 2, and there are 12 quantization correction images in each group, a total of 144 quantization correction images can be obtained.

[0105] Furthermore, in step 134, parameter quantization of the parking space detection model can be performed through the quantization correction images. Among them, parameter quantization can adopt the method of per-channel quantization and per-tensor quantization. Per-channel quantization can be to perform per-channel quantization on each channel of the convolutional layer of the model, and per-tensor quantization can be to perform per-tensor quantization on each activation layer of the model.

[0106] In the embodiment of the present application, the first data format may be INT8, and the second data format may be FP16. Specifically, the quantized correction image may be used to quantize the parameters of the backbone module and the intermediate module in the parking space detection model into the first data format, and the parameters of some output layers in the output module may be quantized into the first data format. For example, the parameters of the output layer that is not related to the corner point output may be quantized into the first data format, such as Figure 6 CoV1-1, CoV2-1, CoV3-1, CoV3-2, CoV3-3.

[0107] Furthermore, the quantized correction image can be used to quantize the parameters of the remaining output layers in the output module into the second data format, that is, the parameters of the output layers related to the corner point output in the output module are quantized into the second data format, such as Figure 6 conv1-2, conv1-3, conv2-2, conv2-3 in.

[0108] After completing the quantization of the parking space detection model, a correction based on the KL (Kullback-Leibler divergence, relative entropy) divergence can be performed. After quantization, the parking space detection model can be retrained for 20 epochs, and the accuracy of the quantized parking space detection model can be verified. The quantization process provided in the embodiment of the present application can ensure that the accuracy loss of the quantized parking space corner point position is within 0.4 pixels and the map loss is within 2%.

[0109] Through the above steps 133 and 134, the model can be quantized after the model training is completed to reduce the amount of data for model deployment, thereby ensuring the inference efficiency of the model on the vehicle-side mobile platform and avoiding occupying too many hardware resources and affecting other vehicle functions. In addition, the parameters of the output layer related to the corner point output in the output module can be quantized to a higher precision, and the remaining parameters can be quantized to a lower precision, which can reduce the amount of model data while ensuring the accuracy of corner point detection.

[0110] In an embodiment of the present application, online parking space detection is achieved, and specifically, the surround view stitched image is input into a parking space detection model to identify information such as the position of the parking space and the position of the slope in the surround view stitched image through the parking space detection model, and then determine the position of the parking space and the slope relative to the center of the front axle of the vehicle.

[0111] In a specific implementation, based on a pre-trained parking space detection model, determining the pixel positions of the parking space and the slope in front of the parking space in the surround stitched image includes the following steps:

[0112] Step 21: input the surround stitching image into the parking space detection model to obtain the model reasoning result, wherein the model reasoning result includes the corner points of each parking space target, the corner points of each slope target, and the confidence of each target;

[0113] Step 22: Determine the pixel positions of the parking spaces and the slopes in the surround stitching image based on the model inference results.

[0114] Among them, in step 21, after the surround view stitching image is input into the parking space detection model, the parking space detection model can detect the parking space target and the slope target in the surround view stitching image, thereby outputting the model reasoning result, including the corner points of each parking space target, the corner points of each slope target, and the confidence of each target.

[0115] Furthermore, in step 22, the model inference result may be post-processed to restore the detection results of the parking space and the slope, and obtain the pixel positions of the parking space and the slope in the surround stitching image.

[0116] With respect to the above step 22, in one example, determining the pixel positions of the parking space and the slope in the surround stitched image based on the model inference result includes the following steps:

[0117] Step 221: In the model inference results, eliminate the targets whose confidence is lower than a preset confidence threshold;

[0118] Step 222: for the remaining parking space targets in the model reasoning result, based on the intersection-and-union ratio between the parking space targets and a preset first intersection-and-union ratio threshold, some parking space targets are eliminated;

[0119] Step 223: for the remaining slope targets in the model reasoning result, based on the distance intersection-and-union ratio between the slope targets and a preset second intersection-and-union ratio threshold, some slope targets are eliminated;

[0120] Step 224: Determine the pixel position of the parking space based on the corner points of the remaining parking space targets in the model reasoning result, and determine the pixel position of the slope based on the corner points of the remaining slope targets in the model reasoning result.

[0121] Among them, in step 221, considering that there may be a large number of invalid targets in the model inference results, some invalid targets can be eliminated by pre-setting a confidence threshold (such as 0.5), that is, targets with confidence lower than the preset confidence threshold are eliminated.

[0122] Furthermore, in step 222, considering that there may be duplicate targets among all the remaining parking space targets, the repeatability between the parking space targets can also be measured according to the intersection-and-joint ratio between the parking space targets, and then some parking space targets can be eliminated in combination with the preset first intersection-and-joint ratio threshold (such as 0.6).

[0123] Exemplarily, all remaining parking space targets can be sorted in descending order of confidence. The first parking space target in the sorting result is used as the current judgment object, and the intersection-over-union (IoU) between the current judgment object and other parking space targets is calculated. Other parking space targets with an IoU higher than a preset first IoU threshold are removed from the sorting result. Further, the next parking space target after the current judgment object in the sorting result is used as the new current judgment object, and the IoU between the current judgment object and other parking space targets is recalculated. Other parking space targets with an IoU higher than the preset first IoU threshold are removed from the sorting result. This process is repeated until the last parking space target in the sorting result is used as the current judgment object and the removal of its duplicate parking space targets is completed, obtaining all the remaining parking space targets in the sorting result.

[0124] Moreover, in step 223, considering that there may be duplicate targets among all the remaining slope targets, the repeatability between each slope target can be measured by the distance intersection-over-union (IoU) between the slope targets, and then some slope targets can be removed in combination with a preset second IoU threshold (such as 0.4). The distance IoU can be calculated based on the IoU, the Euclidean distance between two targets, and the diagonal length of the minimum bounding rectangle.

[0125] Exemplarily, all remaining slope targets can be sorted in descending order of confidence. The first slope target in the sorting result is used as the current judgment object, and the distance IoU between the current judgment object and other slope targets is calculated. Other slope targets with a distance IoU higher than the preset second IoU threshold are removed from the sorting result. Further, the next slope target after the current judgment object in the sorting result is used as the new current judgment object, and the distance IoU between the current judgment object and other slope targets is recalculated. Other slope targets with a distance IoU higher than the preset second IoU threshold are removed from the sorting result. This process is repeated until the last slope target in the sorting result is used as the current judgment object and the removal of its duplicate slope targets is completed, obtaining all the remaining slope targets in the sorting result.

[0126] Further, in step 224, the pixel positions of the parking spaces can be determined based on the corner points of the remaining parking space targets in the model inference result, and the pixel positions of the slopes can be determined based on the corner points of the remaining slope targets in the model inference result, realizing the positioning of parking spaces and slopes in the image.

[0127] Through the above steps 221 - 224, a large number of invalid targets can be removed from the model inference result first, and then duplicate targets in the model inference result can be removed through the IoU and the distance IoU, improving the subsequent position conversion efficiency of parking spaces and slopes while also improving the subsequent position conversion accuracy of parking spaces and slopes.

[0128] Considering that the size of the panoramic stitching image is converted before inputting it into the model, after obtaining the pixel positions of the parking space and the ramp, they can be restored to the panoramic stitching image of the original size.

[0129] In some alternative embodiments, before inputting the panoramic stitching image into the parking space detection model, it further includes: recording the original size of the panoramic stitching image and converting the panoramic stitching image into a preset size.

[0130] After determining the pixel positions of the parking space and the ramp in the panoramic stitching image based on the model inference result, it further includes: converting the panoramic stitching image into the original size and determining the pixel positions of the parking space and the ramp in the converted panoramic stitching image.

[0131] Specifically, before inputting the panoramic stitching image into the parking space detection model, the original size of the panoramic stitching image can be recorded and then converted into a preset size (such as 512×512). Furthermore, after obtaining the pixel positions of the parking space and the ramp through the parking space detection model, the panoramic stitching image can be converted into the original size and the pixel positions of the parking space and the ramp in the panoramic stitching image can be determined again.

[0132] Through the above embodiments, after the model inference is completed, the result can be restored to the size of the original panoramic stitching image to ensure the accuracy of subsequent position conversion.

[0133] S130. Determine the physical positions of the parking space and the ramp in the vehicle coordinate system based on the pixel positions of the parking space and the ramp.

[0134] Specifically, according to the transformation matrices of the cameras in the vehicle, the pixel positions of the parking space and the ramp can be converted from the image coordinate system to the vehicle coordinate system to obtain the physical positions of the parking space and the ramp in the vehicle coordinate system.

[0135] Alternatively, according to the internal parameters of the cameras in the vehicle (describing the transformation relationship between the image coordinate system and the camera coordinate system), the pixel positions of the parking space and the ramp can be converted from the image coordinate system to the camera coordinate system to obtain the positions of the parking space and the ramp relative to the camera. Furthermore, in combination with the external parameters of the cameras (describing the transformation relationship between the camera coordinate system and the vehicle coordinate system), the positions of the parking space and the ramp relative to the camera can be converted to the vehicle coordinate system to obtain the physical positions of the parking space and the ramp in the vehicle coordinate system.

[0136] Exemplarily, assume that the size of the surround-view stitched image is 800×640, representing an actual range of 10m×8m, and the actual distance represented by each pixel is 2.5cm. Then image_width = 10, image_height = 8, and the transformation matrix between the image coordinate system and the vehicle coordinate system is M. The physical positions of the parking space and the ramp in the vehicle coordinate system are as follows:

[0137] X′ = X×M[0][0] + M[0][2], Y' = Y×M[1][1] + M[1][2];

[0138] In the formula, (X, Y) is the pixel position of the parking space or the ramp, (X′, Y′) is the physical position of the parking space or the ramp, and M is the transformation matrix.

[0139] S140. Determine the corresponding position compensation amount based on the physical positions of the parking space and the ramp, and compensate the physical positions of the parking space and the ramp according to the corresponding position compensation amount to obtain the final detection positions of the parking space and the ramp.

[0140] In the embodiments of the present application, considering that the fisheye camera on the vehicle is a typical wide-angle camera with obvious barrel distortion, and the distortion characteristic is that the farther away from the center of the image, the greater the mirror radial distortion error. However, the surround-view stitched image projects the pixels of four fisheye images onto an IPM image, and the distortion of the fisheye camera will follow the pixels of each frame of the fisheye image projected onto the IPM image, resulting in a certain degree of distortion in the IPM image. After converting the pixel coordinates of the parking space and the ramp in the surround-view stitched image to the vehicle coordinate system, the distortion of the surround-view stitched image will bring deviations to the physical positions in the vehicle coordinate system.

[0141] Therefore, there is an offset when restoring the pixel positions in the surround-view stitched image to the original image, which leads to a deviation between the physical position of the parking space and the real world, and the deviation can be further corrected. In the embodiments of the present application, the premise of correction is to accurately calculate the offset amount (which can be understood as the distortion coefficient) and compensate the detection result.

[0142] According to the fisheye distortion model and characteristics, the distortion characteristics of the surround-view stitched image can be obtained: (1) The stretching of the image edge area is more serious than that of the image center area; (2) The stretching of the position far from the vehicle on the image is more serious than that of the position close to the vehicle body. Combining this distortion characteristic, the errors of the parking space and the ramp can be quantitatively analyzed. For example, in order to balance the distortion compensation accuracy, the implementation complexity, and the occupied computing resources, a partition compensation method can be adopted for the projection distortion of the surround-view stitched image.

[0143] In a specific implementation manner, determining the corresponding position compensation amount based on the physical positions of the parking space and the ramp includes the following steps:

[0144] Step 31: Determine the distances between the parking space and the slope relative to the vehicle based on their physical positions.

[0145] Step 32: Determine the current compensation zone where the parking space and the slope are located among the preset compensation zones of the vehicle according to the distances between the parking space and the slope relative to the vehicle.

[0146] Step 33: Determine the corresponding position compensation amount based on the current compensation zone of the parking space and the slope.

[0147] Among them, in Step 31, first, the distance between the parking space and the vehicle can be determined according to the physical position of the parking space in the vehicle coordinate system, and the distance between the slope and the vehicle can be determined according to the physical position of the slope in the vehicle coordinate system, so as to facilitate subsequent determination of the partition based on the distance.

[0148] Furthermore, in Step 32, the current compensation zone where the parking space is located and the current compensation zone where the slope is located can be determined by the distance between the parking space and the vehicle and the distance between the slope and the vehicle.

[0149] In the embodiment of the present application, multiple preset compensation zones can be divided with the center of the front axle of the vehicle as the center of the circle, and for each preset compensation zone, a corresponding fixed compensation amount is set according to the distance between it and the center of the front axle of the vehicle.

[0150] Figure 7 is a schematic diagram of a preset compensation zone provided by an embodiment of the present application. As Figure 7 shown, with the center Q of the front axle of the vehicle as the center of the circle, the range with a radius R0 = 2.5 cm is the non-compensation zone. The distortion degree in this area is almost zero, and no fixed compensation amount needs to be set, that is, offset x0 = 0 cm, offset y0 = 0 cm.

[0151] Refer to Figure 7 , the range with a radius of 2.5 cm ≤ R1 < 5 cm is the first compensation zone, that is, the lower radius limit R L1 = 2.5 cm, the upper radius limit R R1 = 5 cm. The distortion degree in this area is small, and the fixed compensation amount offset x1 = 0.8 cm, offset y1 = 0.8 cm. The range with a radius of 5 cm ≤ R2 < 7.5 cm is the second compensation zone, that is, the lower radius limit R L2 = 5 cm, the upper radius limit R R2 = 7.5 cm. The distortion degree in this area is large, and the fixed compensation amount offset x2 = 1.2 cm, offset y2= 1.2 cm. The third compensation area is the range outside the second compensation area. Assuming that the farthest actual detection distance corresponding to the panoramic stitching image is 10 m, the range where 7.5 cm ≤ R3 < 10 cm is the third compensation area, that is, the lower limit of the radius R of this compensation area L3 = 7.5 cm, and the upper limit of the radius R R3 = 10 cm. The distortion degree in this area is large, and the fixed compensation amount offset x3 = 2.0 cm, offset y3 = 2.0 cm.

[0152] It should be noted that the setting of the above preset compensation area is only for example. The number and size of the preset compensation area can also be adjusted according to the detection distance corresponding to the panoramic stitching image, and the embodiments of the present application do not limit this.

[0153] After determining the current compensation area where the parking space and the slope are located, further, in step 33, the corresponding position compensation amount can be determined according to the current compensation area of the parking space and the slope.

[0154] Among them, each preset compensation area has a corresponding fixed compensation amount. The farther the preset compensation area is from the center of the vehicle's front axle, the larger the fixed compensation amount. Specifically, the fixed compensation amount corresponding to the current compensation area can be queried first, and then, according to the angle of the parking space and the slope in the corresponding current compensation area, combined with the fixed compensation amount corresponding to the current compensation area, the corresponding position compensation amount can be determined.

[0155] As Figure 7 shown, for any point P (parking space or slope), the compensation area where it is located can be calculated first. In the figure, point P is located in the second compensation area, and the angle between the X-axis and PQ can be obtained. This angle is defined as the angle rotated clockwise starting from the X-axis, that is, the angle in the compensation area. The position compensation amount of point P is:

[0156]

[0157] In the formula, D x 、D y are the position compensation amounts of point P on the X-axis and Y-axis, length(PQ) is the distance between point P and the center of the vehicle's front axle, and α is the angle of point P in the second compensation area, that is, the angle relative to the X-axis.

[0158] Through the above steps 31 - step 33, the distortion of the panoramic stitching image can be compensated in zones, ensuring the accuracy of the compensation, and moreover, it can also reduce the resource occupancy of the vehicle-end mobile platform.

[0159] After determining the position compensation amount of the parking space and the slope, the physical position of the parking space can be compensated according to the position compensation amount of the parking space, and the physical position of the slope can be compensated according to the position compensation amount of the slope, so as to obtain the final detection position of the parking space and the slope. For example, the final detection position of the parking space or the slope is:

[0160] X′=X×M[0][0]+M[0][2]-D x ;

[0161] Y'=Y×M[1][1]+M[1][2]-D y ;

[0162] The parking space detection method provided in the embodiment of the present application obtains a surround view stitched image of the vehicle, and then determines the pixel positions of the parking space and the slope in front of the parking space in the surround view stitched image based on a pre-trained parking space detection model, and then determines the physical positions of the parking space and the slope in the vehicle coordinate system according to the pixel positions of the parking space and the slope, determines the corresponding position compensation amount according to the physical position, and compensates the physical positions of the parking space and the slope according to the corresponding position compensation amount to obtain the final detection position of the parking space and the slope, thereby realizing the recognition of parking spaces with slopes and without slopes, and being able to support multi-scenario and multi-type parking space detection, solving the problem of mechanical parking spaces being difficult to accurately detect in the prior art, so that the vehicle can be accurately parked in the parking space later. Moreover, after obtaining the physical positions of the parking space and the slope relative to the vehicle, the method corrects and compensates the physical positions taking into account the distortion of the surround view stitched image, thereby further improving the detection accuracy of the parking space and the slope in the vehicle coordinate system, so that the output final parking space detection result is more accurate.

[0163] Figure 8 This is a parking space detection process provided by an embodiment of the present application, such as Figure 8 As shown, first, offline model training can be performed, including steps such as data set annotation preparation, model training, and model quantization deployment; then, model online recognition can be performed, including steps such as obtaining surround stitching images in the input search phase, model online reasoning, and parking space recognition result post-processing; finally, parking space recognition result correction and output can be performed, including IPM image distortion coefficient estimation and parking space recognition result correction output.

[0164] The method provided in the embodiment of the present application can support parking space detection in various scenarios and types, such as indoor and outdoor, mechanical parking spaces with and without slopes, non-mechanical parking spaces, and different types of slopes. By optimizing the network model structure and the model training quantization method, the accuracy of the detection results of parking spaces on the IPM image is improved, and by correcting and compensating for the distortion of the surround-view spliced ​​IPM image, the accuracy of the detection results of parking spaces or slopes in the vehicle coordinate system is further improved. In addition, this method is not only applicable to the detection of mechanical parking spaces, but also to the detection of ordinary parking spaces such as non-mechanical ones.

[0165] Figure 9 is a schematic diagram of the structure of a parking space detection device provided in an embodiment of the present application. The device includes a spliced ​​image acquisition module 910, a model reasoning module 920, a position determination module 930 and a position compensation module 940, wherein:

[0166] A stitched image acquisition module 910 is used to acquire a surround stitched image of the vehicle;

[0167] A model reasoning module 920, configured to determine pixel positions of a parking space and a slope in front of the parking space in the surround view stitched image based on a pre-trained parking space detection model;

[0168] A position determination module 930, configured to determine the physical positions of the parking space and the slope in a vehicle coordinate system based on the pixel positions of the parking space and the slope;

[0169] The position compensation module 940 is used to determine a corresponding position compensation amount based on the physical positions of the parking space and the slope, and compensate the physical positions of the parking space and the slope according to the corresponding position compensation amount to obtain the final detected positions of the parking space and the slope.

[0170] The parking space detection device provided in the embodiment of the present application is applicable to the parking space detection method provided in any embodiment of the present application, and can execute the steps in the parking space detection method provided in the method embodiment of the present application. The execution steps and beneficial effects are no longer repeated here.

[0171] Figure 10 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 10 As shown, the electronic device 400 includes one or more processors 401 and a memory 402 .

[0172] The processor 401 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.

[0173] The memory 402 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage media, and the processor 401 may run the program instructions to implement the parking space detection method of any embodiment of the present application described above and / or other desired functions. Various contents such as initial external parameters, thresholds, etc. may also be stored in the computer-readable storage media.

[0174] In one example, the electronic device 400 may further include: an input device 403 and an output device 404, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown). The input device 403 may include, for example, a keyboard, a mouse, etc. The output device 404 may output various information to the outside, including warning prompt information, braking force, etc. The output device 404 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0175] Of course, for simplicity, Figure 4 only some of the components related to the present application in the electronic device 400 are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device 400 may further include any other appropriate components.

[0176] In addition to the above methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions that, when run by a processor, cause the processor to execute the steps of the parking space detection method provided by any embodiment of the present application.

[0177] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present application. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0178] In addition, an embodiment of the present application may also be a computer-readable storage medium storing computer program instructions, which, when run by a processor, cause the processor to execute the steps of the parking space detection method provided in any embodiment of the present application.

[0179] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0180] It should be noted that the terms used in the present application are only for describing specific embodiments and do not limit the scope of the present application. As shown in the specification and claims of the present application, unless the context clearly indicates otherwise, words such as "a", "an", "one", and / or "the" are not specifically singular and may also include plural. The term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, or device including the element.

[0181] It should also be noted that the orientation or positional relationship indicated by terms such as "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be understood as a limitation of the present application. Unless otherwise clearly specified and limited, terms such as "installed", "connected", "connected to" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the internal communication of two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances.

[0182] In this text, specific examples are used to illustrate the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. The above is only the preferred implementation manner of the present application. It should be noted that due to the limitation of literal expression and objectively infinite specific structures, for those of ordinary skill in the art, without departing from the principle of the present application, several improvements, retouches or changes can be made, or the above technical features can be combined in an appropriate manner; these improvements, retouches, changes or combinations, or directly applying the inventive concept and technical solution to other occasions without improvement, shall all be regarded as the protection scope of the present application.

Claims

1. A parking space detection method, characterized in that: include: Obtaining a surround stitching image of the vehicle; Based on a pre-trained parking space detection model, determining pixel positions of a parking space and a slope in front of the parking space in the surround view stitched image; Determining physical positions of the parking space and the slope in a vehicle coordinate system based on pixel positions of the parking space and the slope; A corresponding position compensation amount is determined based on the physical positions of the parking space and the slope, and the physical positions of the parking space and the slope are compensated according to the corresponding position compensation amount to obtain the final detected positions of the parking space and the slope.

2. The method according to claim 1, characterized in that Based on a pre-trained parking space detection model, determining pixel positions of a parking space and a slope in front of the parking space in the surround view stitched image includes: Inputting the surround stitching image into the parking space detection model to obtain a model reasoning result, wherein the model reasoning result includes a corner point of each parking space target, a corner point of each slope target, and a confidence level of each target; The pixel positions of the parking space and the slope are determined in the surround view stitched image based on the model inference result.

3. The method according to claim 2, characterized in that Determining pixel positions of the parking space and the slope in the surround view stitched image based on the model inference result includes: In the model inference results, targets with confidence levels lower than a preset confidence threshold are eliminated; For the remaining parking space targets in the model reasoning result, based on the intersection-and-union ratio between the parking space targets and a preset first intersection-and-union ratio threshold, some parking space targets are eliminated; For the remaining slope targets in the model reasoning result, based on the distance intersection-and-union ratio between the slope targets and a preset second intersection-and-union ratio threshold, some slope targets are eliminated; The pixel position of the parking space is determined based on the corner points of the remaining parking space targets in the model reasoning result, and the pixel position of the slope is determined based on the corner points of the remaining slope targets in the model reasoning result.

4. The method according to claim 1, characterized in that: Determining a corresponding position compensation amount based on the physical positions of the parking space and the slope includes: Based on the physical locations of the parking space and the slope, determining the distances of the parking space and the slope relative to the vehicle; Determining, in each preset compensation zone of the vehicle, a current compensation zone where the parking space and the slope are located according to the distances of the parking space and the slope relative to the vehicle; A corresponding position compensation amount is determined based on the current compensation area of ​​the parking space and the slope.

5. The method according to claim 2, characterized in that: Before inputting the surround stitching image into the parking space detection model, the method further includes: Recording the original size of the surround-view stitching image, and converting the surround-view stitching image to a preset size; After determining the pixel positions of the parking space and the slope in the surround stitched image based on the model inference result, the method further includes: The surround-view stitched image is converted to the original size, and pixel positions of the parking space and the slope are determined in the converted surround-view stitched image.

6. The method according to claim 1, characterized in that The training process of the parking space detection model includes: Determine multiple data collection scenarios based on each preset weather or each preset light intensity; For each data collection scene, image collection is performed when the posture of the collection vehicle meets the preset posture, a sample stitching image is obtained, and a label corresponding to the sample stitching image is determined; The parking space detection model is obtained based on the sample spliced ​​image and the corresponding label training; The preset posture includes that the driving direction of the collection vehicle is perpendicular to the parking space, the angle between the driving direction of the collection vehicle and the perpendicular direction of the parking space is within a preset range, and the collection vehicle is parked in the parking space.

7. The method according to claim 6, characterized in that The parking space detection model is obtained based on the sample spliced ​​image and the corresponding label training, including: Constructing a parking space detection network, wherein the parking space detection network includes a backbone module, an intermediate module and an output module, the output module includes a convolution unit of a first scale and a convolution unit of a second scale, the convolution unit includes three output layers, and the three output layers respectively output the corner points of each parking space target, the corner points of each slope target, and the parking space type and confidence of the target; A data set is constructed based on each sample spliced ​​image and the corresponding label, and the parking space detection network is trained based on the data set to obtain the parking space detection model.

8. The method according to claim 7, characterized in that The parking space detection network is trained based on the data set to obtain the parking space detection model, including: Dividing the data set into a training set and a validation set, and using the training set to iteratively train the parking space detection network; When the number of iterations reaches a preset number threshold, selecting a parking space detection network with the highest verification accuracy for the verification set in multiple iteration rounds, and recording the corresponding training loss value; A plurality of continuously recorded training loss values ​​are determined as a current judgment group. If there is no downward trend in the training loss values ​​in the current judgment group, and the verification accuracy of the first parking space detection network in the current judgment group is the highest, the first parking space detection network in the current judgment group is determined as the parking space detection model.

9. The method according to claim 7, characterized in that: After obtaining the parking space detection model, the method further includes: Acquire multiple quantitative correction images; The parking space detection model is parameter quantized based on the quantized correction image, so that the parameters of the backbone module, the intermediate module, and part of the output layer in the output module are quantized into a first data format, and the parameters of the remaining output layers in the output module are quantized into a second data format, wherein the accuracy of the first data format is lower than that of the second data format.

10. An electronic device, characterized in that: The electronic device comprises: Processor and memory; The processor is used to execute the steps of the parking space detection method according to any one of claims 1 to 9 by calling the program or instruction stored in the memory.