Parking space occupancy rate determination method and device

By analyzing the width-to-height ratio and distance of vehicle detection boxes, and combining a nonmodal perceptual regression model and a Hungarian matching algorithm, the occlusion problem of parking space detection from a bird's-eye view is solved, achieving efficient and accurate parking space occupancy determination, which is suitable for large parking lot management.

CN120976896BActive Publication Date: 2026-04-24SUZHOU YIJI INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU YIJI INTELLIGENT TECH CO LTD
Filing Date
2025-10-20
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing parking space occupancy detection technologies suffer from missed detections due to occupancy and perspective distortion from a bird's-eye view. Furthermore, hardware sensor solutions are expensive and complex to install, making it difficult to achieve low-cost and high-efficiency deployment in large parking lots.

Method used

By analyzing the width-to-height ratio and distance of vehicle detection boxes, occluded vehicles are identified. The detection boxes are completed using a non-modal perceptual regression model. Combined with multi-dimensional cost information such as coverage, weighted Manhattan distance, and IOU, the Hungarian matching algorithm is used to match vehicles with parking spaces and dynamically update the parking space status.

Benefits of technology

It effectively overcomes the omissions and misjudgments caused by occlusion and perspective distortion, improves the accuracy and robustness of parking space status determination, and has the advantages of low cost and easy deployment, making it suitable for large parking lot management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976896B_ABST
    Figure CN120976896B_ABST
Patent Text Reader

Abstract

The application provides a parking space occupancy determination method and device, which comprises the following steps: obtaining parking space coordinate information in an original image; obtaining detection frame coordinate information from the original image based on a target detection algorithm; calculating the width and height of a vehicle detection frame according to the detection frame coordinate information, and obtaining a first detection ratio according to the width and height; determining whether the vehicle detection frame is blocked according to the first detection ratio and a preset detection threshold; if the vehicle detection frame is blocked, extracting a vehicle detection frame image from the original image, inputting the vehicle detection frame image into a non-modal perception regression model for completion, and obtaining completed detection frame coordinate information; and matching the vehicle detection frame with the parking space by using a preset matching algorithm according to the parking space coordinate information, the detection frame coordinate information or the completed detection frame coordinate information, and multi-dimensional cost information, to determine whether the parking space is occupied. The method and device can improve the accuracy and robustness of the parking space occupancy determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image recognition processing technology, and in particular to a method and apparatus for determining parking space occupancy rate. Background Technology

[0002] Existing parking space occupancy detection technologies can be mainly divided into two categories. The first category is software-based solutions based on computer vision. These typically use object detection algorithms to identify vehicles on unobstructed satellite or aerial images, and then combine this with preset parking space coordinates to determine occupancy status. However, this type of method becomes significantly less effective when applied to data collected by ground-based or low-altitude bird's-eye view cameras. This is because, from a bird's-eye view, vehicles undergo significant deformation and scale differences due to perspective. More importantly, frequent occupancy between vehicles can lead to serious missed detections, making it impossible to accurately determine the true status of obscured parking spaces.

[0003] The second type relies on hardware sensor facilities, such as deploying geomagnetic, ultrasonic, or radar sensors in each parking space to detect changes in physical state and thus determine occupancy. While this method can alleviate the occupancy problem, it suffers from inherent drawbacks such as high deployment and maintenance costs, complex construction, and system robustness affected by single points of failure, making it difficult to achieve low-cost, high-efficiency widespread application in large parking lots.

[0004] Therefore, there is a lack of a purely visual method and device for determining parking space utilization that can effectively address the problems of target distortion and severe occlusion from a bird's-eye view, while also having the advantages of low cost and easy deployment. Summary of the Invention

[0005] Therefore, it is necessary to provide a method and device for determining parking space utilization rate to address the aforementioned technical problems.

[0006] In a first aspect, the present invention provides a method for determining parking space utilization rate, the method comprising:

[0007] Obtain the coordinates of each parking space in the original image;

[0008] Based on the object detection algorithm, the coordinate information of the detection boxes of each vehicle is obtained from the original image;

[0009] Based on the coordinate information of each detection frame, the width and height of each vehicle detection frame are calculated respectively, and the ratio of the width to the height of each vehicle detection frame is calculated based on the width and height of each vehicle detection frame to obtain the corresponding first detection ratio.

[0010] Based on each first detection ratio and the preset detection threshold, determine whether there is any obstruction in the detection frame of each vehicle;

[0011] If the vehicle detection box is occluded, the corresponding vehicle detection box image is extracted from the original image, and the vehicle detection box image is input into the non-modal perceptual regression model for completion to obtain the coordinate information of the completed detection box.

[0012] Based on the parking space coordinates, the detection box coordinates or the completed detection box coordinates, and multi-dimensional cost information, a preset matching algorithm is used to match the vehicle detection box with the parking space to determine whether the parking space is occupied.

[0013] Optionally, based on each first detection ratio and a preset detection threshold, it is determined whether each vehicle detection frame is obstructed, including:

[0014] Each first detection ratio is compared with a preset detection threshold;

[0015] If the first detection ratio is less than or equal to the preset detection threshold, it is determined that the corresponding vehicle detection frame is obstructed.

[0016] If the first detection ratio is greater than the preset detection threshold, obtain the coordinate information of the center point of the parking space based on the parking space coordinate information, and obtain the coordinate information of the vehicle feature point based on the detection box coordinate information;

[0017] Based on the coordinates of the parking space center point and the vehicle feature point, calculate the first Euclidean distance between the vehicle feature point and the parking space center point.

[0018] If the first Euclidean distance is less than or equal to the first preset distance threshold, it is determined that the corresponding vehicle detection frame is occluded.

[0019] Optionally, if the vehicle detection box is occluded, the corresponding vehicle detection box image is extracted from the original image, and the vehicle detection box image is input into a non-modal perceptual regression model for completion, obtaining the coordinate information of the completed detection box, including:

[0020] If the vehicle detection box is occluded, the corresponding vehicle detection box image is cropped from the original image and compressed to obtain a vehicle detection box image of a preset size.

[0021] The vehicle detection box image of the preset size is input into the non-modal perception regression model for completion, and the coordinate information of the completed detection box is obtained.

[0022] Optionally, before determining whether a parking space is occupied, a preset matching algorithm is used to match the vehicle detection box with the parking space based on the parking space coordinate information, the detection box coordinate information or the completed detection box coordinate information, and multi-dimensional cost information. This process also includes:

[0023] Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, calculate the coverage between the vehicle detection frame and the parking space, and calculate the coverage cost information based on the coverage.

[0024] Based on the coordinate information of each parking space and the preset threshold, the distance threshold is calculated, and the distance cost information is calculated based on the distance normalized threshold and the coordinate information of each detection box, or based on the distance normalized threshold and the coordinate information of each completed detection box.

[0025] Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, calculate the IoU between the vehicle detection frame and the parking space, and calculate the IoU cost information based on the IoU.

[0026] Calculate multi-dimensional cost information based on coverage cost information, distance cost information, and IOU cost information.

[0027] Optionally, based on parking space coordinates, detection box coordinates or completed detection box coordinates, and multi-dimensional cost information, a preset matching algorithm is used to match the vehicle detection box with the parking space to determine whether the parking space is occupied, including:

[0028] Obtain the number of vehicles and the number of parking spaces, and use the larger of the two values ​​as the matrix dimension to construct a square matrix;

[0029] Construct a multi-dimensional cost matrix based on a square matrix and multi-dimensional cost information, or based on a square matrix, multi-dimensional cost information, and preset padding values.

[0030] The multi-dimensional cost matrix is ​​pre-judged to filter out invalid matching pairs with coverage less than or equal to 0 and / or first Euclidean distance greater than the distance threshold and / or IoU less than the first preset IoU threshold, thus obtaining the filtered multi-dimensional cost matrix.

[0031] The Hungarian matching algorithm is used to process the filtered multi-dimensional cost matrix to obtain the optimal matching relationship between the vehicle detection box and the parking space.

[0032] Based on the optimal matching relationship between the vehicle detection frame and the parking space, it is determined whether the parking space is occupied.

[0033] Optionally, based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, the coverage between the vehicle detection frame and the parking space is calculated, and the coverage cost information is calculated based on the coverage, including:

[0034] Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, calculate the area of ​​the parking space and the area of ​​the vehicle detection frame respectively.

[0035] Calculate the overlap area between the parking space area and the vehicle detection frame area;

[0036] Based on the parking space area and the overlapping area, the coverage cost information is calculated, and the coverage cost information is calculated using the following formula; ,in, Information is sacrificed for coverage. Coverage is the ratio of the overlapping area to the parking space area.

[0037] Optionally, a distance threshold is calculated based on the coordinate information of each parking space and a preset threshold, and distance cost information is calculated based on the distance normalization threshold and the coordinate information of each detection box, or based on the distance normalization threshold and the coordinate information of each completed detection box, including:

[0038] Based on the coordinates of each parking space and a preset threshold, a distance threshold is calculated using the following formula: ,in, For parking space width, For parking space height, The preset threshold;

[0039] Based on the coordinate information of each parking space, obtain the coordinate information of the center point of the parking space;

[0040] Obtain the coordinate information of vehicle feature points based on the coordinate information of the detection box or the coordinate information of the completed detection box;

[0041] Based on the coordinates of the parking space center point and the vehicle feature point, a weighted Manhattan distance algorithm is used to calculate the absolute distance between the vehicle feature point and the parking space center point as the distance cost information. The absolute distance between the vehicle feature point and the parking space center point is calculated using the following formula: ,in, The horizontal weighting coefficient. This represents the pixel distance difference between the vehicle detection frame and the parking space in the horizontal direction. This represents the pixel distance difference between the vehicle detection bounding box and the parking space in the vertical direction. The vertical weighting coefficient. This is the distance threshold.

[0042] Optionally, based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, the IoU between the vehicle detection frame and the parking space is calculated, and the IoU cost information is calculated based on the IoU, including:

[0043] Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, the area of ​​the parking space and the area of ​​the vehicle detection frame are calculated respectively.

[0044] Calculate the overlap area between the parking space area and the vehicle detection frame area;

[0045] Calculate the union of the parking space area, the vehicle detection frame area, and the overlapping area to obtain the union area;

[0046] Calculate the ratio of the overlapping area to the union area to obtain the IOU between the vehicle detection box and the parking space;

[0047] Calculated based on IOU Cost information, among which, The cost information is calculated using the following formula; ,in, for Cost information, This represents the overlap rate.

[0048] Optionally, the method further includes:

[0049] Determine whether the IOU is greater than or equal to the second preset IOU threshold;

[0050] If the IOU is greater than or equal to the second preset IOU threshold and the coverage is greater than 0, the vehicle is tracked continuously frame by frame based on the target tracking algorithm to obtain the motion trajectory coordinates of the vehicle for n consecutive frames.

[0051] Based on the motion trajectory coordinates, linear regression or simple difference algorithm is used to analyze the vehicle motion trend;

[0052] When the vehicle's movement trend is away from the obscured parking space, the obscured parking space is marked as released.

[0053] When a vehicle moves toward a blocked parking space and the blocked parking space is unoccupied, the blocked parking space will be marked as occupied.

[0054] Optionally, the method further includes:

[0055] The parking space utilization rate is determined by the ratio of the number of matched parking spaces to the total number of parking spaces in the matching results.

[0056] Secondly, the present invention provides a parking space utilization rate determination device, the device comprising:

[0057] The coordinate acquisition module is used to obtain the coordinate information of each parking space in the original image;

[0058] The target detection module, connected to the coordinate acquisition module, is used to obtain the coordinate information of the detection boxes of each vehicle from the original image based on the target detection algorithm.

[0059] The calculation module, connected to the target detection module, is used to calculate the width and height of each vehicle detection frame based on the coordinate information of each detection frame, and to calculate the ratio of the width to the height of each vehicle detection frame based on the width and height of each vehicle detection frame, thereby obtaining the corresponding first detection ratio.

[0060] The occlusion analysis module, connected to the calculation module, is used to determine whether there is occlusion in each vehicle detection frame based on each first detection ratio and a preset detection threshold.

[0061] The image correction module, connected to the occlusion analysis module, is used to extract the corresponding vehicle detection box image from the original image if the vehicle detection box is occluded, and input the vehicle detection box image into the non-modal perceptual regression model for completion, so as to obtain the coordinate information of the completed detection box.

[0062] The matching module, which is connected to the coordinate acquisition module, the target detection module, and the image correction module, is used to match the vehicle detection box with the parking space based on the parking space coordinate information, the detection box coordinate information or the detection box coordinate information after completion, and multi-dimensional cost information, using a preset matching algorithm to determine whether the parking space is occupied.

[0063] The parking space occupancy determination method and apparatus provided by this invention first intelligently identify potentially occluded vehicles by analyzing the ratio of the width to the height of the vehicle detection box and its distance from the center point of the parking space. For occluded vehicles, a pre-trained non-modal perceptual regression model is used to complete the incomplete vehicle detection box and predict the complete vehicle detection box. Subsequently, a multi-dimensional cost information system integrating coverage, weighted Manhattan distance, and intersection-union ratio (IoU) is constructed, and a Hungarian matching algorithm is used to perform globally optimal matching of vehicles and parking spaces, thereby accurately determining the parking space occupancy status. For severely occluded scenarios, motion trend analysis based on multi-frame tracking is also introduced to dynamically update the parking space status. The method and apparatus of this invention effectively overcome the problem of missed detections and misjudgments caused by occlusion and perspective distortion in pure vision solutions under bird's-eye view, significantly improving the accuracy and robustness of parking space status determination. At the same time, it does not require the deployment of expensive hardware sensors, and has the advantages of low cost, easy deployment and maintenance, providing a reliable and efficient technical solution for the intelligent management of large parking lots. Attached Figure Description

[0064] Figure 1a This is a flowchart illustrating a parking space utilization rate determination method provided in an embodiment of the present invention.

[0065] Figure 1b This is another flowchart illustrating the parking space utilization rate determination method provided in an embodiment of the present invention;

[0066] Figure 1cThis is another flowchart illustrating the parking space utilization rate determination method provided in this embodiment of the invention.

[0067] Figure 1d This is another flowchart illustrating the parking space utilization rate determination method provided in an embodiment of the present invention;

[0068] Figure 2a This is a schematic diagram of a circuit module structure of the parking space utilization rate determination device provided in an embodiment of the present invention;

[0069] Figure 2b This is a schematic diagram of another circuit module structure of the parking space utilization rate determination device provided in an embodiment of the present invention;

[0070] Figure 3 This is an internal structural diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0072] like Figure 1a As shown, the present invention provides a method for determining parking space utilization rate, the method comprising:

[0073] Step S10: Obtain the parking space coordinates of each parking space in the original image;

[0074] In this invention, the original image is a panoramic bird's-eye view of a scene such as a parking lot with parking spaces. This panoramic bird's-eye view can be obtained by capturing and stitching together multiple frames of fused video images of the target area using an array camera.

[0075] In this invention, the parking space coordinate information of each parking space can be obtained from the original image using existing methods, such as using Labelme image annotation software to draw according to the parking spaces in the original image, thereby obtaining the parking space coordinate information of the polygonal parking space, that is, the coordinates of the four vertices of the polygonal parking space.

[0076] It should be noted that, in order to make the parking space coordinate information obtained from the original image more accurate, it is preferable to obtain the parking space coordinate information of each parking space from only the original image containing the parking spaces, so as to avoid the influence of vehicles on the acquisition process. In addition, since the original image in this invention is a panoramic bird's-eye view image, the original image will be distorted, so that the parking spaces in the original image are polygonal.

[0077] Step S11: Based on the object detection algorithm, obtain the coordinate information of the detection boxes of each vehicle from the original image;

[0078] The target detection algorithm can be an existing target detection algorithm, such as the YOLOv8 target detection algorithm. Those skilled in the art can choose flexibly according to actual needs, and there is no limitation here.

[0079] Step S12: Calculate the width and height of each vehicle detection frame according to the coordinate information of each detection frame, and calculate the ratio of the width to the height of each vehicle detection frame according to the width and height of each vehicle detection frame to obtain the corresponding first detection ratio.

[0080] Step S13: Determine whether there is any occlusion in the detection frame of each vehicle based on each first detection ratio and the preset detection threshold;

[0081] Under normal circumstances, the ratio of the width to the height of the vehicle detection frame, i.e., the first detection ratio, is generally greater than or equal to 1 / 3. However, when the vehicle is obscured, a severe imbalance occurs (e.g., the first detection ratio is less than or equal to 1 / 4). Therefore, the preset detection threshold should be less than 1 / 3. Preferably, the preset detection threshold is 1 / 4. Of course, those skilled in the art can flexibly adjust the preset detection threshold according to the needs of the actual scenario, which is not limited here.

[0082] In one optional embodiment of the present invention, such as Figure 1b As shown, step S13 specifically includes:

[0083] Step S131: Compare each first detection ratio with a preset detection threshold;

[0084] Step S132: If the first detection ratio is less than or equal to the preset detection threshold, determine that the corresponding vehicle detection frame is obstructed;

[0085] Step S133: If the first detection ratio is greater than the preset detection threshold, obtain the coordinate information of the center point of the parking space based on the parking space coordinate information, and obtain the coordinate information of the vehicle feature point based on the detection box coordinate information;

[0086] The coordinates of the center point of the parking space can be calculated using the existing vertex coordinate averaging method for polygonal parking spaces. Of course, those skilled in the art can also use other calculation methods, which are not limited here.

[0087] Specifically, if the coordinates of the four vertices of a parking space obtained from the original image are (100, 50), (200, 50), (200, 150), and (100, 150), the average of the x-coordinates of all vertices is calculated using the vertex coordinate averaging method to obtain the x-coordinate of the center point of the parking space (i.e., The average of the y-coordinates of all vertices is used as the y-coordinate of the center point of the parking space (i.e., ):

[0088]

[0089]

[0090] Therefore, the coordinates of the center point of this parking space are (150, 100). This method is simple and effective, applicable to any polygonal parking space, and can accurately represent the geometric center of the polygonal parking space, providing a basis for subsequent calculation of the distance between the vehicle feature points and the center point of the parking space.

[0091] In this invention, the vehicle detection bounding box output by the YOLOv8 object detection algorithm is typically the center point coordinate information of a rectangle. The coordinate information of the center point is relative coordinate information. In order to unify the coordinate information in this invention, the relative coordinate information can be converted into absolute coordinate information according to the formula: absolute coordinate information = relative coordinate information × image size.

[0092] For example, if the original image size is 1920x1080 pixels, the coordinate information of the detection box output by the YOLOv8 object detection algorithm is: The coordinates of the detection box after converting the relative coordinates to absolute coordinates are: .

[0093] When the original image is undistorted, the center point of the vehicle detection box can be used as the vehicle feature point, and the coordinate information of the vehicle feature point is the coordinate information of the center point of the vehicle detection box. When the original image is distorted, in order to avoid the viewpoint overlap between the vehicle feature point and adjacent parking spaces, those skilled in the art can set an offset threshold according to actual needs. This is to adjust the coordinate information of the center point of the vehicle detection frame.

[0094] Continuing with the previous example, if the offset threshold is set in advance... The offset threshold after converting the relative coordinate information to absolute coordinate information is (0, -30). Therefore, the vehicle feature point coordinate information is: .

[0095] Step S134: Based on the coordinates of the parking space center point and the vehicle feature point, calculate the first Euclidean distance between the vehicle feature point and the parking space center point; specifically, based on the coordinates of the parking space center point... Vehicle feature point coordinate information Calculate the first Euclidean distance between the vehicle feature point and the center point of the parking space. Continuing with the previous example, Pixel.

[0096] Step S135: If the first Euclidean distance is less than or equal to the first preset distance threshold, determine that the corresponding vehicle detection frame is occluded.

[0097] The first preset distance threshold can be half the width of the parking space. Those skilled in the art can set it flexibly according to actual needs, and it is not limited here.

[0098] Continuing the previous example, based on the parking space coordinates, the width of the parking space can be calculated to be 50 pixels. If the first preset distance threshold is half the width of the parking space, i.e., 25 pixels, then due to the first Euclidean distance... , Therefore, it is determined that the vehicle detection box is not occluded, and step S14 is not executed, meaning that there is no need to complete the vehicle detection box image. Assume the first Euclidean distance... 20, Therefore, it is determined that the vehicle detection frame is obstructed, and step S14 is executed.

[0099] Step S14: If the vehicle detection box is occluded, extract the corresponding vehicle detection box image from the original image, and input the vehicle detection box image into the non-modal perceptual regression model for completion to obtain the coordinate information of the completed detection box.

[0100] In one optional embodiment of the present invention, such as Figure 1c As shown, step S14 specifically includes:

[0101] Step S141: If the vehicle detection box is occluded, crop the corresponding vehicle detection box image from the original image and compress the vehicle detection box image to obtain a vehicle detection box image of a preset size.

[0102] For example, from the original image (1920x1080 pixels), the corresponding region is cropped based on the bounding box coordinates [500, 300, 600, 350]. The cropped image is a rectangular region, 100 pixels wide and 50 pixels high, containing only the visible portion of vehicle A (due to occlusion, only the front or rear of the vehicle may be displayed). The cropping operation is implemented using the cropping function of an image processing library (such as OpenCV): `cropped_image=original_image[300:350,500:600]`. Note that the coordinates may need to be adjusted according to the image coordinate system. The cropped image size is 100x50 pixels, but the Amodal network requires a fixed input size (128x128 pixels). Therefore, the cropped image needs to be compressed (scaled) to fit the input size. An image scaling algorithm (such as bilinear interpolation) is used to compress the image to 128x128 pixels. Compression may cause image distortion because the aspect ratio (2.0) of the original cropped image is inconsistent with the target size (1.0), but the Amodal network model has been pre-trained to handle this distortion.

[0103] Step S142: Input the vehicle detection box image of the preset size into the non-modal perception regression model for completion, and obtain the coordinate information of the completed detection box.

[0104] Continuing with the previous example, after obtaining a vehicle detection box image of a preset size (128x128 pixels), this vehicle detection box image will be fed as input into the nonmodal perceptual regression model (Amodal network model) for completion, in order to predict the completed vehicle detection box (B_complete).

[0105] The non-modal perceptual regression model is a pre-trained amodal network model, which consists of three convolutional layers, each followed by a ReLU activation function. The first two layers also include max pooling layers for downsampling. The specific process is as follows:

[0106] The first convolutional layer (3→32 channels) extracts basic features (3×128×128→32×128×128), and the size is halved after pooling (32×128×128→32×64×64).

[0107] The second convolutional layer (32→64 channels) captures higher-level features (32×64×64→64×64×64), and then pools again to reduce the size (64×64×64→64×32×32).

[0108] The third convolutional layer (64→128 channels) deepens semantic feature extraction (64×32×32→128×32×32);

[0109] Finally, adaptive average pooling is used to fix the feature map to a size of 4×4, forming a 128×4×4 feature tensor.

[0110] The feature tensor is flattened into a 2048-dimensional vector, then compressed into a 128-dimensional hidden feature through a fully connected layer. Finally, the output layer regresses four coordinate values ​​(i.e., the coordinate information of the completed detection box). This process utilizes the amodal network model's understanding of occluded regions to predict the complete vehicle detection box (B_complete) for the occluded vehicle.

[0111] The four coordinates output by the amodal network model are the coordinate information of the completed detection box. Its coverage is more complete than the original vehicle detection box, and it can more accurately represent the actual occupancy of the vehicle.

[0112] Step S15: Based on the parking space coordinates, the detection box coordinates or the completed detection box coordinates, and the multi-dimensional cost information, a preset matching algorithm is used to match the vehicle detection box with the parking space to determine whether the parking space is occupied.

[0113] Optionally, such as Figure 1d As shown, step S15 specifically includes:

[0114] Step S151: Obtain the number of vehicles and the number of parking spaces, and use the larger of the two values ​​as the matrix dimension to construct a square matrix;

[0115] For example, if there are 50 vehicles and 100 parking spaces, a square matrix of 100×100 is constructed using the number of parking spaces as the matrix dimension; if there are 50 vehicles and 30 parking spaces, a square matrix of 50×50 is constructed using the number of vehicles as the matrix dimension. The reason for constructing a square matrix in step S151 is to meet the input requirements of the Hungarian matching algorithm.

[0116] Step S152: Construct a multi-dimensional cost matrix based on a square matrix and multi-dimensional cost information, or based on a square matrix, multi-dimensional cost information, and preset padding values;

[0117] For each vehicle and each parking space, a multi-dimensional cost information can be calculated. Taking 2 vehicles and 3 parking spaces as an example, a 3x3 square matrix can be constructed as shown below:

[0118] Parking space 1 Parking space 2 Parking space 3

[0119] Vehicle 1: a11 a12 a13

[0120] Vehicle 2: a21 a22 a23

[0121] Empty: a31 a32 a33

[0122] Since the number of parking spaces is greater than the number of vehicles, the third row of the square matrix above is empty. In this case, a preset fill value can be used to fill it, such as 99999, resulting in a 3-row, 3-column square matrix as shown below:

[0123] Parking space 1 Parking space 2 Parking space 3

[0124] Vehicle 1: a11 a12 a13

[0125] Vehicle 2: a21 a22 a23

[0126] Empty: 99999 99999 99999

[0127] It should be noted that, typically, vehicles are grouped into rows and parking spaces into columns, but this can be adjusted according to the actual situation; no limitation is made here. Those skilled in the art can also choose the preset fill value according to actual needs; no limitation is made here. Using 99999 here ensures it will be filtered out as an invalid value in subsequent calculations, thus avoiding affecting the results.

[0128] Step S153: Perform pre-judgment processing on the multi-dimensional cost matrix to filter out invalid matching pairs with coverage less than or equal to 0 and / or first Euclidean distance greater than distance threshold and / or IOU less than first preset IOU threshold, and obtain the filtered multi-dimensional cost matrix;

[0129] The first preset IOU threshold is preferably 0.3, but those skilled in the art can choose flexibly according to actual needs, and no limitation is made here.

[0130] Step S154: The Hungarian matching algorithm is used to process the filtered multi-dimensional cost matrix to obtain the optimal matching relationship between the vehicle detection box and the parking space;

[0131] To enable those skilled in the art to clearly understand the parking space utilization rate determination method of the present invention, step S154 will be described in detail below.

[0132] Step 1: Algorithm Initialization

[0133] ① Obtain the filtered multi-dimensional cost matrix, which is an n×n square matrix;

[0134] ② Initialize auxiliary data structures: starred matrix: marks the zero point of the asterisk (initial matching); primed matrix: marks the zero point of the apostrophe; row_covered and col_covered arrays: record the coverage status of rows and columns.

[0135] Step 2: Normalization

[0136] Iterate through each row of the multi-dimensional cost matrix, find the minimum value of that row, and subtract this minimum value from all elements in that row. The goal is to eliminate cost differences between rows, ensuring that each row contains at least one zero element.

[0137] Step 3: Column Normalization + Initial Matching

[0138] Iterate through each column, find the minimum value of that column, and subtract this minimum value from all elements in that column; find independent zeros (values ​​of 0 and whose rows and columns are not occupied) in the normalized matrix; mark these zeros with an asterisk (starred=1) and mark the corresponding rows and columns as covered; clear all covering marks to complete the initial matching.

[0139] Step 4: Check the completeness of the solution

[0140] Cover all columns containing asterisks and zeros, and count the number of covered columns. If the number of covered columns is greater than or equal to the size of the multi-dimensional cost matrix, it means a perfect match has been found, and you can directly jump to result extraction. Otherwise, go to step 5 to continue searching for a better match.

[0141] Step 5: Find the starting point of the augmentation path

[0142] Loop through the uncovered zeros and mark them as apostrophe zeros (primed=1) when found. Check if there are asterisk zeros in the row containing the original zero. If there are, cover the row, expose the column containing the asterisk zeros, and continue the search. If not, find the starting point of the augmenting path and go to step six. If no uncovered zeros are found, go to step seven.

[0143] Step 6: Build and execute augmenting paths

[0144] Construct an alternating path starting from the uncovered apostrophe zero; path pattern: apostrophe → asterisk → apostrophe → asterisk...; apostrophes on the path become asterisks, asterisks become blank, and all overlay and apostrophe markers are cleared, then return to step four to recheck the completeness of the solution.

[0145] Step 7: Creating a New Zero

[0146] Find the minimum value among all uncovered elements; add the minimum value to the positions covered by rows, subtract the minimum value from the positions not covered by columns, keep the row and column intersection positions unchanged, and return to step 5 to continue searching for augmenting paths.

[0147] Step 8: Result Extraction

[0148] Extract matching results from the final assignment array; filter out invalid matches with a cost of 99999 (matches excluded in the pre-judgment phase); return the parking space index corresponding to each vehicle, and return -1 for unmatched vehicles.

[0149] Through the above steps, the Hungarian matching algorithm can efficiently find the optimal allocation scheme with the minimum total matching cost, providing a reliable basis for accurately determining the occupancy status of parking spaces. The algorithm has a time complexity of O(n³) and is suitable for matching vehicles and parking spaces in scenarios such as parking lots.

[0150] Step S155: Determine whether the parking space is occupied based on the optimal matching relationship between the vehicle detection frame and the parking space.

[0151] In an optional embodiment of the present invention, the method further includes the following step before step S15:

[0152] Step S16: Calculate the coverage of the vehicle detection frame and the parking space based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, and calculate the coverage cost information based on the coverage.

[0153] Optionally, step S16 specifically includes:

[0154] Step S161: Calculate the parking space area and vehicle detection frame area respectively based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame.

[0155] Step S162: Calculate the overlap area between the parking space area and the vehicle detection frame area;

[0156] Step S163: Calculate the coverage cost information based on the parking space area and the overlapping area, wherein the coverage cost information is calculated using the following formula; ,in, Information is sacrificed for coverage. Coverage is the ratio of overlapping area to parking space area. The value range of coverage cost information is [0,1].

[0157] Step S17: Calculate the distance threshold based on the coordinate information of each parking space and the preset threshold, and calculate the distance cost information based on the distance normalization threshold and the coordinate information of each detection box or based on the distance normalization threshold and the coordinate information of each completed detection box;

[0158] Optionally, step S17 specifically includes:

[0159] Step S171: Calculate the distance threshold based on the coordinates of each parking space and the preset threshold. The distance threshold is calculated using the following formula: ,in, For parking space width, For parking space height, The preset threshold;

[0160] The preset threshold can be flexibly selected by those skilled in the art according to actual needs, and is not limited here. Preferably, the preset threshold is 0.4.

[0161] Step S172: Obtain the coordinates of the center point of each parking space based on the coordinates of each parking space;

[0162] Step S173: Obtain the coordinate information of vehicle feature points based on the coordinate information of the detection box or the coordinate information of the completed detection box;

[0163] Step S174: Based on the coordinates of the parking space center point and the vehicle feature point, the weighted Manhattan distance algorithm is used to calculate the absolute distance between the vehicle feature point and the parking space center point as the distance cost information. The absolute distance between the vehicle feature point and the parking space center point is calculated using the following formula: ,in, The horizontal weighting coefficient. This represents the pixel distance difference between the vehicle detection frame and the parking space in the horizontal direction. This represents the pixel distance difference between the vehicle detection bounding box and the parking space in the vertical direction. The vertical weighting coefficient. This is the distance threshold. The distance cost information ranges from [0,1].

[0164] Step S18: Calculate the IOU (Intersection over Union) between the vehicle detection frame and the parking space based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, and calculate the IOU cost information based on the IOU.

[0165] Optionally, step S18 specifically includes:

[0166] Step S181: Calculate the parking space area and vehicle detection frame area respectively based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame.

[0167] Step S182: Calculate the overlap area between the parking space area and the vehicle detection frame area;

[0168] Step S183: Calculate the union of the parking space area, the vehicle detection frame area, and the overlapping area to obtain the union area;

[0169] Step S184: Calculate the ratio of the overlapping area to the union area to obtain the IOU between the vehicle detection box and the parking space;

[0170] Step S185: Calculate based on IOU Cost information, among which, The cost information is calculated using the following formula; ,in, for Cost information, The overlap rate is denoted as Iou. The value range of Iou cost information is [0,1].

[0171] Step S19: Calculate multi-dimensional cost information based on coverage cost information, distance cost information, and IOU cost information.

[0172] Specifically, the multi-dimensional cost information = coverage cost information + distance cost information + IOU cost information; or, the multi-dimensional cost information = first weight coefficient × coverage cost information + second weight coefficient × distance cost information + third weight coefficient × IOU cost information, wherein the first weight coefficient, second weight coefficient and third weight coefficient can be flexibly set by those skilled in the art according to actual needs, and are not limited here.

[0173] In panoramic bird's-eye view images, there may be situations where a large vehicle in the foreground completely obscures a distant parking space and the vehicle in that distant parking space. In such cases, target detection may fail to detect the distant vehicle at all. Therefore, the method of the present invention may further include:

[0174] Step S20: Determine whether the IoU is greater than or equal to the second preset IoU threshold;

[0175] The second preset IOU threshold is preferably 0.8, but those skilled in the art can choose flexibly according to actual needs, and no limitation is made here.

[0176] Step S21: If the IOU is greater than or equal to the second preset IOU threshold and the coverage is greater than 0, the vehicle is tracked continuously frame by frame based on the target tracking algorithm to obtain the motion trajectory coordinates of the vehicle for n consecutive frames.

[0177] The target tracking algorithm used is an existing target tracking algorithm. Those skilled in the art can choose flexibly according to actual needs, and no limitation is made here.

[0178] Step S22: Based on the motion trajectory coordinates, use a linear regression algorithm or a simple difference algorithm to analyze the vehicle's motion trend;

[0179] The linear regression algorithm or the simple difference algorithm are existing linear regression algorithms or simple difference algorithms. Those skilled in the art can choose flexibly according to actual needs, and there is no limitation here.

[0180] Step S23: When the vehicle's movement trend is away from the obscured parking space, mark the obscured parking space as released.

[0181] Step S24: When the vehicle's movement trend is to approach the obscured parking space and the obscured parking space is in an unoccupied state, mark the obscured parking space as occupied.

[0182] In an optional embodiment of the present invention, the method further includes:

[0183] Step S30: Determine the parking space utilization rate based on the ratio of the number of matched parking spaces to the total number of parking spaces in the matching results.

[0184] It should be noted that steps S161-S163, S171-S174, S181-S185, S20-S24 and S30 are not shown in the figure, but are only for ease of description.

[0185] Additionally, it should be noted that when using various coordinate information, those skilled in the art can perform coordinate transformation based on the formula: absolute coordinates = relative coordinates × image size; this is not a limitation here.

[0186] The parking space occupancy determination method of this invention first intelligently identifies potentially occluded vehicles by analyzing the ratio of the width to the height of the vehicle detection box and its distance from the center point of the parking space. For occluded vehicles, a pre-trained non-modal perceptual regression model is used to complete the incomplete vehicle detection box and predict the complete vehicle detection box. Subsequently, a multi-dimensional cost information system integrating coverage, weighted Manhattan distance, and intersection-union ratio (IoU) is constructed, and a Hungarian matching algorithm is used to perform globally optimal matching of vehicles and parking spaces, thereby accurately determining the parking space occupancy status. For severely occluded scenarios, motion trend analysis based on multi-frame tracking is also introduced to dynamically update the parking space status. The method of this invention effectively overcomes the problem of missed detections and misjudgments caused by occlusion and perspective distortion in pure vision solutions under bird's-eye view, significantly improving the accuracy and robustness of parking space status determination. At the same time, it does not require the deployment of expensive hardware sensors, and has the advantages of low cost, easy deployment and maintenance, providing a reliable and efficient technical solution for the intelligent management of large parking lots.

[0187] Based on the same inventive concept, embodiments of the present invention also provide a parking space utilization rate determination device for implementing the parking space utilization rate determination method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the parking space utilization rate determination device provided below can be found in the limitations of the parking space utilization rate determination method described above, and will not be repeated here.

[0188] like Figure 2a As shown, the present invention provides a parking space utilization rate determination device, which includes: a coordinate acquisition module 20, a target detection module 21, a calculation module 22, an occlusion analysis module 23, an image correction module 24, and a matching module 25; wherein,

[0189] The coordinate acquisition module 20 is used to acquire the coordinate information of each parking space in the original image;

[0190] The target detection module 21 is connected to the coordinate acquisition module 20 and is used to obtain the coordinate information of the detection boxes of each vehicle from the original image based on the target detection algorithm.

[0191] The calculation module 22, connected to the target detection module 21, is used to calculate the width and height of each vehicle detection frame according to the coordinate information of each detection frame, and to calculate the ratio of the width to the height of each vehicle detection frame according to the width and height of each vehicle detection frame, so as to obtain the corresponding first detection ratio.

[0192] The occlusion analysis module 23, connected to the calculation module 22, is used to determine whether there is occlusion in each vehicle detection frame based on each first detection ratio and a preset detection threshold.

[0193] The image correction module 24 is connected to the occlusion analysis module 23. If the vehicle detection box is occluded, it extracts the corresponding vehicle detection box image from the original image and inputs the vehicle detection box image into the non-modal perceptual regression model to complete it, thereby obtaining the coordinate information of the completed detection box.

[0194] The matching module 25 is connected to the coordinate acquisition module 20, the target detection module 21 and the image correction module 24 respectively. It is used to match the vehicle detection box with the parking space based on the parking space coordinate information, the detection box coordinate information or the detection box coordinate information after completion, and the multi-dimensional cost information, using a preset matching algorithm to determine whether the parking space is occupied.

[0195] Optionally, the occlusion analysis module 23 is specifically used to: compare each first detection ratio with a preset detection threshold; if the first detection ratio is less than or equal to the preset detection threshold, determine that the corresponding vehicle detection frame is occluded; if the first detection ratio is greater than the preset detection threshold, obtain the coordinate information of the center point of the parking space based on the parking space coordinate information, and obtain the coordinate information of the vehicle feature point based on the detection frame coordinate information; calculate the first Euclidean distance between the vehicle feature point and the center point of the parking space based on the coordinate information of the center point of the parking space and the coordinate information of the vehicle feature point; if the first Euclidean distance is less than or equal to the first preset distance threshold, determine that the corresponding vehicle detection frame is occluded.

[0196] Optionally, the image correction module 24 is specifically used for: if the vehicle detection box is occluded, cropping the corresponding vehicle detection box image from the original image and compressing the vehicle detection box image to obtain a vehicle detection box image of a preset size; inputting the vehicle detection box image of the preset size into the non-modal perceptual regression model for completion to obtain the coordinate information of the completed detection box.

[0197] Optionally, the device further includes: a multi-dimensional cost information calculation module 26, which is connected to the coordinate acquisition module 20, the target detection module 21, the image correction module 24, and the matching module 25. This module is used to calculate the coverage of the vehicle detection frame and the parking space based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame; calculate the distance threshold based on the coordinate information of each parking space and a preset threshold; calculate the distance cost information based on the distance normalization threshold and the coordinate information of each detection frame, or based on the distance normalization threshold and the coordinate information of each completed detection frame; calculate the IoU between the vehicle detection frame and the parking space based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame; and calculate the IoU cost information based on the IoU; and calculate multi-dimensional cost information based on the coverage cost information, the distance cost information, and the IoU cost information.

[0198] Optionally, based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, the coverage between the vehicle detection frame and the parking space is calculated, and the coverage cost information is calculated based on the coverage, including:

[0199] Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, calculate the area of ​​the parking space and the area of ​​the vehicle detection frame respectively.

[0200] Calculate the overlap area between the parking space area and the vehicle detection frame area;

[0201] Based on the parking space area and the overlapping area, the coverage cost information is calculated, and the coverage cost information is calculated using the following formula; ,in, Information is sacrificed for coverage. Coverage is the ratio of the overlapping area to the parking space area.

[0202] Optionally, a distance threshold is calculated based on the coordinate information of each parking space and a preset threshold, and distance cost information is calculated based on the distance normalization threshold and the coordinate information of each detection box, or based on the distance normalization threshold and the coordinate information of each completed detection box, including:

[0203] Based on the coordinates of each parking space and a preset threshold, a distance threshold is calculated using the following formula: ,in, For parking space width, For parking space height, The preset threshold;

[0204] Based on the coordinate information of each parking space, obtain the coordinate information of the center point of the parking space;

[0205] Obtain the coordinate information of vehicle feature points based on the coordinate information of the detection box or the coordinate information of the completed detection box;

[0206] Based on the coordinates of the parking space center point and the vehicle feature point, a weighted Manhattan distance algorithm is used to calculate the absolute distance between the vehicle feature point and the parking space center point as the distance cost information. The absolute distance between the vehicle feature point and the parking space center point is calculated using the following formula: ,in, The horizontal weighting coefficient. This represents the pixel distance difference between the vehicle detection frame and the parking space in the horizontal direction. This represents the pixel distance difference between the vehicle detection bounding box and the parking space in the vertical direction. The vertical weighting coefficient. This is the distance threshold.

[0207] Optionally, based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, the IoU between the vehicle detection frame and the parking space is calculated, and the IoU cost information is calculated based on the IoU, including:

[0208] Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, the parking space area and the vehicle detection frame area are calculated respectively.

[0209] Calculate the overlap area between the parking space area and the vehicle detection frame area;

[0210] Calculate the union of the parking space area, the vehicle detection frame area, and the overlapping area to obtain the union area;

[0211] Calculate the ratio of the overlapping area to the union area to obtain the IOU between the vehicle detection box and the parking space;

[0212] Calculated based on IOU Cost information, among which, The cost information is calculated using the following formula; ,in, for Cost information, This represents the overlap rate.

[0213] Optionally, the matching module 25 is specifically used for: obtaining the number of vehicles and the number of parking spaces, and using the larger of the two values ​​as the matrix dimension to construct a square matrix; constructing a multi-dimensional cost matrix based on the square matrix and multi-dimensional cost information, or based on the square matrix, multi-dimensional cost information, and preset fill values; performing pre-judgment processing on the multi-dimensional cost matrix to filter out invalid matching pairs with coverage less than or equal to 0 and / or a first Euclidean distance greater than a distance threshold and / or an IoU less than a first preset IoU threshold, thereby obtaining a filtered multi-dimensional cost matrix; processing the filtered multi-dimensional cost matrix using the Hungarian matching algorithm to obtain the optimal matching relationship between the vehicle detection box and the parking space; and determining whether the parking space is occupied based on the optimal matching relationship between the vehicle detection box and the parking space.

[0214] Optionally, the matching module 25 is further configured to: determine whether the IOU is greater than or equal to a second preset IOU threshold; if the IOU is greater than or equal to the second preset IOU threshold and the coverage is greater than 0, perform continuous frame tracking of the vehicle based on the target tracking algorithm to obtain the motion trajectory coordinates of the vehicle for n consecutive frames; based on the motion trajectory coordinates, use a linear regression algorithm or a simple difference algorithm to analyze the vehicle's motion trend; when the vehicle's motion trend is moving away from the obscured parking space, mark the obscured parking space as released; when the vehicle's motion trend is moving closer to the obscured parking space and the obscured parking space is in an unoccupied state, mark the obscured parking space as occupied.

[0215] Optionally, the matching module 25 is also used to: determine the parking space utilization rate based on the ratio of the number of matched parking spaces to the total number of parking spaces in the matching results.

[0216] The parking space occupancy determination device of this invention first intelligently identifies potentially occluded vehicles by analyzing the ratio of the width to the height of the vehicle detection box and its distance from the center point of the parking space. For occluded vehicles, a pre-trained non-modal perceptual regression model is used to complete the incomplete vehicle detection box and predict the complete vehicle detection box. Subsequently, a multi-dimensional cost information system integrating coverage, weighted Manhattan distance, and intersection-union ratio (IoU) is constructed, and a Hungarian matching algorithm is used to perform globally optimal matching of vehicles and parking spaces, thereby accurately determining the parking space occupancy status. For severely occluded scenarios, motion trend analysis based on multi-frame tracking is also introduced to dynamically update the parking space status. The device of this invention effectively overcomes the problem of missed detections and misjudgments caused by occlusion and perspective distortion in pure vision solutions under bird's-eye view, significantly improving the accuracy and robustness of parking space status determination. At the same time, it does not require the deployment of expensive hardware sensors, and has the advantages of low cost, easy deployment and maintenance, providing a reliable and efficient technical solution for the intelligent management of large parking lots.

[0217] It should be noted that "multiple" in this invention includes two or more.

[0218] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0219] Each module in the devices of this invention can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0220] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data required or generated for executing the aforementioned parking space utilization determination method. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a parking space utilization determination method.

[0221] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a parking space occupancy rate determination method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0222] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0223] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0224] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0225] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0226] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties.

[0227] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided by this invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided by this invention may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided by this invention may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0228] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0229] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. A method for determining parking space utilization rate, characterized in that, The method includes: Obtain the coordinates of each parking space in the original image; Based on the object detection algorithm, the coordinate information of the detection boxes of each vehicle is obtained from the original image; Based on the coordinate information of each detection frame, the width and height of each vehicle detection frame are calculated respectively, and the ratio of the width to the height of each vehicle detection frame is calculated based on the width and height of each vehicle detection frame to obtain the corresponding first detection ratio. Based on each first detection ratio and the preset detection threshold, determine whether there is any obstruction in the detection frame of each vehicle; If the vehicle detection box is occluded, the corresponding vehicle detection box image is extracted from the original image, and the vehicle detection box image is input into the non-modal perceptual regression model for completion to obtain the coordinate information of the completed detection box. Based on the parking space coordinates, the detection box coordinates or the completed detection box coordinates, and multi-dimensional cost information, a preset matching algorithm is used to match the vehicle detection box with the parking space to determine whether the parking space is occupied.

2. The method according to claim 1, characterized in that, The step of determining whether each vehicle detection frame is obstructed based on each first detection ratio and a preset detection threshold includes: Each first detection ratio is compared with a preset detection threshold; If the first detection ratio is less than or equal to the preset detection threshold, it is determined that the corresponding vehicle detection frame is obstructed. If the first detection ratio is greater than the preset detection threshold, obtain the coordinate information of the center point of the parking space based on the parking space coordinate information, and obtain the coordinate information of the vehicle feature point based on the detection box coordinate information; Based on the coordinates of the parking space center point and the vehicle feature point, calculate the first Euclidean distance between the vehicle feature point and the parking space center point. If the first Euclidean distance is less than or equal to the first preset distance threshold, it is determined that the corresponding vehicle detection frame is occluded.

3. The method according to claim 1, characterized in that, If the vehicle detection bounding box is occluded, the corresponding vehicle detection bounding box image is extracted from the original image, and the vehicle detection bounding box image is input into a non-modal perceptual regression model for completion, obtaining the coordinate information of the completed detection bounding box, including: If the vehicle detection box is occluded, the corresponding vehicle detection box image is cropped from the original image and compressed to obtain a vehicle detection box image of a preset size. The vehicle detection box image of the preset size is input into the non-modal perception regression model for completion, and the coordinate information of the completed detection box is obtained.

4. The method according to claim 1, characterized in that, Before determining whether a parking space is occupied by matching the vehicle detection box with the parking space using a preset matching algorithm based on the parking space coordinate information, the detection box coordinate information or the completed detection box coordinate information, and multi-dimensional cost information, the process further includes: Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, calculate the coverage between the vehicle detection frame and the parking space, and calculate the coverage cost information based on the coverage. Based on the coordinate information of each parking space and the preset threshold, calculate the distance threshold, and calculate the distance cost information based on the distance threshold and the coordinate information of each detection box or based on the distance threshold and the coordinate information of each completed detection box. Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, calculate the IoU between the vehicle detection frame and the parking space, and calculate the IoU cost information based on the IoU; where IoU represents the intersection-union ratio. Calculate multi-dimensional cost information based on coverage cost information, distance cost information, and IOU cost information.

5. The method according to claim 4, characterized in that, The step of matching the vehicle detection box with the parking space using a preset matching algorithm based on the parking space coordinates, the detection box coordinates or the completed detection box coordinates, and multi-dimensional cost information to determine whether the parking space is occupied includes: Obtain the number of vehicles and the number of parking spaces, and use the larger of the two values ​​as the matrix dimension to construct a square matrix; Construct a multi-dimensional cost matrix based on a square matrix and multi-dimensional cost information, or based on a square matrix, multi-dimensional cost information, and preset padding values. The multi-dimensional cost matrix is ​​pre-judged to filter out invalid matching pairs with coverage less than or equal to 0 and / or first Euclidean distance greater than the distance threshold and / or IoU less than the first preset IoU threshold, thus obtaining the filtered multi-dimensional cost matrix. The Hungarian matching algorithm is used to process the filtered multi-dimensional cost matrix to obtain the optimal matching relationship between the vehicle detection box and the parking space. Based on the optimal matching relationship between the vehicle detection frame and the parking space, it is determined whether the parking space is occupied.

6. The method according to claim 4, characterized in that, The process of calculating the coverage between vehicle detection frames and parking spaces based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, and calculating coverage cost information based on the coverage, includes: Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, calculate the area of ​​the parking space and the area of ​​the vehicle detection frame respectively. Calculate the overlap area between the parking space area and the vehicle detection frame area; Based on the parking space area and the overlapping area, the coverage cost information is calculated, and the coverage cost information is calculated using the following formula; ,in, Information is sacrificed for coverage. Coverage is the ratio of the overlapping area to the parking space area.

7. The method according to claim 4, characterized in that, The step of calculating a distance threshold based on the coordinate information of each parking space and a preset threshold, and calculating distance cost information based on the distance threshold and the coordinate information of each detection box, or based on the distance threshold and the coordinate information of each completed detection box, includes: Based on the coordinates of each parking space and a preset threshold, a distance threshold is calculated using the following formula: ,in, For parking space width, For parking space height, The preset threshold; Based on the coordinate information of each parking space, obtain the coordinate information of the center point of the parking space; Obtain the coordinate information of vehicle feature points based on the coordinate information of the detection box or the coordinate information of the completed detection box; Based on the coordinates of the parking space center point and the vehicle feature point, a weighted Manhattan distance algorithm is used to calculate the absolute distance between the vehicle feature point and the parking space center point as the distance cost information. The absolute distance between the vehicle feature point and the parking space center point is calculated using the following formula: ,in, The horizontal weighting coefficient. This represents the pixel distance difference between the vehicle detection frame and the parking space in the horizontal direction. This represents the pixel distance difference between the vehicle detection bounding box and the parking space in the vertical direction. The vertical weighting coefficient. This is the distance threshold.

8. The method according to claim 4, characterized in that, The step of calculating the IoU between the vehicle detection frame and the parking space based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, and calculating the IoU cost information based on the IoU, includes: Based on the coordinate information of each parking space and the coordinate information of each detection frame, or based on the coordinate information of each parking space and the coordinate information of each completed detection frame, the area of ​​the parking space and the area of ​​the vehicle detection frame are calculated respectively. Calculate the overlap area between the parking space area and the vehicle detection frame area; Calculate the union of the parking space area, the vehicle detection frame area, and the overlapping area to obtain the union area; Calculate the ratio of the overlapping area to the union area to obtain the IOU between the vehicle detection box and the parking space; Calculated based on IOU Cost information, among which, The cost information is calculated using the following formula; ,in, for Cost information, This represents the overlap rate.

9. The method according to claim 4, characterized in that, The method further includes: Determine whether the IOU is greater than or equal to the second preset IOU threshold; If the IOU is greater than or equal to the second preset IOU threshold and the coverage is greater than 0, the vehicle is tracked continuously frame by frame based on the target tracking algorithm to obtain the motion trajectory coordinates of the vehicle for n consecutive frames. Based on the motion trajectory coordinates, linear regression or simple difference algorithm is used to analyze the vehicle motion trend; When the vehicle's movement trend is away from the obscured parking space, the obscured parking space is marked as released. When a vehicle moves toward a blocked parking space and the blocked parking space is unoccupied, the blocked parking space will be marked as occupied.

10. The method according to claim 1, characterized in that, The method further includes: The parking space utilization rate is determined by the ratio of the number of matched parking spaces to the total number of parking spaces in the matching results.

11. A parking space utilization rate determination device, characterized in that, include: The coordinate acquisition module is used to obtain the coordinate information of each parking space in the original image; The target detection module, connected to the coordinate acquisition module, is used to obtain the coordinate information of the detection boxes of each vehicle from the original image based on the target detection algorithm. The calculation module, connected to the target detection module, is used to calculate the width and height of each vehicle detection frame based on the coordinate information of each detection frame, and to calculate the ratio of the width to the height of each vehicle detection frame based on the width and height of each vehicle detection frame, thereby obtaining the corresponding first detection ratio. The occlusion analysis module, connected to the calculation module, is used to determine whether there is occlusion in each vehicle detection frame based on each first detection ratio and a preset detection threshold. The image correction module, connected to the occlusion analysis module, is used to extract the corresponding vehicle detection box image from the original image if the vehicle detection box is occluded, and input the vehicle detection box image into the non-modal perceptual regression model for completion, so as to obtain the coordinate information of the completed detection box. The matching module, which is connected to the coordinate acquisition module, the target detection module, and the image correction module, is used to match the vehicle detection box with the parking space based on the parking space coordinate information, the detection box coordinate information or the detection box coordinate information after completion, and multi-dimensional cost information, using a preset matching algorithm to determine whether the parking space is occupied.

Citation Information

Patent Citations

  • Parking space occupation detection method and device and computer readable storage medium

    CN114463252A

  • Parking visual positioning method and system based on parking space semantic information and vehicle-mounted terminal

    CN119540916A