CN-116597412-B - Parking space detection method, device, computer equipment and storage medium
Abstract
The application relates to the technical field of artificial intelligence, in particular to the fields of target detection, automatic driving technology and the like, and in particular relates to a parking space detection method, a parking space detection device, computer equipment and a storage medium. The method comprises the steps of inputting an image to be detected into a parking space detection model to obtain parking space corner information of target pixel points corresponding to target parking space center points in the image to be detected, wherein the parking space corner information comprises the number of parking space corner points, the positions of the parking space corner points and the types of the parking space corner points, the target pixel points are the pixel points of the parking space corner points corresponding to the target parking space center points, and if the number of the parking space corner points of the target pixel points is greater than the number of the parking space corner points corresponding to the target pixel points, the positions of the target parking space corner points of the target parking space center points are selected from the positions of the parking space corner points according to the distances between the positions of the parking space corner points corresponding to the target pixel points and the center positions of the target parking space center points. The application can improve the detection precision of the parking space.
Inventors
- WANG LONGYU
- ZHAO QICHAO
- YUAN JINWEI
- ZHANG ZHENLIN
Assignees
- 中汽创智科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230425
Claims (10)
- 1. The parking space detection method is characterized by comprising the following steps of: Inputting an image to be detected into a parking space detection model to obtain parking space corner information of a target pixel point corresponding to a target parking space center point in the image to be detected, wherein the parking space corner information comprises the number of parking space corner points, the positions of the parking space corner points and the types of the parking space corner points, and the target pixel point is a pixel point of the parking space corner point corresponding to the target parking space center point; If the number of the parking space corner points of the target pixel point is larger than the number corresponding to the type of the parking space corner points of the target pixel point, selecting the target parking space corner point position of the target parking space center point from among the parking space corner point positions according to the distance between each parking space corner point position corresponding to the target pixel point and the center position of the target parking space center point; The parking space detection model is obtained by carrying out joint training on an initial parking space detection model and an auxiliary learning network according to a first difference value and a second difference value, wherein the first difference value represents a difference value between parking space corner information of a predicted parking space center point obtained by predicting a sample image and parking space corner information of a sample parking space center point marked in advance, and a difference value between the predicted parking space center point and the sample parking space center point, the second difference value represents a difference value between a predicted parking space frame obtained by predicting the sample image and a sample parking space frame marked in advance, and the auxiliary learning network is obtained by training by using the sample parking space frame.
- 2. The method of claim 1, wherein the parking space detection model comprises a feature extraction network, a parking space center point detection head network, and a parking space corner point detection head network; inputting the image to be detected into a parking space detection model to obtain parking space corner information of a target pixel point corresponding to a target parking space center point in the image to be detected, wherein the method comprises the following steps: inputting the image to be detected into the feature extraction network to obtain a feature diagram to be detected of the image to be detected; inputting the feature image to be detected into the parking space center point detection head network to obtain the center position of a target parking space center point in the feature image to be detected; And inputting the feature image to be detected and the central position into the parking space corner detection head network to obtain parking space corner information of the target pixel point corresponding to the target parking space central point.
- 3. The method according to claim 2, wherein the inputting the feature map to be measured and the center position to the parking space corner detection head network obtains parking space corner information of a target pixel point corresponding to the target parking space center point, includes: Extracting a pixel region of the target parking space center point from the feature map to be detected according to the center position; Inputting the pixel area into the parking space corner detection head network to obtain parking space corner information of each pixel point in the pixel area, wherein the parking space corner information also comprises type confidence coefficient of the type of the parking space corner; And selecting the parking space corner information of the target pixel point from the parking space corner information of each pixel point according to the type confidence.
- 4. The method of claim 2, wherein the feature extraction network comprises a feature encoding sub-network and an attention sub-network; inputting the image to be detected to the feature extraction network to obtain a feature diagram to be detected of the image to be detected, wherein the feature diagram to be detected comprises: inputting the image to be detected into the feature coding sub-network to obtain a basic feature map of the image to be detected; and inputting the basic feature map to the attention sub-network to obtain the feature map to be detected.
- 5. The method according to claim 1, wherein selecting the target parking space corner position from among the parking space corner positions according to the distance between each parking space corner position corresponding to the target pixel point and the center position of the target parking space center point comprises: And taking the parking space corner point position with the minimum distance from the central position of the target parking space central point in the parking space corner point positions corresponding to the target pixel points as the target parking space corner point position of the target parking space central point.
- 6. The method according to claim 1, wherein the method further comprises: The method comprises the steps of acquiring a sample image, and a first label and a second label of the sample image, wherein the first label comprises each sample parking space frame in the sample image, the second label comprises a sample parking space center point in the sample image and parking space corner point information of a sample pixel point corresponding to the sample parking space center point, and the sample pixel point is a pixel point of a parking space corner point corresponding to the sample parking space center point; inputting the sample image into an initial parking space detection model to obtain a prediction result, wherein the prediction result comprises a predicted parking space center point and parking space corner point information of a prediction pixel point corresponding to the predicted parking space center point; Determining a first difference between the prediction result and the second tag; Inputting the sample feature map of the sample image to a decoding sub-network in an auxiliary learning network to obtain a semantic feature map; Inputting the sample feature map and the semantic feature map to a segmentation sub-network in the auxiliary learning network to obtain a predicted parking space frame; Determining a second difference value between the predicted parking space frame and the first label; and carrying out joint training on the initial parking space detection model and the auxiliary learning network according to the first difference value and the second difference value to obtain a trained parking space detection model.
- 7. The method according to claim 4, wherein the inputting the image to be measured into the feature encoding sub-network to obtain the basic feature map of the image to be measured includes: And inputting the image to be detected into the feature coding sub-network, and performing 16 times downsampling on the image to be detected through the feature coding sub-network to obtain a basic feature map of the image to be detected.
- 8. A parking spot detection device, the device comprising: The system comprises a parking space detection module, an identification module and a display module, wherein the identification module is used for inputting an image to be detected into the parking space detection module to obtain parking space corner information of a target pixel point corresponding to a target parking space center point in the image to be detected, the parking space corner information comprises the number of parking space corner points, the positions of the parking space corner points and the types of the parking space corner points, and the target pixel point is a pixel point of the parking space corner point corresponding to the target parking space center point; The judging module is used for selecting the target parking spot corner positions of the target parking spot center point from among the parking spot corner positions according to the distances between the parking spot corner positions corresponding to the target pixel points and the center positions of the target parking spot center point if the number of the parking spot corner points of the target pixel points is larger than the number corresponding to the parking spot corner types of the target pixel points; The parking space detection model is obtained by carrying out joint training on an initial parking space detection model and an auxiliary learning network according to a first difference value and a second difference value, wherein the first difference value represents a difference value between parking space corner information of a predicted parking space center point obtained by predicting a sample image and parking space corner information of a sample parking space center point marked in advance, and a difference value between the predicted parking space center point and the sample parking space center point, the second difference value represents a difference value between a predicted parking space frame obtained by predicting the sample image and a sample parking space frame marked in advance, and the auxiliary learning network is obtained by training by using the sample parking space frame.
- 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
- 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Description
Parking space detection method, device, computer equipment and storage medium Technical Field The application relates to the technical field of artificial intelligence, in particular to the fields of target detection, automatic driving technology and the like, and in particular relates to a parking space detection method, a parking space detection device, computer equipment and a storage medium. Background In daily life, reversing and warehousing, lateral parking and the like are always difficulties in driving for drivers, and along with the rapid development of automatic driving in the automobile field, the automatic parking field is increasingly rising, and how to accurately detect idle parking spaces is a key problem. The idle parking space can be determined through the parking space corner points. However, in the parking space detection process, the conventional method mostly relies on the ultrasonic sensor and radar positioning method to detect the parking space, but the accuracy of the detection method is low. Disclosure of Invention In view of the foregoing, it is desirable to provide a parking space detection method, apparatus, computer device, and storage medium that can improve the accuracy of parking space detection. In a first aspect, the present application provides a parking space detection method, which includes: Inputting an image to be detected into a parking space detection model to obtain parking space corner information of a target pixel point corresponding to a target parking space center point in the image to be detected, wherein the parking space corner information comprises the number of parking space corner points, the positions of the parking space corner points and the types of the parking space corner points, and the target pixel point is a pixel point of the parking space corner point corresponding to the target parking space center point; If the number of the parking space corner points of the target pixel point is larger than the number corresponding to the types of the parking space corner points of the target pixel point, selecting the target parking space corner point position of the target parking space center point from the parking space corner point positions according to the distance between each parking space corner point position corresponding to the target pixel point and the center position of the target parking space center point. In one embodiment, the parking space detection model comprises a feature extraction network, a parking space center point detection head network and a parking space corner point detection head network; inputting an image to be detected into a parking space detection model to obtain parking space corner information of a target pixel point corresponding to a target parking space center point in the image to be detected, wherein the method comprises the following steps: Inputting the image to be detected into a feature extraction network to obtain a feature diagram to be detected of the image to be detected; inputting the feature image to be detected into a parking space center point detection head network to obtain the center position of a target parking space center point in the feature image to be detected; And inputting the feature image to be detected and the central position into a parking space corner detection head network to obtain parking space corner information of a target pixel point corresponding to the target parking space central point. In one embodiment, inputting a feature map to be detected and a central position to a parking space corner detection head network to obtain parking space corner information of a target pixel point corresponding to a target parking space center point, including: extracting a pixel region of a target parking space center point from the feature map to be detected according to the center position; inputting the pixel area into a parking space corner detection head network to obtain parking space corner information of each pixel point in the pixel area, wherein the parking space corner information also comprises type confidence coefficient of the type of the parking space corner; and selecting the parking space corner information of the target pixel point from the parking space corner information of each pixel point according to the type confidence. In one embodiment, the feature extraction network includes a feature encoding sub-network and an attention sub-network; Inputting the image to be detected into a feature extraction network to obtain a feature diagram to be detected of the image to be detected, wherein the feature diagram to be detected comprises: Inputting the image to be detected into a feature coding sub-network to obtain a basic feature map of the image to be detected; and inputting the basic feature map into the attention sub-network to obtain a feature map to be tested. In one embodiment, selecting the target parking space corner position from the parking space corner positions acc