Parking space location determination method and apparatus, device, medium, and product
By combining the target parking space detection model with GPS positioning, the status and location of parking spaces in a parking lot can be detected in real time and accurately, which solves the problems of real-time performance and accuracy of parking space detection in existing technologies and improves the efficiency of parking lot management.
Patent Information
- Application Number
- PCT/CN2025/085324
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-29
- Filing Date
- 2025-03-27
- Publication Date
- 2025-12-04
AI Technical Summary
Existing technologies cannot accurately detect the location and status of parking spaces in real time, especially in complex and ever-changing open-air parking environments, leading to low parking efficiency and increased user uncertainty.
A target parking space detection model is adopted. The initial parking space detection model is trained iteratively through a parking lot image sample set. The CPP-CBAM layer in the neck network is used in combination with GPS positioning information to determine the vacancy status and geographical location of the parking space in real time.
It enables real-time and accurate detection of parking space status and location, improving parking management efficiency and user experience, and adapting to complex and ever-changing parking environments.
Smart Images

Figure CN2025085324_04122025_PF_FP_ABST
Abstract
Description
Methods, devices, equipment, media and products for determining parking space locations
[0001] This application claims priority to Chinese Patent Application No. 202410681119.3, filed with the Chinese Patent Office on May 29, 2024, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of computer technology, for example to a method, apparatus, device, medium and product for determining parking space location. Background Technology
[0003] With urban traffic problems becoming increasingly prominent, parking spaces have become one of the important issues in urban management. For example, in open-air parking lots in urban centers and bustling commercial areas, traditional parking space management methods mainly rely on manual patrols or simple sensor technology to locate vacant parking spaces and their specific locations. However, these methods have many problems, including low management efficiency, high costs, and large errors.
[0004] With the development of computer vision technology, image recognition-based parking space status detection has gradually become a new solution. However, some problems and challenges still exist. First, traditional parking space detection methods can often only detect whether a vehicle or parking space exists in the parking lot, but cannot provide specific location information of the parking space. Second, traditional parking space detection methods often cannot update the status information of parking spaces in real time, causing users to be unable to obtain the vacancy status of parking spaces in a timely manner, increasing the uncertainty of parking. Finally, the environment of parking lots is complex and changeable, such as various open-air parking lots. Traditional parking space detection methods are difficult to adapt to complex and changeable environments, and thus cannot meet the requirements of real-time and accuracy of parking space detection. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and product for determining parking space location, which solves the problem that parking space detection methods in related technologies cannot meet the real-time and accuracy requirements for detecting the status and location of parking spaces in parking lots.
[0006] According to one aspect of this application, a method for determining the location of a parking space is provided, comprising:
[0007] Acquire a target parking lot image captured by a target camera in the parking lot, wherein the target parking lot image includes parking space images;
[0008] The target parking lot image is input into the target parking space detection model to obtain the center image coordinates of the parking space corresponding to the vacant parking space. The target parking space detection model is obtained by iteratively training an initial parking space detection model using a parking lot image sample set. The initial parking space detection model includes a neck network, which includes a CPP-CBAM layer.
[0009] The geographical location information of the vacant parking space is determined based on the geographical location information of the target camera and the center image coordinates of the vacant parking space.
[0010] According to another aspect of this application, a parking space location determining device is provided, the parking space location determining device comprising:
[0011] The acquisition module is configured to acquire images of a target parking lot captured by a target camera in the parking lot, wherein the target parking lot images include images of parking spaces;
[0012] The module is configured to input the target parking lot image into the target parking space detection model to obtain the center image coordinates of the parking space corresponding to the vacant parking space. The target parking space detection model is obtained by iteratively training an initial parking space detection model through a parking lot image sample set. The initial parking space detection model includes a neck network, which includes a CPP-CBAM layer.
[0013] The determination module is configured to determine the geographical location information of the vacant parking space based on the geographical location information of the target camera and the center image coordinates of the parking space corresponding to the vacant parking space.
[0014] According to another aspect of this application, an electronic device is provided, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the parking space location determination method according to any embodiment of this application.
[0018] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the parking space location determination method according to any embodiment of this application.
[0019] According to another aspect of this application, a computer program product is provided, which, when executed by a processor, implements the parking space location determination method as described in any of the embodiments of this application. Attached Figure Description
[0020] Figure 1 is a flowchart of a parking space location determination method according to Embodiment 1 of this application;
[0021] Figure 2 is a schematic diagram of an original YOLOv5 model in Embodiment 1 of this application;
[0022] Figure 3 is a schematic diagram of an initial parking space detection model in Embodiment 1 of this application;
[0023] Figure 4 is a schematic diagram of a CPP-CBAM layer in Embodiment 1 of this application;
[0024] Figure 5 is a schematic diagram of the geometric relationship between the target camera and the parking space in the acquired parking lot image in the world coordinate system according to Embodiment 1 of this application.
[0025] Figure 6 is a schematic diagram of a parking space location determination device according to Embodiment 2 of this application;
[0026] Figure 7 is a schematic diagram of the structure of an electronic device according to Embodiment 3 of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings. The described embodiments are merely some, not all, of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0030] Example 1
[0031] Figure 1 is a flowchart of a parking space location determination method according to Embodiment 1 of this application. This embodiment is applicable to situations where the status and location of parking spaces in a parking lot are detected. This method can be executed by the parking space location determination device in this embodiment of the application. The device can be implemented in software and / or hardware. As shown in Figure 1, the method specifically includes the following steps:
[0032] S110, acquire the target parking lot image captured by the target camera in the parking lot, wherein the target parking lot image includes parking space images.
[0033] The parking lot can be any location where vehicles are parked, including open-air parking lots. The target camera is a high-positioned camera installed in the parking lot, used to capture images of parking spaces and parked vehicles. The target camera is equipped with GPS positioning, which allows its location information to be determined. The images of the target parking lot captured by the target camera include images of parking spaces and, potentially, images of the vehicles parked in those spaces.
[0034] For example, the way to obtain the target parking lot image captured by the target camera in the parking lot can be: to capture the target parking lot image corresponding to the parking lot in real time through the target camera in the parking lot.
[0035] S120, Input the target parking lot image into the target parking space detection model to obtain the center image coordinates of the parking space corresponding to the vacant parking space. The target parking space detection model is obtained by iteratively training the initial parking space detection model through the parking lot image sample set. The initial parking space detection model includes a neck network, which includes a CPP-CBAM layer.
[0036] The target parking space detection model is a model that detects the center image coordinates of parking spaces corresponding to their status (vacancy) and vacancy status. Parking space status can include vacancy and occupancy. For example, the target parking space detection model can be a YOLOv5 model. The center image coordinates of a parking space corresponding to an vacancy status can be understood as the coordinates of the center point of the predicted bounding box for that parking space after it has been detected as vacant.
[0037] The parking lot image sample set serves as the training dataset. Methods for obtaining the parking lot image sample set include: collecting large-scale parking lot image samples under different geographical locations and environmental conditions, such as cities, suburbs, commercial areas, and residential areas. To ensure the diversity of image samples, image samples can be collected under different lighting conditions, including daytime, nighttime, and cloudy days; image samples can be collected under different weather conditions, including sunny days, rainy days, and snowy days; image samples can be collected from different parking lot layouts, including parking lots of different sizes, shapes, and densities, as well as from different angles and perspectives. All image samples in the parking lot image sample set are then labeled, including those indicating vacant and occupied parking spaces.
[0038] The target parking space detection model is obtained by iteratively training an initial parking space detection model using a parking lot image sample set. The initial parking space detection model includes a neck network, which includes a CPP-CBAM layer. The initial parking space detection model can be a YOLOv5 model with a neck network including a CPP-CBAM layer, which is an improved model of the original YOLOv5 model. The CPP-CBAM layer is a combination of CPP (Channel Pyramid Pool) and CBAM (Convolutional Block Attention Module), which can effectively reduce the computational load of the model and improve the detection effect of small targets.
[0039] Before inputting the parking lot image sample set into the initial parking space detection model, the images can be adjusted to a uniform size to meet the input requirements of the initial parking space detection model. Histogram equalization can also be used to adjust the brightness and contrast of the image samples in the parking lot image sample set to ensure that the image samples can be effectively recognized by the initial parking space detection model under different lighting conditions. Random cropping, random scaling, random flipping, and random rotation can be used to increase the diversity of training image samples and improve the generalization ability of the initial parking space detection model.
[0040] For example, the target parking space detection model can be obtained by iteratively training the initial parking space detection model using a parking lot image sample set: Obtain a parking lot image sample set; input the parking lot image samples from the sample set into the initial parking space detection model; obtain the detected parking space status, the width and height of the predicted bounding box for the vacant state, and the center coordinates of the predicted bounding box as the position coordinates of the predicted vacant parking space in the image coordinate system; construct a loss function based on the width and height of the ground truth bounding box for the vacant parking space, the center coordinates of the predicted bounding box, the center coordinates of the ground truth bounding box, and the width and height of the predicted bounding box for the vacant parking space; iteratively train the initial parking space detection model based on the loss function and the parking lot image sample set until the iteration condition is met, thus obtaining the target parking space detection model. The loss function can be:
[0041] Among them, L EIOU For the total loss, L IOU L is the overlap loss between the predicted bounding box and the ground truth bounding box. dis For the center distance loss between the predicted bounding box and the ground truth bounding box, L asp Let be the width and height loss of the predicted bounding box and the ground truth bounding box, IOU be the intersection-union ratio of the predicted bounding box and the ground truth bounding box, and b be the center point of the predicted bounding box. gt ρ is the center point of the true bounding box. 2 (b,b gt ) represents the square of the Euclidean distance between the center point of the predicted bounding box and the center point of the ground truth bounding box, and w is the width of the predicted bounding box. gt h is the width of the ground truth bounding box, and h is the height of the predicted bounding box. gt w is the height of the true bounding box c h is the width of the minimum bounding rectangle between the predicted bounding box and the ground truth bounding box. c The height of the minimum bounding rectangle between the predicted box and the ground truth box is the loss function. This loss function can improve the regression speed and detection accuracy of the predicted box, and the width-height loss can minimize the difference between the width and height of the predicted box and the ground truth box, resulting in faster convergence.
[0042] In a specific example, when iteratively training the initial parking space detection model using a parking lot image sample set, the parking lot image sample set can be divided into a training set, a validation set, and a test set in a ratio of 7:1:2. This set is then imported into the initial parking space detection model for training. During training, SGD (Stochastic Gradient Descent optimizer) can be used, with weight decay set to 0.0005, initial learning rate set to 0.001, maximum learning rate set to 0.01, and momentum set to 0.937. A total of 100 epochs are trained, retaining the optimal weights and other parameters during training. One model is output after each epoch, resulting in 100 models. The model with the highest mean F1-score (harmonic mean of precision and recall) is then selected as the target parking space detection model from these 100 models.
[0043] For example, the way to input the target parking lot image into the target parking space detection model to obtain the center image coordinates of the parking space corresponding to the vacant parking space can be as follows: input the real-time acquired target parking lot image into the target parking space detection model, the target parking space detection model outputs the status of each parking space in the target parking lot image, and outputs the center point coordinates of the prediction box corresponding to the parking space whose status is vacant, which is the center image coordinates of the parking space corresponding to the vacant parking space.
[0044] S130, determine the geographical location information of the vacant parking space based on the geographical location information of the target camera and the center image coordinates of the parking space corresponding to the vacant parking space.
[0045] The geographic location information of the target camera can be used to describe the specific location of the target camera, which may include the height of the target camera and the top angle of the target camera, as well as the latitude and longitude coordinates of the target camera; the geographic location information of the vacant parking space can be used to describe the actual geographic location of the vacant parking space, so that users can know the specific location of the vacant parking space, which may include the location coordinates of the vacant parking space in the world coordinate system, as well as the latitude and longitude coordinates of the vacant parking space.
[0046] For example, the geographical location information of an vacant parking space can be determined based on the geographical location information of the target camera and the center image coordinates of the parking space corresponding to the vacant parking space by: transforming the center image coordinates of the parking space corresponding to the vacant parking space to the position coordinates of the vacant parking space in the world coordinate system through an inverse perspective transformation method; or calculating the latitude and longitude coordinates of the vacant parking space based on the geographical location information of the target camera and the position coordinates of the parking space in the world coordinate system.
[0047] Optionally, the initial parking space detection model further includes: a backbone network and a detection network;
[0048] The backbone network includes: a Focus layer, multiple CBS layers, multiple CSP layers, and an SPPBottleneck layer; the neck network includes: multiple Conv layers, multiple UpSample layers, CPP-CBAM layers, multiple DownSample layers, and multiple CSP layers; the detection network includes: multiple YoloHead layers.
[0049] The model comprises several layers: the Focus layer, which slices the input parking lot image to expand the entrance and exit channels; the CBS layer (Channel Block Squeeze), which includes a 2D convolutional layer (Conv2D), a batch normalization (BN) layer, and a SiLU activation function layer, improving the model's feature extraction and generalization capabilities, thereby enhancing parking space detection accuracy; the CSP layer (Cross Stage Partial), which preserves original feature information through residual connections while extracting features; and the SPPBottleneck layer, a spatial pyramid pooling bottleneck structure, an improved residual structure that combines Spatial Pyramid Pooling (SPP) with the bottleneck structure of residual networks, improving the detection capability for parking spaces of different sizes while maintaining computational efficiency; the Conv layer, a convolutional layer, generates outputs with higher-level features; and the UpSample layer, an upsampling layer, implements a feature map method to convert low-resolution feature maps into high-resolution outputs. The CPP-CBAM layer combines CPP (Channel Pyramid Pool) and CBAM (Convolutional Block Attention Module) to improve the detection performance of small objects and reduce the computational cost of the model. The DownSample layer is a downsampling layer used to reduce the size of the feature map. The YoloHead layer is the detection head, responsible for generating the final target prediction box and class probability, which can improve the accuracy of parking space detection while maintaining fast inference speed.
[0050] Optionally, the backbone network, from input to output, includes, in sequence: a Focus layer, a first CBS layer, a second CBS layer, a first CSP layer, a third CBS layer, a second CSP layer, a fourth CBS layer, a third CSP layer, a fifth CBS layer, an SPPBottleneck layer, and a fourth CSP layer; the neck network, from input to output, includes, in sequence: a first Conv layer, a first UpSample layer, a CPP-CBAM layer, a second Conv layer, a second UpSample layer, a fifth CSP layer, a third Conv layer, a third UpSample layer, a sixth CSP layer, a first DownSample layer, a seventh CSP layer, a second DownSample layer, an eighth CSP layer, a third DownSample layer, and a ninth CSP layer.
[0051] The feature map output from the first CSP layer is concatenated with the feature map output from the third UpSample layer to serve as the input feature map for the sixth CSP layer. The feature map output from the sixth CSP layer then serves as the input feature map for the first YoloHead layer in the detection network. Similarly, the feature map output from the second CSP layer is concatenated with the feature map output from the second UpSample layer to serve as the input feature map for the third Conv layer. The feature map output from the third CSP layer is concatenated with the feature map output from the first UpSample layer to serve as the input feature map for the CPP-CBAM layer. Finally, the feature map output from the third Conv layer is concatenated with the feature map output from the first DownSample layer to serve as the input feature map for the sixth CSP layer. The input feature map of the seventh CSP layer is used as the input feature map of the second YoloHead layer in the detection network; the feature map output of the second Conv layer and the feature map output of the second DownSample layer are concatenated to form the input feature map of the eighth CSP layer, and the feature map output of the eighth CSP layer is used as the input feature map of the third YoloHead layer in the detection network; the feature map output of the first Conv layer and the feature map output of the third DownSample layer are concatenated to form the input feature map of the ninth CSP layer, and the feature map output of the ninth CSP layer is used as the input feature map of the fourth YoloHead layer in the detection network.
[0052] For example, Figure 2 is a schematic diagram of a primary YOLOv5 model in Embodiment 1 of this application. As shown in Figure 2, the primary YOLOv5 model is an object detection model. At the input end, the primary YOLOv5 model uses data augmentation techniques to stitch the input image through random scaling, random cropping, and random arrangement. In addition, it employs adaptive anchor boxes and adaptive image scaling techniques, which can adaptively calculate the best prediction box and adjust images of different widths and heights according to different training sample sets. It has the characteristics of high efficiency and accuracy. That is to say, the primary YOLOv5 model can detect the target parking lot image and each sample in the parking lot image sample set. While the model identifies vehicles and parking spaces, it performs poorly in detecting small targets in complex and ever-changing parking lot environments. As the network layers deepen, information about small targets is gradually lost, leading to false positives and false negatives in small target detection. Therefore, this embodiment improves the neck network in the original YOLOv5 model by adding an operation layer to process feature maps, thereby improving the detection performance of small targets. However, adding an extra target detection layer increases the computational load of the model. Therefore, this embodiment adds a CPP-CBAM layer to replace one of the original CSP layers when adding an operation layer to process feature maps, which can effectively reduce the computational load of the model and improve the detection performance of small targets.
[0053] Figure 3 is a schematic diagram of an initial parking space detection model in Embodiment 1 of this application. As shown in Figure 3, Concat represents concatenation, and the bold black boxes represent improvement layers. After the fifth CSP layer, the feature map is further upsampled to expand it. The feature map output from the third UpSample layer is concatenated with the feature map output from the first CSP layer to enhance the detection capability for small targets. The original YOLOv5 model can only detect feature maps of three sizes, while the improved model can detect feature maps of four sizes. The improvements also include changing the CSP layer in the original YOLOv5 model to CPP- The CBAM and CSP layers are designed to improve the efficiency and performance of the model when dealing with small targets. They are mainly achieved by dividing the input feature map into two parts: one part is directly connected to the output, and the other part is connected to the output after a series of convolution operations. This improves the diversity and expressiveness of the features, helping the model to better learn the features of the target. However, the CSP layer increases the computational cost of the model. In some resource-constrained scenarios or scenarios that need to process a large number of small targets, the computational cost is too high, and the model performance is reduced. The CSP layer is improved to the CPP-CBAM layer, which can improve the detection effect of small targets while reducing the computational cost of the model.
[0054] In a specific example, the parking lot image size is determined to be 640×640×3. The parking lot image is input into the Focus layer of the backbone network to obtain the first feature map (320×320×12); the first feature map is input into the first CBS layer to obtain the second feature map (320×320×64); the second feature map is input into the second CBS layer to obtain the third feature map (160×160×128); the third feature map is input into the first CSP layer to obtain the fourth feature map (160×160×128); the fourth feature map is input into the third CBS layer to obtain the fifth feature map (80×80×256); the fifth feature map is input into the second CSP layer to obtain the sixth feature map (80×80×256). The sixth feature map is input into the fourth CBS layer to obtain the seventh feature map (40×40×512); the seventh feature map is input into the third CSP layer to obtain the eighth feature map (40×40×512); the eighth feature map is input into the fifth CBS layer to obtain the ninth feature map (20×20×1024); the ninth feature map is input into the SPPBottleneck layer to obtain the tenth feature map (20×20×1024); the tenth feature map is input into the fourth CSP layer to obtain the eleventh feature map (20×20×1024); the eleventh feature map is input into the first Conv layer of the neck network to obtain the twelfth feature map (20×20×512); the twelfth feature map is input into the first UpSample layer to obtain... The thirteenth feature map (40×40×512); the eighth feature map is concatenated with the thirteenth feature map to obtain the concatenated feature map (40×40×1024), and the concatenated feature map is input into the CPP-CBAM layer to obtain the fourteenth feature map (40×40×512); the fourteenth feature map is input into the second Conv layer to obtain the fifteenth feature map (40×40×256); the fifteenth feature map is input into the second UpSample layer to obtain the sixteenth feature map (80×80×256); the sixteenth feature map is concatenated with the sixth feature map to obtain the concatenated feature map (80×80×512), and the concatenated feature map is input into the fifth CSP layer to obtain the seventeenth feature map (80×80×512). ×256); The seventeenth feature map is input into the third Conv layer to obtain the eighteenth feature map (80×80×128); The eighteenth feature map is input into the third UpSample layer to obtain the nineteenth feature map (160×160×128); The nineteenth feature map and the fourth feature map are concatenated to obtain the concatenated feature map (160×160×256); The concatenated feature map is input into the sixth CSP layer to obtain the twentieth feature map (160×160×128); The twentieth feature map is input into the first YoloHead layer in the detection network to obtain the first target feature map; The twentieth feature map is input into the first DownSample layer to obtain the twenty-first feature map (80×80×128);The 21st and 18th feature maps are concatenated to obtain a concatenated feature map (80×80×256), which is then input into the 7th CSP layer to obtain the 22nd feature map (80×80×256). The 22nd feature map is then input into the 2nd YoloHead layer to obtain the 2nd target feature map. The 22nd feature map is then input into the 2nd DownSample layer to obtain the 23rd feature map (40×40×256). The 23rd and 15th feature maps are concatenated to obtain a concatenated feature map (40×40×512), which is then input into the 8th CSP layer to obtain the 24th feature map (40×40×512). The 24th feature map is then input into the 3rd YoloHead layer. The third target feature map is obtained by inputting the twenty-fourth feature map into the third DownSample layer; the twenty-fifth feature map (20×20×512) is obtained by inputting the twenty-fourth feature map into the third DownSample layer; the twenty-fifth feature map and the twelfth feature map are concatenated to obtain the concatenated feature map (20×20×1024), and the concatenated feature map is input into the ninth CSP layer to obtain the twenty-sixth feature map (20×20×1024); the twenty-sixth feature map is input into the fourth YoloHead layer to obtain the fourth target feature map. The size of the first target feature map can be 160×160, the size of the second target feature map can be 80×80, the size of the third target feature map can be 40×40, and the size of the fourth target feature map can be 20×20.
[0055] Optionally, the CPP-CBAM layer includes, from input to output, the following in sequence: a parallel first branch and a second branch, a fourth Conv layer, and a CBAM layer. The first branch includes, from input to output, an Avgpool layer and a fourth UpSample layer. The second branch includes, from input to output, a Maxpool layer and a fifth UpSample layer. The CBAM layer includes, from input to output, a Channel module layer and a Space module layer. The feature map output from the first branch and the feature map output from the second branch are concatenated to serve as the input feature map for the fourth Conv layer.
[0056] The Avgpool layer is an average pooling layer that uses a 2x2 pooling kernel with a stride of 2 to reduce the size of the feature map. The Maxpool layer is a max pooling layer that also uses a 2x2 pooling kernel with a stride of 2 to capture the target detection region in the feature map and generate a compressed feature map. The Channel Module layer is a channel attention layer. The feature map input to the Channel Module layer undergoes global max pooling and global average pooling operations, and then learns the correlation between channels through two fully connected layers. A sigmoid activation function is applied to obtain the attention weights, and the generated channel attention map is used to weight the channels of the input feature map. The Space Module layer is a spatial attention layer that uses two convolutional layers to learn the correlation of spatial dimensions and applies a sigmoid activation function to obtain the attention weights. The CBAM layer can compress the feature channel dimension, thereby greatly reducing the number of feature channels in the model. Therefore, by adding the CBAM layer, the parameters of the initial parking space detection model can also be reduced.
[0057] Figure 4 is a schematic diagram of a CPP-CBAM layer in Embodiment 1 of this application. As shown in Figure 4, the feature map output by the first UpSample layer and the feature map output by the third CSP layer are concatenated and then input into two parallel branches in the CPP-CBAM layer. For example, the concatenated feature map (40×40×1024) is input into the parallel first branch and second branch. In the first branch, the Avgpool layer is applied to reduce the feature map to 20×20×1024, and then the fourth UpSample layer restores the feature map to its original size of 40×40×1024 to preserve spatial information and prepare for subsequent feature fusion. In the second branch, the Maxpool layer is applied to generate a compressed feature map of size 20×20×1024, which is then input into the fifth UpSample layer to restore the feature map to its original size of 40×40×1024. The original size is 40×40×1024. Then, the output feature map of the first branch is concatenated with the output feature map of the second branch to form a higher-dimensional feature map of 40×40×2048. By combining the global average information and local saliency information captured by average pooling and max pooling respectively, a richer feature representation is provided. The concatenated feature map is input into the fourth Conv layer, which uses a 1×1 convolution kernel and sets the number of output channels to 512. This reduces the number of channels of the feature map from 2048 to 512 without changing the spatial size, generating a new feature map of size 40×40×512. This new feature map is then input into the CBAM layer. After processing by the CBAM layer, the size of the output feature map remains unchanged at 40×40×512, but its feature representation is enhanced.
[0058] Optionally, the geographic location information of the target camera includes: the height of the target camera and the top-down angle of the target camera; the geographic location information of the vacant parking space includes: the position coordinates of the vacant parking space in the world coordinate system.
[0059] Accordingly, the geographical location information of the vacant parking space is determined based on the geographical location information of the target camera and the center image coordinates of the vacant parking space, including:
[0060] Obtain the target camera's resolution, vertical field of view, and horizontal field of view;
[0061] The position coordinates of the vacant parking space in the world coordinate system are determined based on the position coordinates of the parking space in the image coordinate system, the resolution of the target camera, the longitudinal field of view of the target camera, the lateral field of view of the target camera, the height of the target camera, and the top angle of the target camera.
[0062] The target camera is equipped with GPS positioning. The location information of the target camera is obtained through GPS positioning. Since the placement of the target camera is fixed, it is very easy to obtain the height and downward angle of the target camera.
[0063] The vertical field of view of the target camera is the range of the scene that the camera can capture in the vertical direction; the horizontal field of view of the target camera is the range of the scene that the camera can capture in the horizontal direction.
[0064] For example, the resolution, vertical field of view, and horizontal field of view of the target camera can be obtained by: determining the resolution, vertical field of view, and horizontal field of view of the target camera through the target camera's manufacturer's manual.
[0065] The method for determining the position coordinates of an vacant parking space in the world coordinate system based on the parking space's position coordinates in the image coordinate system, the target camera's resolution, the target camera's longitudinal field of view, the target camera's lateral field of view, the target camera's height, and the target camera's top angle can be as follows:
[0066] Where u is the x-coordinate of the vacant parking space in the image coordinate system, v is the y-coordinate of the vacant parking space in the image coordinate system, m is the vertical resolution of the target camera, n is the horizontal resolution of the target camera, h is the height of the target camera, 2α is the vertical field of view of the target camera, and 2β is the horizontal field of view of the target camera. X is the top-down view of the target camera. p Let x and y be the x-coordinate of an vacant parking space in the world coordinate system. p The y-coordinate of an vacant parking space in the world coordinate system.
[0067] Figure 5 is a schematic diagram of the geometric relationship between the target camera and the parking space in the acquired parking lot image in the world coordinate system according to Embodiment 1 of this application. As shown in Figure 5, K represents the optical center of the camera, J is the projection point of the camera on the ground, P is the real coordinate point in the world coordinate system corresponding to the position coordinates of the vacant parking space in the image coordinate system, ABCD is the field of view that the camera can capture, M is the point collinear with J, H, G, I and P, and this collinearity represents the center line of the field of view in the horizontal direction, L is an auxiliary point used to define the image edge or field of view boundary, E and F represent the horizontal field of view range in the horizontal direction, ∠EKF is the 2β horizontal field of view, H, G and I represent the vertical field of view range in the vertical direction, ∠IKH is the 2α vertical field of view, where KJ is the height of the camera, and ∠GKJ is the downward angle of the camera.
[0068] By determining the location coordinates of vacant parking spaces in the world coordinate system based on the parking space's position coordinates in the image coordinate system, the resolution of the target camera, the target camera's longitudinal field of view, the target camera's lateral field of view, the target camera's height, and the target camera's top angle, it is possible to ensure accurate location of vacant parking spaces.
[0069] Optionally, the geographic location information of the target camera may also include: the latitude and longitude coordinates of the target camera; the geographic location information of the vacant parking space may also include: the latitude and longitude coordinates of the vacant parking space.
[0070] Correspondingly, it also includes:
[0071] The latitude and longitude coordinates of the vacant parking space are determined based on the position coordinates of the vacant parking space in the world coordinate system and the latitude and longitude coordinates of the target camera.
[0072] For example, the latitude and longitude coordinates of an vacant parking space can be determined based on its position coordinates in the world coordinate system and the latitude and longitude coordinates of the target camera. The GPS positioning device is installed directly below the optical center of the camera, and the origin of the world coordinate system can coincide with the GPS position of the target camera. If the latitude and longitude coordinates of the target camera are (lon0, lot0), then the latitude and longitude coordinates (longitude, latitude) of the vacant parking space are calculated as follows:
[0073] Where R is the Earth's radius, which can be 6371 kilometers.
[0074] By determining the latitude and longitude coordinates of vacant parking spaces based on their position coordinates in the world coordinate system and the latitude and longitude coordinates of the target camera, the location of vacant parking spaces can be further accurately determined. This allows the system to provide users with real-time information on the status and specific location of vacant parking spaces, facilitating their parking and use.
[0075] The technical solution of this embodiment involves acquiring a target parking lot image captured by a target camera, wherein the target parking lot image includes parking space images; inputting the target parking lot image into a target parking space detection model to obtain the center image coordinates of the parking space corresponding to the vacant parking space; wherein the target parking space detection model is obtained by iteratively training an initial parking space detection model using a parking lot image sample set, the initial parking space detection model including a neck network, the neck network including a CPP-CBAM layer; and determining the geographical location information of the vacant parking space based on the geographical location information of the target camera and the center image coordinates of the parking space corresponding to the vacant parking space, thus solving the problem that related parking space detection methods cannot satisfy the detection of parking space status and parking space position. To address the issues of real-time performance and accuracy, the target parking lot image is input into the target parking space detection model. This model can detect the status information of parking spaces in the parking lot image in real time, obtaining the vacant parking spaces and the corresponding center image coordinates of those spaces. Moreover, the target parking space detection model is obtained by iteratively training an initial parking space detection model using a parking lot image sample set. The initial parking space detection model includes a CPP-CBAM layer, which improves the adaptability of the target parking space detection model to the complex and ever-changing environment of the parking lot and enhances the accuracy of detecting the status information and center image coordinates of the parking spaces. Then, the geographical location information of the vacant parking spaces is calculated using the geographical location information of the target camera and the center image coordinates of the parking spaces, achieving precise positioning of vacant parking spaces.
[0076] Example 2
[0077] Figure 6 is a schematic diagram of a parking space location determination device according to Embodiment 2 of this application. This embodiment is applicable to situations where the status and location of parking spaces in a parking lot are detected. The device can be implemented in software and / or hardware and can be integrated into any device that provides parking space location determination functionality. As shown in Figure 6, the parking space location determination device includes: an acquisition module 210, a obtaining module 220, and a determination module 230.
[0078] The acquisition module 210 is used to acquire the target parking lot image captured by the target camera in the parking lot, wherein the target parking lot image includes parking space images;
[0079] The module 220 is used to input the target parking lot image into the target parking space detection model to obtain the center image coordinates of the parking space corresponding to the vacant parking space. The target parking space detection model is obtained by iteratively training an initial parking space detection model through a parking lot image sample set. The initial parking space detection model includes a neck network, which includes a CPP-CBAM layer.
[0080] The determining module 230 is used to determine the geographical location information of the vacant parking space based on the geographical location information of the target camera and the center image coordinates of the parking space corresponding to the vacant parking space.
[0081] Optionally, the initial parking space detection model further includes: a backbone network and a detection network;
[0082] The backbone network includes: a Focus layer, multiple CBS layers, multiple CSP layers, and an SPPBottleneck layer; the neck network includes: multiple Conv layers, multiple UpSample layers, CPP-CBAM layers, multiple DownSample layers, and multiple CSP layers; the detection network includes: multiple YoloHead layers.
[0083] Optionally, the backbone network, from input to output, includes, in sequence: a Focus layer, a first CBS layer, a second CBS layer, a first CSP layer, a third CBS layer, a second CSP layer, a fourth CBS layer, a third CSP layer, a fifth CBS layer, an SPPBottleneck layer, and a fourth CSP layer; the neck network, from input to output, includes, in sequence: a first Conv layer, a first UpSample layer, a CPP-CBAM layer, a second Conv layer, a second UpSample layer, a fifth CSP layer, a third Conv layer, a third UpSample layer, a sixth CSP layer, a first DownSample layer, a seventh CSP layer, a second DownSample layer, an eighth CSP layer, a third DownSample layer, and a ninth CSP layer.
[0084] The feature map output from the first CSP layer is concatenated with the feature map output from the third UpSample layer to serve as the input feature map for the sixth CSP layer. The feature map output from the sixth CSP layer then serves as the input feature map for the first YoloHead layer in the detection network. Similarly, the feature map output from the second CSP layer is concatenated with the feature map output from the second UpSample layer to serve as the input feature map for the third Conv layer. The feature map output from the third CSP layer is concatenated with the feature map output from the first UpSample layer to serve as the input feature map for the CPP-CBAM layer. Finally, the feature map output from the third Conv layer is concatenated with the feature map output from the first DownSample layer to serve as the input feature map for the sixth CSP layer. The input feature map of the seventh CSP layer is used as the input feature map of the second YoloHead layer in the detection network; the feature map output of the second Conv layer and the feature map output of the second DownSample layer are concatenated to form the input feature map of the eighth CSP layer, and the feature map output of the eighth CSP layer is used as the input feature map of the third YoloHead layer in the detection network; the feature map output of the first Conv layer and the feature map output of the third DownSample layer are concatenated to form the input feature map of the ninth CSP layer, and the feature map output of the ninth CSP layer is used as the input feature map of the fourth YoloHead layer in the detection network.
[0085] Optionally, the CPP-CBAM layer includes, from input to output, the following in sequence: a parallel first branch and a second branch, a fourth Conv layer, and a CBAM layer. The first branch includes, from input to output, an Avgpool layer and a fourth UpSample layer. The second branch includes, from input to output, a Maxpool layer and a fifth UpSample layer. The CBAM layer includes, from input to output, a Channel module layer and a Space module layer. The feature map output from the first branch and the feature map output from the second branch are concatenated to serve as the input feature map for the fourth Conv layer.
[0086] Optionally, the geographic location information of the target camera includes: the height of the target camera and the top angle of the target camera; the geographic location information of the vacant parking space includes: the position coordinates of the vacant parking space in the world coordinate system;
[0087] Accordingly, the determining module is specifically used for:
[0088] Obtain the target camera's resolution, vertical field of view, and horizontal field of view;
[0089] The position coordinates of the vacant parking space in the world coordinate system are determined based on the position coordinates of the parking space in the image coordinate system, the resolution of the target camera, the longitudinal field of view of the target camera, the lateral field of view of the target camera, the height of the target camera, and the top angle of the target camera.
[0090] Optionally, the geographic location information of the target camera may further include: the latitude and longitude coordinates of the target camera; the geographic location information of the vacant parking space may further include: the latitude and longitude coordinates of the vacant parking space.
[0091] Accordingly, the determining module is also used for:
[0092] The latitude and longitude coordinates of the vacant parking space are determined based on the position coordinates of the vacant parking space in the world coordinate system and the latitude and longitude coordinates of the target camera.
[0093] The above-described products can perform the methods provided in any embodiment of this application and have the corresponding functional modules and effects of performing the methods.
[0094] Example 3
[0095] Figure 7 is a schematic diagram of an electronic device according to Embodiment 3 of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0096] As shown in Figure 7, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer programs stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0097] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0098] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the parking space location determination method.
[0099] In some embodiments, the parking space location determination method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the parking space location determination method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the parking space location determination method by any other suitable means (e.g., by means of firmware).
[0100] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0102] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A machine-readable storage medium may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0104] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0105] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. The client-server relationship is established by running computer programs on the respective computers that establish this relationship. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service ecosystem. It addresses the shortcomings of traditional physical hosting and VPS services, such as high management difficulty and weak business scalability.
[0106] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0107] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the parking space location determination method according to any embodiment of this application.
Claims
1. A method for determining the location of a parking space, comprising: Acquire a target parking lot image captured by a target camera in the parking lot, wherein the target parking lot image includes parking space images; The target parking lot image is input into the target parking space detection model to obtain the center image coordinates of the parking space corresponding to the vacant parking space. The target parking space detection model is obtained by iteratively training an initial parking space detection model using a parking lot image sample set. The initial parking space detection model includes a neck network, which includes a CPP-CBAM layer. The geographical location information of the vacant parking space is determined based on the geographical location information of the target camera and the center image coordinates of the vacant parking space.
2. The method according to claim 1, wherein, The initial parking space detection model also includes: a backbone network and a detection network; The backbone network includes: a Focus layer, multiple CBS layers, multiple CSP layers, and an SPPBottleneck layer; the neck network includes: multiple Conv layers, multiple UpSample layers, CPP-CBAM layers, multiple DownSample layers, and multiple CSP layers; the detection network includes: multiple YoloHead layers.
3. The method according to claim 2, wherein, The backbone network, from input to output, includes the following layers in sequence: Focus layer, first CBS layer, second CBS layer, first CSP layer, third CBS layer, second CSP layer, fourth CBS layer, third CSP layer, fifth CBS layer, SPPBottleneck layer, and fourth CSP layer. The neck network, from input to output, includes, in sequence: a first Conv layer, a first UpSample layer, a CPP-CBAM layer, a second Conv layer, a second UpSample layer, a fifth CSP layer, a third Conv layer, a third UpSample layer, a sixth CSP layer, a first DownSample layer, a seventh CSP layer, a second DownSample layer, an eighth CSP layer, a third DownSample layer, and a ninth CSP layer. The feature map output by the first CSP layer is concatenated with the feature map output by the third UpSample layer to serve as the input feature map of the sixth CSP layer. The feature map output by the sixth CSP layer serves as the input feature map of the first YoloHead layer in the detection network. The feature map output from the second CSP layer is concatenated with the feature map output from the second UpSample layer and used as the input feature map for the third Conv layer. The feature map output by the third CSP layer is concatenated with the feature map output by the first UpSample layer and used as the input feature map of the CPP-CBAM layer. The feature map output by the third Conv layer is concatenated with the feature map output by the first DownSample layer and used as the input feature map of the seventh CSP layer. The feature map output by the seventh CSP layer is used as the input feature map of the second YoloHead layer in the detection network. The feature map output by the second Conv layer is concatenated with the feature map output by the second DownSample layer and used as the input feature map of the eighth CSP layer. The feature map output by the eighth CSP layer is used as the input feature map of the third YoloHead layer in the detection network. The feature map output by the first Conv layer and the feature map output by the third DownSample layer are concatenated to form the input feature map of the ninth CSP layer. The feature map output by the ninth CSP layer is used as the input feature map of the fourth YoloHead layer in the detection network.
4. The method according to claim 3, wherein, The CPP-CBAM layer, from input to output, includes, in sequence, a parallel first branch and a second branch, a fourth Conv layer, and a CBAM layer. The first branch, from input to output, includes, in sequence, an Avgpool layer and a fourth UpSample layer. The second branch, from input to output, includes, in sequence, a Maxpool layer and a fifth UpSample layer. The CBAM layer, from input to output, includes, in sequence, a Channel module layer and a Space module layer. The feature map output from the first branch is concatenated with the feature map output from the second branch and used as the input feature map for the fourth Conv layer.
5. The method according to claim 1, wherein, The geographic location information of the target camera includes: the height of the target camera and the downward angle of the target camera; the geographic location information of the vacant parking space includes: the position coordinates of the vacant parking space in the world coordinate system; Accordingly, the geographical location information of the vacant parking space is determined based on the geographical location information of the target camera and the center image coordinates of the vacant parking space, including: Obtain the target camera's resolution, vertical field of view, and horizontal field of view; The position coordinates of the vacant parking space in the world coordinate system are determined based on the position coordinates of the parking space in the image coordinate system, the resolution of the target camera, the longitudinal field of view of the target camera, the lateral field of view of the target camera, the height of the target camera, and the top angle of the target camera.
6. The method according to claim 5, wherein, The geographic location information of the target camera also includes: the latitude and longitude coordinates of the target camera; the geographic location information of the vacant parking space also includes: the latitude and longitude coordinates of the vacant parking space. Correspondingly, it also includes: determining the latitude and longitude coordinates of the vacant parking space based on the position coordinates of the vacant parking space in the world coordinate system and the latitude and longitude coordinates of the target camera.
7. A parking space location determination device, comprising: The acquisition module is configured to acquire images of a target parking lot captured by a target camera in the parking lot, wherein the target parking lot images include images of parking spaces; The module is configured to input the target parking lot image into the target parking space detection model to obtain the center image coordinates of the parking space corresponding to the vacant parking space. The target parking space detection model is obtained by iteratively training an initial parking space detection model through a parking lot image sample set. The initial parking space detection model includes a neck network, which includes a CPP-CBAM layer. The determination module is configured to determine the geographical location information of the vacant parking space based on the geographical location information of the target camera and the center image coordinates of the parking space corresponding to the vacant parking space.
8. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the parking space location determination method according to any one of claims 1-6.
9. A computer-readable storage medium storing computer instructions that, when executed by a processor, implement the parking space location determination method according to any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the parking space location determination method according to any one of claims 1-6.
Citation Information
Patent Citations
Intelligent parking method, equipment and system
CN110473428A
Parking space information determination method, device and system, electronic equipment and computer medium
CN115601990A
Shared bicycle idle parking space identification method, parking guide method and system
CN115641746A
Parking space position determination method, device, equipment, medium and product
CN118430266A
Parking slot detection method and system
US20230146185A1
Cited By
Feature extraction method, device and equipment for segment to be spliced, medium and product
CN122049406A