Parking space detection method and system based on yov8obb

By regressing parking space parameters in the bird's-eye view domain using the yolov8obb detection network and combining it with TensorRT acceleration, the problem of unifying the handling of horizontal, vertical and oblique parking spaces in the existing technology is solved, and the synchronous output of parking space occupancy status is realized, which improves the detection accuracy and robustness of the automatic parking system.

CN121640424APending Publication Date: 2026-03-10东风悦享科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies struggle to robustly handle mixed horizontal, vertical, and diagonal parking spaces within the same model. Furthermore, the separation of occupancy status determination and parking space detection results in high computational load, long processing time, and susceptibility to interference, making it impossible to stably output occupancy/vacancy results within the same workflow.

Method used

The YOLOv8OBB detection network is used to directly regress the parking space entrance point, width, height, and orientation parameters in the bird's-eye view (BEV) domain. BEV images are generated and detected using a fisheye camera. Combined with TensorRT acceleration, the detection of parking spaces and internal obstacles is realized simultaneously, and the results are mapped from pixel/BEV coordinates to the vehicle coordinate system.

Benefits of technology

It improves the detection accuracy of angled and irregular parking spaces, reduces blind spots, enhances three-dimensional perception capabilities and robustness, and significantly improves the intelligence level of the automatic parking perception system and the overall vehicle safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121640424A_ABST
    Figure CN121640424A_ABST
Patent Text Reader

Abstract

The invention relates to a parking space detection method based on yov8obb, and the method comprises the steps: 1, obtaining images through a fisheye camera, splicing the images into a BEV image, and carrying out the detection of the BEV image, and obtaining a parking space target of the BEV image; 2, obtaining parking space frame entrance points A and B and obstacles in a parking space, fitting the whole parking space, and then solving four vertex coordinates of the parking space, and 3, judging the type of the parking space, carrying out parking space occupation judgment, and then unifying the four vertex coordinates and a judgment result to the whole parking space information; 4, calculating the vertex coordinates of the parking space, and converting the BEV image pixel coordinate system into a vehicle coordinate system; and step 5, performing structured processing on the parking space ID, the parking space category, the coordinate values of the four vertexes and the entrance center point of the parking space in the vehicle coordinate system, the parking space occupation condition and the obstacle information in the parking space to obtain high-precision parking space physical parameter data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual target detection technology, and in particular to a parking space detection method and system based on yolov8obb. Background Technology

[0002] Currently, with the rapid development of deep learning and convolutional neural networks, machine vision has made significant progress in the fields of intelligent parking and low-speed autonomous driving. yolov8obb, a variant of YOLOv8 (You Only Look Once, version 8) using Oriented Bounding Box (OBB) object detection, is used to identify and locate objects in images or videos using angled bounding boxes. It is an efficient object detection model that can be applied to many different scenarios, including autonomous driving, robot perception, and image analysis. Existing technologies mostly use Axis-Aligned Bounding Box detection, which struggles to tightly enclose diagonally arranged or rotated parking spaces, resulting in low IoU (Intersection over Union) and susceptibility to interference. Furthermore, traditional solutions typically divide parking space detection into two independent models or stages: "parking space detection" and "occupancy classification," leading to high computational costs and time consumption. Additionally, existing technologies struggle to robustly handle mixed scenarios of horizontal, vertical, and diagonally arranged (V-shaped / herringbone) parking spaces within the same model, and occupancy status determination and parking space detection are often separated, making it difficult to stably output "occupancy / vacancy" results in the same process. Summary of the Invention

[0003] In view of the above problems, the present invention provides a parking space detection method and system based on yolov8obb to solve the technical problems of existing technologies in the unified processing of mixed horizontal / vertical / diagonal parking spaces and the difficulty in synchronously outputting occupancy status.

[0004] This invention provides a parking space detection method based on YOLOv8OBB. The method includes: Step 1, acquiring images using a fisheye camera, stitching the images into a BEV image, and using a YOLOv8OBB detection network to detect the parking space target in the BEV image; Step 2, using the YOLOv8OBB model to obtain the entrance points A and B of the parking space frame and obstacles within the parking space, fitting the overall parking space using the angle α between the two entrance points within the parking space frame and a fixed parking space length d, and then calculating the coordinates of the four vertices of the parking space using the following formula: φ = tanh -12 (y2-y1,x2-x1), u=(cos(φ+a),sin(φ+a)), D=du, p1=A=(x1,y1), p2=B=(x2,y2), p3=B+D, p4=A+D, where φ is the direction angle of the line connecting point A(y1-x1) to B(y2-x2), u represents the unit vector pointing along the cumulative direction of φ+a, D represents the vector pointing along the u direction with a length of d units, p1 is the starting point of the parking space entrance, p2 is the ending point of the parking space entrance, and p3 and p4 are new points obtained by translating point AB along vector D; Step 3, determine the parking space category by the coordinate category of the entrance corner point and the distance between the two points at the entrance, determine the parking space occupancy by the parking space frame category, and then unify the coordinates of the four vertices and the judgment results into the overall parking space information; Step 4, through the conversion method The coordinates of the parking space vertex are obtained by transforming the BEV image pixel coordinate system to the vehicle coordinate system, where (u,v) are the coordinates in the BEV image pixel coordinate system, and (X) are the coordinates in the vehicle coordinate system. car ,Y car M represents the coordinates in the vehicle coordinate system. pixel2car Step 5: Transform the BEV image pixel coordinates to vehicle coordinates. Then, perform structured processing on the parking space ID, parking space category, coordinates of the four vertices of the parking space and the center point of the entrance in the vehicle coordinate system, parking space occupancy status and obstacle information in the parking space to obtain high-precision parking space physical parameter data, thereby completing the parking space location detection.

[0005] Furthermore, the fisheye camera's perception range in low-speed parking scenarios is within 7 meters of surrounding vehicles.

[0006] Furthermore, the parking space target includes four coordinate values ​​of the target box, the confidence level of whether the target exists, and the category probability.

[0007] Furthermore, step 1 also includes: using TensorRT to accelerate detection during the detection process in order to maintain the real-time output of the detection network.

[0008] Further, step 1 specifically includes: Step 11, stitching together the images acquired by the four fisheye cameras (front, rear, left, and right) of the vehicle to form a BEV image; Step 12, inputting the BEV image into the yolov8obb detection network to obtain different task boxes and categories, achieving the output of all parking attributes by a single network; Step 13, storing the BEV image in relevant variables, feeding them together into TensorRT, and outputting the parking space target of the BEV image separately, combining different task boxes and categories to obtain the parking space target.

[0009] Furthermore, the task boxes and categories include: the entry point obb box category includes right angle, acute angle and obtuse angle; the parking space obb box category includes occupied and vacant; the parking space obstacle obb box category includes limit block, ground lock and ice cream cone.

[0010] Furthermore, step 3 includes: Step 31, obtaining the entrance corner coordinate category through the yolov8obb model, determining whether the entrance corner is a right angle, if not, determining the parking space category as an angled parking space, if yes, proceeding to step 32; Step 32, determining the relationship between the actual distance between points A and B in the vehicle coordinate system and a preset threshold, if the distance between points A and B is greater than the preset threshold, the parking space category is a horizontal parking space, if the distance between points A and B is less than the preset threshold, the parking space category is a vertical parking space; Step 33, determining the parking space occupancy status through the parking space obb box category, and then unifying the four vertex coordinates and the determination result into the overall parking space information.

[0011] This invention also provides a parking space detection system based on YOLOv8OBB. The system includes: a fisheye camera located at four positions (front, rear, left, and right) of the vehicle to acquire images; a BEV image module connected to the fisheye camera to stitch the images into a BEV image, which is then detected using a YOLOv8OBB detection network to obtain the parking space target within the BEV image. The system uses the YOLOv8OBB model to obtain the parking space frame entrance points A and B, and obstacles within the parking space. The system fits the overall parking space using the angle α between the two entrance points within the parking space frame and a fixed parking space length d. Finally, the coordinates of the four vertices of the parking space are calculated using the following formula: φ = tanh -1 2 (y2-y1,x2-x1), u=(cos(φ+a),sin(φ+a)), D=du, p1=A=(x1,y1), p2=B=(x2,y2), p3=B+D, p4=A+D, where φ is the direction angle of the line connecting point A(y1-x1) to B(y2-x2), u represents the unit vector pointing along the cumulative direction of φ+a, D represents the vector with a length of d units pointing along the u direction, p1 is the starting point of the parking space entrance, p2 is the ending point of the parking space entrance, and p3 and p4 are new points obtained by translating point AB along vector D; the parking space binding and coordinate regression module is connected to the BEV image module. It is used to determine the parking space category by the coordinate category of the entrance corner point and the distance between the two points at the entrance, to determine the parking space occupancy by the parking space box category, and then to unify the coordinates of the four vertices and the judgment result into the overall parking space information through a conversion method. The coordinates of the parking space vertex are obtained by transforming the BEV image pixel coordinate system to the vehicle coordinate system, where (u,v) are the coordinates in the BEV image pixel coordinate system, and (X) are the coordinates in the vehicle coordinate system. car ,Y car M represents the coordinates in the vehicle coordinate system. pixel2carThis is the transformation matrix from BEV image pixel coordinates to vehicle coordinates; the output module, connected to the BEV image module, parking space binding and coordinate regression module respectively, is used to perform structured processing on the parking space ID, parking space category, coordinate values ​​of the four vertices of the parking space and the center point of the entrance in the vehicle coordinate system, parking space occupancy status and obstacle information in the parking space, to obtain high-precision parking space physical parameter data, thereby completing the parking space location detection.

[0012] Furthermore, the fisheye camera's perception range in low-speed parking scenarios is within 7 meters of surrounding vehicles.

[0013] Furthermore, the parking space target includes four coordinate values ​​of the target box, the confidence level of whether the target exists, and the category probability.

[0014] This invention provides a parking space detection method and system based on yolov8obb, mainly to solve the problems of existing technologies, such as difficulty in accurately covering inclined parking spaces when the scene contains horizontal, vertical and inclined parking spaces, easy occurrence of box drift, misalignment or segmentation of a single parking space into multiple candidate boxes, inability to provide end-to-end occupancy determination within the same network, easy misjudgment under the conditions of occupancy, lighting changes, partial parking or edge overlap, insufficient temporal stability, which limit the usability and safety of the system in real parking scenarios. Attached Figure Description

[0015] Figure 1 A flowchart of a parking space detection method based on yolov8obb provided by the present invention; Figure 2 This invention provides a flowchart of a method for obtaining parking space targets from BEV images; Figure 3 This is a flowchart of a method for overall binding of parking spaces provided by the present invention; Figure 4 This is a schematic diagram of the task frame output provided by the present invention. Detailed Implementation

[0016] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0017] Example 1: This invention provides a parking space detection method based on yolov8obb, the system comprising a fisheye camera, a BEV image module, a parking space binding and coordinate regression module, and an output module. Figure 1 As shown, the method includes: Step 1: Acquire images using a fisheye camera, stitch the images together to form a BEV image, and use the yolov8obb detection network to detect the BEV parking space target. Step 2: Using the yolov8obb model, obtain the entrance points A and B of the parking space frame and the obstacles within the parking space. Fit the entire parking space using the angle α between the two entrance points within the parking space frame and a fixed parking space length d. Then, calculate the coordinates of the four vertices of the parking space using the following formula. φ=tanh -1 2 (y2-y1, x2-x1), u=(cos(φ+a),sin(φ+a)), D=du, p1=A=(x1,y1), p2=B=(x2,y2), p3 = B + D, p4 = A + D Where φ is the direction angle of the line connecting point A(y1-x1) to B(y2-x2), u represents the unit vector pointing along the cumulative direction of φ+a, D represents the vector pointing along the u direction with a length of d units, p1 is the starting point of the parking space entrance, p2 is the ending point of the parking space entrance, and p3 and p4 are the new points obtained by translating point AB along vector D. Fisheye cameras are positioned at the front, rear, left, and right of the vehicle to acquire images; The BEV image module, connected to a fisheye camera, stitches images into a BEV image and uses a YOLOv8OBB detection network to detect the parking space target within the BEV image. The YOLOv8OBB model obtains the parking space frame entrance points A and B, and obstacles within the parking space. The overall parking space is fitted using the angle α between the two entrance points within the parking space frame and a fixed parking space length d. The coordinates of the four vertices of the parking space are then calculated using the following formula: φ = tanh -1 2 (y2-y1,x2-x1), u=(cos(φ+a),sin(φ+a)),D=du,p1=A=(x1,y1),p2=B=(x2,y2),p3=B+D,p4=A+D, where φ is the direction angle of the line connecting point A(y1-x1) to B(y2-x2), u represents the unit vector pointing along the cumulative direction of φ+a, D represents the vector pointing along the u direction with a length of d units, p1 is the starting point of the parking space entrance, p2 is the ending point of the parking space entrance, and p3 and p4 are new points obtained by translating point AB along vector D; Step 3: Determine the parking space category by the coordinates of the entrance corner point and the distance between the two points at the entrance; determine the parking space occupancy by the parking space frame category; and then unify the coordinates of the four vertices and the judgment results into the overall parking space information. Step 4, through conversion The coordinates of the parking space vertex are obtained by transforming the BEV image pixel coordinate system to the vehicle coordinate system, where (u,v) are the coordinates in the BEV image pixel coordinate system, and (X) are the coordinates in the vehicle coordinate system. car ,Y car M represents the coordinates in the vehicle coordinate system. pixel2car This is the transformation matrix from pixel coordinates to vehicle coordinates in the BEV image; The parking space binding and coordinate regression module, connected to the BEV image module, determines the parking space category based on the coordinates of the entrance corner points and the distance between two points at the entrance. It then determines parking space occupancy based on the parking space bounding box category, and finally integrates the coordinates of the four vertices and the judgment results into the overall parking space information through a transformation process. The coordinates of the parking space vertex are obtained by transforming the BEV image pixel coordinate system to the vehicle coordinate system, where (u,v) are the coordinates in the BEV image pixel coordinate system, and (X) are the coordinates in the vehicle coordinate system. car ,Y car M represents the coordinates in the vehicle coordinate system. pixel2car This is the transformation matrix from pixel coordinates to vehicle coordinates in the BEV image; Step 5: The parking space ID, parking space category, coordinates of the four vertices of the parking space and the center point of the entrance in the vehicle coordinate system, parking space occupancy status, and obstacle information within the parking space are structured to obtain high-precision parking space physical parameter data, thereby completing the parking space location detection.

[0018] The output module is connected to the BEV image module, parking space binding and coordinate regression module respectively. It is used to perform structured processing on the parking space ID, parking space category, coordinate values ​​of the four vertices of the parking space and the center point of the entrance in the vehicle coordinate system, parking space occupancy status and obstacle information in the parking space to obtain high-precision parking space physical parameter data, thereby completing the parking space location detection.

[0019] This invention provides a parking space detection method and system based on YOLOv8OBB. Addressing the two major shortcomings of existing parking space detection methods—difficulty in uniformly handling mixed horizontal / vertical / diagonal parking spaces and difficulty in synchronously outputting occupancy status—this solution proposes a multi-camera fusion parking space detection and occupancy determination scheme based on YOLOv8OBB and a fisheye BEV (Balanced Electric Vehicle) camera. This method performs spatiotemporal calibration on the front, rear, and side fisheye cameras to generate a bird's-eye view (BEV). YOLOv8OBB is used to directly regress the parking space entrance point / center, width, height, and orientation parameters in the BEV domain, achieving synchronous detection of the parking space and internal obstacles. Simultaneously, based on the camera-vehicle extrinsic parameters, the detection results are mapped from pixel / BEV coordinates to the vehicle coordinate system, outputting the three-dimensional position and orientation of the parking space. This reduces blind spots, improves three-dimensional perception capabilities and robustness, thereby significantly enhancing the intelligence level of the automatic parking perception system and the overall vehicle safety.

[0020] Example 2: This invention provides a parking space detection method based on YOLOv8OBB. The method mainly consists of two parts: a parking space detection network for fisheye BEV images and post-processing. The YOLOv8OBB detection network is used for parking space detection in fisheye BEV images. The post-processing part includes two parts: overall parking space binding and 3D coordinate regression calculation. Figure 1 As shown, the method includes: Step 1: Acquire images using a fisheye camera, stitch the images into a BEV image, and use the yolov8obb detection network to detect it to obtain the parking space target of the BEV image. In order to maintain the real-time output of the detection network, TensorRT is used to accelerate the detection process. The fisheye camera's perception range in low-speed parking scenarios is within a 7-meter radius of surrounding vehicles. The parking space target includes four coordinate values ​​of the bounding box, the confidence level of target presence / absence, and the category probability. For example... Figure 2 As shown, step 1 specifically involves: Step 11: Stitch together the images acquired by the four fisheye cameras (front, rear, left, and right) of the vehicle to form a BEV image; Step 12: Input the BEV image into the yolov8obb detection network to obtain different task boxes and categories, so that all parking attributes can be output by one network; All parking attributes are output through a single network, reducing intermediate steps and preparing for the next step of outputting the overall parking space data.

[0021] Step 13: Store the BEV image in relevant variables, put them into TensorRT, and output the parking space target of the BEV image separately. Combine different task boxes and categories to obtain the parking space target.

[0022] like Figure 4As shown, the task boxes and categories include: entry point obbb boxes with categories including right angle, acute angle, and obtuse angle; parking space obbb boxes with categories including occupied and vacant; and parking space obstacle obbb boxes with categories including limit blocks, ground locks, and traffic cones. The obbb box (Oriented Bounding Box) is a rectangle in three-dimensional space, whose sides are not necessarily parallel to the coordinate axes. TensorRT includes a deep learning inference optimizer and runtime environment, providing low latency and high throughput for deep learning inference applications. Compared to using Canny edge detection combined with Radon transform or line fitting to find parking lines, this scheme overcomes the shortcomings of being susceptible to changes in lighting, ground shadows, water stains, and worn markings, exhibiting extremely poor robustness, and failing to meet the requirements of all-weather autonomous driving. Meanwhile, compared to using segmentation networks such as U-Net or DeepLab, this method performs pixel-level classification of parking lines, corners, and parking areas in BEV images, and then extracts parking space geometric information through post-processing such as clustering and Hough transform. This method overcomes the shortcomings of extremely complex post-processing logic, large computational load, difficulty in directly distinguishing adjacent and connected parking spaces, and inability to directly output object-level rotation boxes.

[0023] Step 2: Using the yolov8obb model, obtain the entrance points A and B of the parking space frame and the obstacles within the parking space. Fit the entire parking space using the angle α between the two entrance points within the parking space frame and a fixed parking space length d. Then, calculate the coordinates of the four vertices of the parking space using the following formula. φ=tanh -1 2 (y2-y1, x2-x1), u=(cos(φ+a),sin(φ+a)), D=du, p1=A=(x1,y1), p2=B=(x2,y2), p3 = B + D, p4 = A + D Where φ is the direction angle of the line connecting point A(y1-x1) to B(y2-x2), u represents the unit vector pointing along the cumulative direction of φ+a, D represents the vector pointing along the u direction with a length of d units, p1 is the starting point of the parking space entrance, p2 is the ending point of the parking space entrance, and p3 and p4 are the new points obtained by translating point AB along vector D. In the overall parking space binding part, the parking space frame output by the model includes the entrance point and obstacles within the parking space. Furthermore, the two entrance points and the head size of the parking space frame are roughly consistent. Based on these two rules, we can determine to use the angles of the two entrance points within the parking space frame and a fixed parking space length to fit the overall parking space. Given the positions of the two entrance points A and B detected by the model, and the angle α (30 degrees, 60 degrees, 90 degrees, 120 degrees) determined by the angle type of the two points A and B output by the model, and a pre-set parking space length d, we can calculate the other two rear points. The calculation steps are as follows: Calculate the AB baseline direction: φ = tanh - 1 2 (y2-y1,x2-x1), φ is the direction angle of the line connecting point A(y1-x1) to B(y2-x2); the unit vector of the offset direction: u=(cos(φ+a),sin(φ+a)), u represents the unit vector pointing along the cumulative direction of φ+a; the offset edge vector: D=du, D represents the vector pointing along the u direction with a length of d units (m); the coordinates of the four vertices: p1=A=(x1,y1), p2=B=(x2,y2), p3=B+D, p4=A+D, p1 is the starting point of the parking space entrance, p2 is the ending point of the parking space entrance, and p3 and p4 are the new points obtained by translating point AB along vector D.

[0024] Step 3: Determine the parking space category by the coordinates of the entrance corner point and the distance between the two points at the entrance; determine the parking space occupancy by the parking space frame category; and then unify the coordinates of the four vertices and the judgment results into the overall parking space information. Step 4, through conversion The coordinates of the parking space vertex are obtained by transforming the BEV image pixel coordinate system to the vehicle coordinate system, where (u,v) are the coordinates in the BEV image pixel coordinate system, and (X) are the coordinates in the vehicle coordinate system. car ,Y car M represents the coordinates in the vehicle coordinate system. pixel2car This is the transformation matrix from pixel coordinates to vehicle coordinates in the BEV image; Step 5: The parking space ID, parking space category, coordinates of the four vertices of the parking space and the center point of the entrance in the vehicle coordinate system, parking space occupancy status, and obstacle information within the parking space are structured to obtain high-precision parking space physical parameter data, thereby completing the parking space location detection.

[0025] This invention provides a parking space detection method and system based on YOLOv8OBB. Addressing the two major shortcomings of existing parking space detection methods—difficulty in uniformly handling mixed horizontal / vertical / diagonal parking spaces and difficulty in synchronously outputting occupancy status—this solution proposes a multi-camera fusion parking space detection and occupancy determination scheme based on YOLOv8OBB and a fisheye BEV (Balanced Electric Vehicle) camera. This method performs spatiotemporal calibration on the front, rear, and side fisheye cameras to generate a bird's-eye view (BEV). YOLOv8OBB is used to directly regress the parking space entrance point / center, width, height, and orientation parameters in the BEV domain, achieving synchronous detection of the parking space and internal obstacles. Simultaneously, based on the camera-vehicle extrinsic parameters, the detection results are mapped from pixel / BEV coordinates to the vehicle coordinate system, outputting the three-dimensional position and orientation of the parking space. This reduces blind spots, improves three-dimensional perception capabilities and robustness, thereby significantly enhancing the intelligence level of the automatic parking perception system and the overall vehicle safety.

[0026] Example 3: This invention provides a parking space detection method based on yolov8obb, the method comprising: Step 1: Acquire images using a fisheye camera, stitch the images together to form a BEV image, and use the yolov8obb detection network to detect the BEV parking space target. Step 2: Using the yolov8obb model, obtain the entrance points A(x1,y1) and B(x2,y2) of the parking space frame and the obstacles within the parking space. Fit the entire parking space using the angle α between the two entrance points within the parking space frame and a fixed parking space length d. Then, calculate the coordinates of the four vertices of the parking space using the following formula. φ=tanh -1 2 (y2-y1, x2-x1), u=(cos(φ+a),sin(φ+a)), D=du, p1=A=(x1,y1), p2=B=(x2,y2), p3 = B + D, p4 = A + D Where φ is the direction angle of the line connecting point A(y1-x1) to B(y2-x2), u represents the unit vector pointing along the cumulative direction of φ+a, D represents the vector pointing along the u direction with a length of d units, p1 is the starting point of the parking space entrance, p2 is the ending point of the parking space entrance, and p3 and p4 are the new points obtained by translating point AB along vector D. Step 3: Determine the parking space category by the coordinates of the entrance corner point and the distance between the two points at the entrance; determine the parking space occupancy by the parking space frame category; and then unify the coordinates of the four vertices and the judgment results into the overall parking space information. Step 2 calculates the coordinates of the four vertices of the parking space. Then, using the YOLOv8OBB model, the coordinates of the entrance corner points (right angle / obtuse angle / acute angle) and the distance between the two entrance points determine the parking space type (horizontal / perpendicular / angled). If the entrance point is a right angle, angled parking spaces are excluded. Further determination of whether it's a horizontal or perpendicular parking space is made by comparing the actual distance between points A and B in the vehicle coordinate system with a preset threshold. Parking space occupancy is determined using the YOLOv8OBB model's parking space bounding box type (occupied / free). The bounding box contains the two entrance points of the parking space and is then linked to the parking space attributes, such as... Figure 3 As shown, the specific steps are as follows.

[0027] Step 31: Obtain the entrance corner coordinate category through the yolov8obb model, determine whether the entrance corner is a right angle, if not, determine the parking space category as an angled parking space, if so, proceed to step 32; Step 32: Determine the relationship between the actual distance between points A and B in the vehicle coordinate system and the preset threshold. If the distance between points A and B is greater than the preset threshold, the parking space category is horizontal parking space. If the distance between points A and B is less than the preset threshold, the parking space category is vertical parking space. Step 33: Determine the parking space occupancy status by classifying the parking space obb box, and then unify the four vertex coordinates and the determination results into the overall parking space information.

[0028] Compared to the approaches of CenterNet or OpenPose, this solution uses a network to predict heatmaps of key points (such as corners and entrance center points) of parking spaces, and then uses a matching algorithm to combine the points into parking spaces. This overcomes the shortcomings of the matching process in dense parking scenarios (such as incorrectly matching the corner of parking space A to parking space B) and the difficulty in directly determining complex occupancy status through regression.

[0029] Step 4, through conversion The coordinates of the parking space vertex are obtained by transforming the BEV image pixel coordinate system to the vehicle coordinate system, where (u,v) are the coordinates in the BEV image pixel coordinate system, and (X) are the coordinates in the vehicle coordinate system. car ,Y car M represents the coordinates in the vehicle coordinate system. pixel2car This is the transformation matrix from pixel coordinates to vehicle coordinates in the BEV image; The parking space corner points p1, p2, p3, and p4 obtained from the above steps, and the entrance point coordinates, are currently still in the BEV image pixel coordinate system (u,v). To be used by the autonomous driving planning and control module, they must be converted to the vehicle coordinate system (X). car ,Y carSince BEV images are stitched together from fisheye camera images through inverse perspective transformation (IPM), their pixel coordinates have a fixed proportional mapping relationship with the vehicle's physical coordinates. This solution performs the transformation using a pre-calibrated parameter matrix: , Among them, M pixel2car This is the transformation matrix from the calibrated pixels to vehicle coordinates. After the transformation, the physical coordinates (unit: meters) of the four vertices of the parking space can be obtained.

[0030] Step 5: The parking space ID, parking space category, coordinates of the four vertices of the parking space and the center point of the entrance in the vehicle coordinate system, parking space occupancy status, and obstacle information within the parking space are structured to obtain high-precision parking space physical parameter data, thereby completing the parking space location detection.

[0031] The system ultimately outputs structured data containing the following information: Parking space ID: used for time-series tracking; Parking space type: horizontal, vertical, or diagonal (determined by the entrance angle and aspect ratio); Physical coordinates: the (x, y) values ​​of the four vertices of the parking space and the entrance center point in the vehicle coordinate system; Occupancy status: occupied / idle (directly determined by the category output by YOLOv8-OBB); Obstacle information within the parking space: if there are parking locks or limiters, output their location and category. This completes the entire process from fisheye image input to high-precision parking space physical parameter output.

[0032] This invention provides a parking space detection method and system based on YOLOv8OBB. Addressing the two major shortcomings of existing parking space detection methods—difficulty in uniformly handling mixed horizontal / vertical / diagonal parking spaces and difficulty in synchronously outputting occupancy status—this solution proposes a multi-camera fusion parking space detection and occupancy determination scheme based on YOLOv8OBB and a fisheye BEV (Balanced Electric Vehicle) camera. This method performs spatiotemporal calibration on the front, rear, and side fisheye cameras to generate a bird's-eye view (BEV). YOLOv8OBB is used to directly regress the parking space entrance point / center, width, height, and orientation parameters in the BEV domain, achieving synchronous detection of the parking space and internal obstacles. Simultaneously, based on the camera-vehicle extrinsic parameters, the detection results are mapped from pixel / BEV coordinates to the vehicle coordinate system, outputting the three-dimensional position and orientation of the parking space. This reduces blind spots, improves three-dimensional perception capabilities and robustness, thereby significantly enhancing the intelligence level of the automatic parking perception system and the overall vehicle safety.

[0033] In summary, this invention presents a parking space detection method and system based on YOLOv8OBB. This technical solution improves the detection accuracy for angled and irregular parking spaces. By employing YOLOv8OBB (rotated bounding box) technology, the generated detection boxes closely match the edges of the actual parking spaces, significantly solving the problems of false detection and missed detection in angled and densely packed parking space scenarios. Simultaneously, it achieves integrated detection and occupancy determination (end-to-end), improving real-time performance. In its model design, this solution treats "parking space detection" and "occupancy status (idle / occupied)" as a unified classification task. During forward inference, the network outputs the parking space's position, angle, and whether it is occupied or idling in a single pass, eliminating the need for an additional classification network. This reduces the number of model parameters and inference time. Accelerated using TensorRT, it can meet the stringent real-time requirements of low-speed autonomous driving. It also enhances robustness to partial occlusion and complex scenes. By introducing the BEV (bird's-eye view) perspective as network input, it eliminates the distortion effect of fisheye images and presents geometric consistency from a God's-eye view. Combined with the geometric binding strategy in post-processing (i.e., reconstructing the parking space using entrance points A, B and angle α), even if the interior of the parking space is partially occluded (such as by adjacent vehicles), as long as the key entrance line is visible, the algorithm can still accurately deduce the complete geometry of the parking space, thus improving the robustness of the system.

[0034] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A yolov8obb-based parking space detection method, characterized in that, The method comprises: Step 1, acquiring images through fisheye cameras, splicing the images into a BEV image, and detecting the BEV image using a yolov8obb detection network to obtain a parking space target of the BEV image; Step 2, obtaining an entrance point A and B of a parking space frame and an obstacle in the parking space through a yolov8obb model, fitting the overall parking space using an angle α of the entrance two points in the parking space frame and a fixed parking space length d, and calculating four vertex coordinates of the parking space by the following formula, φ = tanh -1 2 (y2-y1,x2-x1), u = (cos (φ + a), sin (φ + a)), D = du, p1 = A = (x1, y1), p2 = B = (x2, y2), p3 = B + D, p4 = A + D, wherein φ is a direction angle of a line connecting point A (y1-x1) to point B (y2-x2), u represents a unit vector pointing in the direction accumulated along φ + a, D represents a vector pointing in the direction along u with a length of d units, p1 is a starting point of the entrance of the parking space, p2 is an ending point of the entrance of the parking space, and p3 and p4 are new points obtained by translating point AB along vector D; Step 3, determining the parking space category through the entrance corner point coordinate category and the entrance two point distance, determining the parking space occupancy through the parking space frame category, and unifying the four vertex coordinates and the judgment result to the overall parking space information; Step 4, the parking space vertex coordinates are obtained by converting the formula from the BEV image pixel coordinate system to the vehicle coordinate system, wherein (u, v) is the coordinate in the BEV image pixel coordinate system, (X car , Y car ) is the coordinate in the vehicle coordinate system, and M pixel2car is the conversion matrix from the BEV image pixel coordinate to the vehicle coordinate. Step 5, structuring the parking space ID, the parking space category, the four vertexes of the parking space, the coordinate values of the entrance center point in the vehicle coordinate system, the parking space occupancy, and the obstacle information in the parking space to obtain high-precision parking space physical parameter data, thereby completing the position detection of the parking space.

2. The yolov8obb-based parking space detection method according to claim 1, characterized in that, The perception range of the fisheye camera in a low-speed parking scene is within a range of 7m around the vehicle.

3. The yolov8obb-based parking space detection method according to claim 1, characterized in that, The parking space target comprises four coordinate values of a target frame, target confidence, and category probability.

4. The yolov8obb-based parking space detection method according to claim 1, characterized in that, Step 1 further comprises: in order to maintain the real-time output of the detection network, using TensorRT for detection acceleration in the detection process.

5. The yolov8obb-based parking space detection method according to claim 4, characterized in that, Step 1 specifically comprises: Step 11, splicing images acquired by four fisheye cameras in front of, behind, left of and right of the vehicle into a BEV image; Step 12, inputting the BEV image into a yolov8obb detection network to obtain different task frames and categories, and realizing the all-in-one output of all parking attributes by one network; Step 13, storing the BEV image in a related variable, outputting the parking space target of the BEV image together after being put into TensorRT, and obtaining the parking space target in combination with different task frames and categories.

6. The yolov8obb-based parking space detection method according to claim 5, characterized in that, The task frames and categories comprise: the entrance point obb frame corresponding category comprises a right angle, an acute angle and an obtuse angle; the parking space obb frame corresponding category comprises an occupancy and an idle; and the obstacle obb frame in the parking space corresponding category comprises a limiting block, a ground lock and a popsicle stick.

7. The yolov8obb-based parking space detection method according to claim 4, characterized in that, Step 3 comprises: Step 31, obtaining the entrance corner point coordinate category through the yolov8obb model, determining whether the entrance corner is a right angle, if not, determining that the parking space category is an oblique column parking space, and if yes, turning to step 32; Step 32, judging the relationship between the real distance of A and B points in the vehicle coordinate system and the preset threshold value, if the distance between AB two points is greater than the preset threshold value, the parking space category is horizontal parking space, if the distance between AB two points is less than the preset threshold value, the parking space category is vertical parking space; Step 33, judging the parking space occupation through the parking space obb frame category, and then unifying the four vertex coordinates and the judgment result to the overall parking space information.

8. A system for implementing the yolov8obb-based parking space detection method of any one of claims 1-7, characterized in that, The system comprises: The fisheye camera is located at four positions of front, rear, left and right of the vehicle, and is used for acquiring images; The BEV image module is connected with the fisheye camera, is used for splicing the image into a BEV image, and is detected by using a yolov8obb detection network to obtain a parking space target of the BEV image, obtains an entrance point A and B of a parking space frame and an obstacle in the parking space frame by using the yolov8obb model, uses the angle a of the two entrance points in the parking space frame and a fixed parking space length d to fit the whole parking space, and then calculates the four vertex coordinates of the parking space by using the following calculation formula: phi=tanh -1 2 (y2-y1,x2-x1), u=(cos(φ+a),sin(φ+a)), D=du, p1=A=(x1,y1), p2=B=(x2,y2), p3=B+D, p4=A+D, wherein phi is the direction angle of the line connecting point A (y1-x1) to point B (y2-x2), u represents a unit vector pointing in the direction accumulated along phi+a, D represents a vector pointing in the direction of u with a length of d units, p1 is the starting point of the parking space entrance, p2 is the ending point of the parking space entrance, p3 and p4 are new points obtained by translating the points AB along the vector D. The parking space binding and coordinate regression module is connected with the BEV image module, is used for judging the parking space category through the entrance angle point coordinate category and the entrance two-point distance, judging the parking space occupation through the parking space frame category, and unifying the four vertex coordinates and the judgment result to the overall parking space information, and obtaining the parking space vertex coordinates converted from the BEV image pixel coordinate system to the vehicle coordinate system through the conversion formula , wherein (u, v) is the coordinate in the BEV image pixel coordinate system, (X car , Y car ) is the coordinate in the vehicle coordinate system, and M pixel2car is the conversion matrix of the BEV image pixel coordinate to the vehicle coordinate. The output module is connected with the BEV image module, the parking space binding and coordinate regression module respectively, and is used for structurally processing the parking space ID, the parking space category, the four vertexes of the parking space, the coordinate value of the entrance center point in the vehicle coordinate system, the parking space occupation and the obstacle information in the parking space, obtaining high-precision parking space physical parameter data, and thus completing the position detection of the parking space.

9. The yolov8obb-based parking space detection system of claim 8, wherein, The perception range of the fisheye camera in the low-speed parking scene is within 7m of the vehicle.

10. The yolov8obb-based parking space detection method according to claim 1, characterized in that, The parking space target comprises four coordinate values of the target frame, target confidence and category probability.