Deep learning-based empty parking space batch detection method and system

Through deep learning technology, combined with image binarization and object detection algorithm, the number of empty parking spaces and parking spaces are automatically calculated, which solves the problem of low manual operation and recognition efficiency in the existing technology, and achieves high accuracy and efficient empty space Parking space inspection.

CN119068704APending Publication Date: 2024-12-03SHANGHAI COMMITTEE CHINA TELECOM GRP LABOR UNION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411051752.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The existing empty parking space detection method requires manual operation and can only identify light-colored vehicles, and compare them one by one. It has low efficiency and cannot identify multiple models.

Method used

Using a deep learning method, the parking lot images are obtained through the camera, and the parking space map and vehicle position map are generated using image binarization and object detection algorithms. Combined with outline extraction and area proportion judgment, the number of empty parking spaces and parking spaces are automatically calculated. .

Benefits of technology

It realizes automatic generation of parking space maps without manual operation, can identify multiple models, improves detection accuracy and real-time performance, and saves algorithm running time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068704A_ABST
    Figure CN119068704A_ABST
Patent Text Reader

Abstract

The invention discloses an empty parking space batch detection method and system based on deep learning, and belongs to the technical field of deep learning. Comprising the following steps: S1, carrying out image binarization negation on a parking space area of a to-be-detected image to generate a first image; s2, obtaining position information of all vehicles in the real-time image by using a target detection algorithm to generate a second image; s3, performing image AND operation to obtain a third image; s4, carrying out contour extraction on the third image, judging whether the ratio of the contour area to the area of the corresponding parking space area exceeds a set value or not, if not, deleting the parking space area, and if yes, judging that a vehicle is in the parking space area, and obtaining a fourth image; and S5, calculating the number of empty parking spaces and a parking space parking image based on the center point coordinate and the first image. The technical scheme has the beneficial effects that the parking space map can be automatically generated, manual operation is not needed, various vehicle types can be identified, the accuracy is high, a large amount of algorithm running time is saved, and the real-time performance is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to a method and system for detecting empty parking spaces in batches based on deep learning. Background Art

[0002] At present, there are two main ways to detect empty parking spaces. Method 1: Use manual methods to circle irregular parking spaces, obtain the edge map of the image and crop it according to the pre-defined area to determine whether it is an empty parking space. Method 2: Divide the parking space into connected areas, outline the vehicle information based on the grayscale image binarization, and use the area difference to determine whether the parking space is an empty parking space. However, the former wastes a lot of manpower and time by manually circling the parking space. The latter can only identify light-colored vehicles and needs to be compared one by one. Summary of the invention

[0003] The purpose of the present invention is to provide a method for batch detection of empty parking spaces based on deep learning to solve the above technical problems;

[0004] The purpose of the present invention is also to provide a vacant parking space batch detection system based on deep learning to solve the above technical problems;

[0005] A method for batch detection of empty parking spaces based on deep learning, comprising:

[0006] Step S1, obtaining a test image of a parking lot without a car through a camera, setting pixels in non-parking areas of the test image to 0, and performing image binarization to invert the parking area of ​​the test image to generate a first image;

[0007] Step S2, obtaining a real-time image of the parking lot with vehicles through the camera, and using a target detection algorithm to obtain position information of all vehicles in the real-time image to generate a second image;

[0008] Step S3, performing an image AND operation on the first image and the second image to obtain a third image;

[0009] Step S4, extracting the contour of the third image, determining whether the ratio of the contour area to the corresponding parking area area exceeds a set value, if not, deleting the parking area, if yes, determining that there is a car in the parking area, and obtaining a fourth image;

[0010] Step S5, calculating the number of remaining contours and the center point coordinates in the fourth image, and calculating the number of empty parking spaces and the parking image of the parking spaces based on the center point coordinates and the first image.

[0011] Preferably, step S1 comprises,

[0012] Step S11, acquiring the image to be tested of the parking lot in a state without a car through the camera;

[0013] Step S12, marking the parking space area in the image to be detected to obtain the total number of parking spaces;

[0014] Step S13, setting the black pixels in the non-parking area in the image to be tested to 0, performing image binarization inversion on the parking area to generate the first image, and setting the white pixel value of the parking area to 255.

[0015] Preferably, in step S2, the parking space area of ​​the second image has the same pixels as those of the parking space area of ​​the first image, and the non-parking space area of ​​the second image has the same pixels as those of the non-parking space area of ​​the first image.

[0016] Preferably, step S5 comprises,

[0017] Step S51, calculating the number of remaining contours and the center point coordinates in the fourth image, and marking the parking space where the center point coordinates are located in red;

[0018] Step S52, obtaining the number of empty parking spaces by subtracting the number of parking spaces marked in red from the total number of parking spaces in the first image, and outputting the number of empty parking spaces and the parking image.

[0019] A deep learning-based empty parking space batch detection system, comprising:

[0020] The parking space image processing module is used to perform image binarization processing on the image to be tested to obtain a first image;

[0021] A vehicle position processing module, used for performing target detection on the real-time image to obtain a second image;

[0022] An image and operation module, connected to the parking space image processing module and the vehicle position processing module, and configured to perform an image and operation on the first image and the second image to obtain a third image;

[0023] a judgment module, connected to the image and the calculation module, for calculating and judging whether the ratio of the contour area to the corresponding parking area exceeds a set value, if not, deleting the parking area, if yes, judging that there is a car in the parking area, and obtaining a fourth image;

[0024] The empty parking space generation module is connected to the judgment module and is used to calculate and output the number of empty parking spaces and parking images.

[0025] Preferably, the parking space image processing module includes:

[0026] The empty parking space acquisition submodule acquires the image to be tested of the parking lot in a state of no car through a camera;

[0027] The binarization processing submodule is connected to the empty parking space acquisition submodule, sets the pixels of the non-parking space area in the image to be tested to 0, and uses image binarization to invert the parking space area in the image to be tested to obtain the first image.

[0028] Preferably, the white pixel values ​​of the parking space area in the first image and the second image are both 255, and the black pixel values ​​of the non-parking space area in the first image and the second image are both 0.

[0029] Preferably, the vehicle position processing module includes:

[0030] A real-time acquisition submodule, which acquires the real-time image of the parking lot with cars in it through the camera;

[0031] The target detection submodule is connected to the real-time acquisition submodule and uses a target detection algorithm to obtain the position information of all vehicles in the real-time image to generate the second image.

[0032] Preferably, the set value in the judgment module is 80%.

[0033] Preferably, the empty parking space generation module includes:

[0034] a calculation submodule, configured to calculate the number of remaining contours and center point coordinates in the fourth image, mark the parking spaces where the center point coordinates are located in red, and obtain the number of empty parking spaces by subtracting the number of parking spaces marked in red from the total number of parking space areas in the first image;

[0035] The empty parking space output submodule is connected to the calculation submodule and is used to output the number of empty parking spaces and the parking space parking image.

[0036] The beneficial effects of the present invention are: being able to automatically generate a parking space map without manual operation, being able to identify a variety of vehicle models, having a high accuracy rate, saving a large amount of algorithm running time, and having high real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flow chart of empty parking space detection in the prior art;

[0038] Figure 2 It is a step diagram of the empty parking space batch detection method based on deep learning of the present invention;

[0039] Figure 3 is a schematic diagram of step S1 of the present invention;

[0040] Figure 4is a schematic diagram of step S5 of the present invention;

[0041] Figure 5 It is a connection block diagram of the empty parking space batch detection system based on deep learning of the present invention;

[0042] Figure 6 It is a flow chart of a preferred embodiment of the present invention.

[0043] In the attached figure: 1. Parking space image processing module; 2. Vehicle position processing module; 3. Image and operation module; 4. Judgment module; 5. Empty parking space generation module. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0046] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.

[0047] A deep learning-based batch detection method for empty parking spaces, such as Figure 2 As shown, including,

[0048] Step S1, obtaining a test image of a parking lot without a car through a camera, setting pixels in non-parking areas of the test image to 0, and performing image binarization inversion on the parking area of ​​the test image to generate a first image;

[0049] Step S2, obtaining a real-time image of the parking lot with vehicles through a camera, and using a target detection algorithm to obtain position information of all vehicles in the real-time image to generate a second image;

[0050] Step S3, performing an image AND operation on the first image and the second image to obtain a third image;

[0051] Step S4, extracting the contour of the third image, determining whether the ratio of the contour area to the corresponding parking area exceeds a set value, if not, deleting the parking area, if yes, determining that there is a car in the parking area, and obtaining a fourth image;

[0052] Step S5, calculating the number of remaining contours and the center point coordinates in the fourth image, and calculating the number of empty parking spaces and the parking image of the parking spaces based on the center point coordinates and the first image.

[0053] In the prior art, reference Figure 1 By obtaining the edge image, the connected blocks in the area are obtained for filtering, and the connectivity between the connected blocks and the edge of the area is determined to obtain the parking space status. The parking spaces and vehicles are compared one by one. When there are many vehicles and parking spaces in the picture, the number of comparisons will be X times (X = number of vehicles × number of parking spaces), and the detection operation time is longer.

[0054] Specifically, the present invention provides a method for batch detection of empty parking spaces based on deep learning. It uses image binarization to generate a parking map, does not require manual operation, and is more convenient to use in large parking lots and other areas, thereby reducing costs. It uses target detection to detect vehicles, and can identify a variety of vehicle models with high accuracy. In pictures with a large number of parking spaces, it can save a lot of algorithm running time, thereby improving real-time performance.

[0055] In a preferred embodiment, referring to Figure 3 , step S1 comprises,

[0056] Step S11, obtaining an image of the parking lot to be tested in a state where there is no car through a camera;

[0057] Step S12, marking the parking space area in the image to be detected to obtain the total number of parking spaces;

[0058] Step S13, setting the black pixels in the non-parking area in the image to be tested to 0, performing image binarization and inversion on the parking area to generate a first image, and the white pixel value of the parking area is 255.

[0059] Specifically, by marking and processing parking areas, the number of parking spaces can be more accurately identified and calculated, as well as the parking status of vehicles can be analyzed. Automatic processing and generation of parking space maps saves time for manual counting and monitoring, and improves management efficiency.

[0060] More specifically, the generated parking space map can be compared with the vehicle location map obtained in real time, so as to monitor the usage of parking spaces in real time and manage and adjust them in a timely manner.

[0061] In a preferred embodiment, in step S2, the parking area of ​​the second image has the same pixels as the parking area of ​​the first image, and the non-parking area of ​​the second image has the same pixels as the non-parking area of ​​the first image.

[0062] Specifically, errors or deviations caused by image processing or algorithms can be avoided, further image processing, analysis or comparison can be conveniently performed, and the possibility of misjudgment and erroneous identification can be reduced.

[0063] In a preferred embodiment, referring to Figure 4 , step S5 comprises,

[0064] Step S51, calculating the number of remaining contours and the center point coordinates in the fourth image, and marking the parking space where the center point coordinates are located in red;

[0065] Step S52, obtaining the number of empty parking spaces by subtracting the number of parking spaces marked in red from the total number of parking spaces in the first image, and outputting the number of empty parking spaces and a parking image.

[0066] Specifically, by calculating the number of remaining contours and the center point coordinates in the fourth image, and marking the parking spaces where the center point coordinates are located in red, accurate monitoring and marking of parking spaces can be achieved, which helps to improve the utilization rate and management efficiency of parking spaces. Through step S52, that is, by subtracting the red-marked parking spaces from the total number of parking space areas in the first image, the number of empty parking spaces in the current parking lot can be obtained.

[0067] Specifically, the number of empty parking spaces and parking images are output, providing instant feedback and decision support for parking lot managers. Managers can adjust parking lot operation strategies based on real-time data.

[0068] More specifically, the integration of image processing, data analysis and real-time feedback can realize intelligent parking management, which not only improves the efficiency and service quality of parking lots, but also helps reduce human errors and improves user experience.

[0069] A deep learning-based empty parking lot batch detection system, referring to Figure 5 ,include,

[0070] The parking space image processing module 1 is used to perform image binarization processing on the image to be tested to obtain a first image;

[0071] The vehicle position processing module 2 is used to perform target detection on the real-time image to obtain a second image;

[0072] An image and operation module 3 is connected to the parking space image processing module 1 and the vehicle position processing module 2 and is used to perform an image and operation on the first image and the second image to obtain a third image;

[0073] The judgment module 4 is connected to the image and the operation module 3, and is used to calculate and judge whether the ratio of the contour area to the corresponding parking area exceeds a set value. If not, the parking area is deleted. If yes, it is determined that there is a car in the parking area to obtain a fourth image.

[0074] The empty parking space generating module 5 is connected to the judging module 4 and is used to calculate and output the number of empty parking spaces and parking images.

[0075] Specifically, the present invention also provides a deep learning-based empty parking space batch detection system, which obtains a parking space map by performing image binarization processing on the empty parking space picture, i.e., the image to be tested, and obtains a vehicle position image by performing target detection on the real-time picture, and then outputs the number of empty parking spaces and the parking image through AND operations and area ratio judgment, accurately determines the occupancy of parking spaces in the parking lot, and can achieve efficient parking space management and monitoring. It improves management efficiency, reduces human errors, and can also improve user experience, making the parking process more convenient and seamless.

[0076] In a preferred embodiment, the parking space image processing module 1 includes:

[0077] The empty parking space acquisition submodule uses a camera to acquire the image of the parking lot with no cars.

[0078] The binarization processing submodule is connected to the empty parking space acquisition submodule, sets the pixels of the non-parking space area in the image to be tested to 0, and uses image binarization to invert the parking space area in the image to be tested to obtain the first image.

[0079] Specifically, the pixels in the non-parking area of ​​the image to be tested are set to 0, thereby highlighting the parking area, which can effectively reduce the complexity of subsequent processing and focus the analysis on the parking area. The binarization processing submodule can accurately extract the outline and boundary of the parking area, ensuring the accurate identification and monitoring of each parking space.

[0080] More specifically, the first image obtained by inverting the image through binarization has significantly reduced pixel values ​​in non-parking area, thereby optimizing the execution efficiency of subsequent image processing algorithms and improving the efficiency and accuracy of real-time monitoring.

[0081] In a preferred embodiment, the white pixel values ​​of the parking space area in the first image and the second image are both 255, and the black pixel values ​​of the non-parking space area in the first image and the second image are both 0.

[0082] Specifically, a consistent description of parking spaces and non-parking areas is ensured, making subsequent image processing and analysis simpler and more accurate. The system can distinguish parking spaces from non-parking spaces through a simple pixel value threshold judgment.

[0083] Specifically, because the pixel representation of the parking area and the non-parking area in the two images is the same, logical operations of the images can be performed directly, so that the two images can be conveniently combined for subsequent processing without complicated additional processing steps. This helps to reduce confusion caused by errors or image noise. The clear distinction between the parking area and the non-parking area enables the system to more reliably identify and analyze the status of each parking space, thereby reducing the false alarm rate and missed alarm rate.

[0084] In a preferred embodiment, the vehicle position processing module 2 includes:

[0085] The real-time acquisition submodule acquires the real-time image of the parking lot with cars through the camera;

[0086] The target detection submodule is connected to the real-time acquisition submodule and uses the target detection algorithm to obtain the position information of all vehicles in the real-time image to generate a second image.

[0087] Specifically, the module combining real-time acquisition and target detection makes parking lot management more efficient. It can view and analyze the use of parking lots in real time, take timely measures to solve possible problems (such as parking space congestion, illegal occupation, etc.), and improve the overall management efficiency and service quality.

[0088] In a preferred embodiment, the setting value in the judgment module 4 is 80%.

[0089] Specifically, when it is detected that a vehicle does not fully occupy a parking space (i.e., the ratio of the outline area to the actual vehicle occupied area is less than 80%), the system will mark the parking space area as vacant. This ensures that the parking space management system can accurately reflect the actual parking lot usage, which helps to improve the utilization rate and management efficiency of parking resources. Setting an 80% threshold helps reduce the occurrence of misjudgments and missed detections, thereby avoiding unnecessary management confusion or waste of resources.

[0090] In a preferred embodiment, the empty parking space generation module 5 includes:

[0091] A calculation submodule, used for calculating the number of remaining contours and the center point coordinates in the fourth image, marking the parking spaces where the center point coordinates are located in red, and obtaining the number of empty parking spaces by subtracting the number of parking spaces marked in red from the total number of parking space areas in the first image;

[0092] The empty parking space output submodule is connected to the calculation submodule and is used to output the number of empty parking spaces and parking images.

[0093] Specifically, the number of remaining vehicle outlines and their center point coordinates in the fourth image are calculated in real time. By marking the parking spaces where the center point coordinates are located in red, the system can intuitively display which parking spaces are vacant. This can help users quickly understand the current status of the parking lot and accurately determine the location and number of empty parking spaces.

[0094] Reference Figure 6 ,The implementation process of the empty parking space batch detection method based on deep learning is as follows:

[0095] First, in a large underground parking lot, by accessing fully covered camera points, the camera is used to obtain pictures of empty parking spaces (there must be no vehicles in the picture), draw the parking area, set the black pixels in the non-parking area to 0, and use the image binarization to invert the parking area to generate a parking map, that is, image A (the parking area is white with a pixel value of 255, and other areas are black with a pixel value of 0), and calculate the total number of parking spaces.

[0096] Then, a real-time image is obtained through the camera, and the position information of all vehicles in the image is detected using target detection to generate a vehicle position map, namely image B (part of the vehicle area is white with a pixel value of 255, and other areas are black with a pixel value of 0).

[0097] Then, image A and image B are processed by image AND operation to obtain image C, which is the parking space map of the parked vehicle. Contour extraction is performed on image C, and the contour area and parking space area ratio are calculated. Areas with a ratio less than 80% are deleted. When 80% of a parking space is occupied, it is considered that a vehicle is parked in the parking space.

[0098] Secondly, calculate the number of remaining contours and the center point coordinates, mark the parking space where the center point coordinates are located in red, and calculate the number of remaining parking spaces.

[0099] Finally, output the number of remaining parking spaces and parking pictures.

[0100] Specifically, the deep learning target detection algorithm is used to continuously detect the vehicle status at each point, thereby determining the number of empty parking spaces and generating an empty parking space map. In large underground parking lots with multiple floors and complex routes, the location of available parking spaces can be output more conveniently and intuitively, saving time and alleviating congestion.

[0101] Specifically, by binarizing vehicles and parking spaces and performing AND operations, all empty parking space information can be compared at once, saving time and resources. Incorporating deep learning algorithms can more accurately identify vehicles of various colors and shapes. At present, the target detection algorithm is very mature in detecting vehicles and can identify a variety of vehicle models with high accuracy. In pictures with many parking spaces, a lot of algorithm running time can be saved and real-time performance can be improved. Convenient and accurate detection of empty parking spaces can facilitate people's travel and improve travel efficiency.

[0102] In summary, the present application provides a method and system for batch detection of empty parking spaces based on deep learning, which supports automatic production of parking space maps, can accurately identify vehicles of all colors, and supports batch detection of parking spaces with fast detection speed and high efficiency.

[0103] The above description is only a preferred embodiment of the present invention, and does not limit the implementation mode and protection scope of the present invention. For those skilled in the art, it should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for batch detection of empty parking spaces based on deep learning, characterized in that: include, Step S1, obtaining a test image of a parking lot without a car through a camera, setting pixels in non-parking areas of the test image to 0, and performing image binarization to invert the parking area of ​​the test image to generate a first image; Step S2, obtaining a real-time image of the parking lot with vehicles through the camera, and using a target detection algorithm to obtain position information of all vehicles in the real-time image to generate a second image; Step S3, performing an image AND operation on the first image and the second image to obtain a third image; Step S4, extracting the contour of the third image, determining whether the ratio of the contour area to the corresponding parking area area exceeds a set value, if not, deleting the parking area, if yes, determining that there is a car in the parking area, and obtaining a fourth image; Step S5, calculating the number of remaining contours and the center point coordinates in the fourth image, and calculating the number of empty parking spaces and the parking image of the parking spaces based on the center point coordinates and the first image.

2. The deep learning-based empty parking space batch detection method according to claim 1 is characterized in that: Step S1 comprises, Step S11, acquiring the image to be tested of the parking lot in a state without a car through the camera; Step S12, marking the parking space area in the image to be detected to obtain the total number of parking spaces; Step S13, setting the black pixels in the non-parking area in the image to be tested to 0, performing image binarization inversion on the parking area to generate the first image, and setting the white pixel value of the parking area to 255.

3. The deep learning-based empty parking space batch detection method according to claim 1 is characterized in that: In step S2, the parking space area of ​​the second image has the same pixels as those of the parking space area of ​​the first image, and the non-parking space area of ​​the second image has the same pixels as those of the non-parking space area of ​​the first image.

4. The deep learning-based empty parking space batch detection method according to claim 1 is characterized in that: Step S5 comprises, Step S51, calculating the number of remaining contours and the center point coordinates in the fourth image, and marking the parking space where the center point coordinates are located in red; Step S52, obtaining the number of empty parking spaces by subtracting the number of parking spaces marked in red from the total number of parking spaces in the first image, and outputting the number of empty parking spaces and the parking image.

5. A deep learning-based empty parking space batch detection system, characterized in that: include, The parking space image processing module is used to perform image binarization processing on the image to be tested to obtain a first image; A vehicle position processing module, used for performing target detection on the real-time image to obtain a second image; An image and operation module, connected to the parking space image processing module and the vehicle position processing module, and configured to perform an image and operation on the first image and the second image to obtain a third image; a judgment module, connected to the image and the calculation module, for calculating and judging whether the ratio of the contour area to the corresponding parking area exceeds a set value, if not, deleting the parking area, if yes, judging that there is a car in the parking area, and obtaining a fourth image; The empty parking space generation module is connected to the judgment module and is used to calculate and output the number of empty parking spaces and parking images.

6. The deep learning-based vacant parking space batch detection system according to claim 5 is characterized in that: The parking space image processing module comprises: The empty parking space acquisition submodule acquires the image to be tested of the parking lot in a state of no car through a camera; The binarization processing submodule is connected to the empty parking space acquisition submodule, sets the pixels of the non-parking space area in the image to be tested to 0, and uses image binarization to invert the parking space area in the image to be tested to obtain the first image.

7. The deep learning-based vacant parking space batch detection system according to claim 6 is characterized in that: The white pixel values ​​of the parking space area in the first image and the second image are both 255, and the black pixel values ​​of the non-parking space area in the first image and the second image are both 0.

8. The deep learning-based vacant parking space batch detection system according to claim 6 is characterized in that: The vehicle position processing module includes: A real-time acquisition submodule, which acquires the real-time image of the parking lot with cars in it through the camera; The target detection submodule is connected to the real-time acquisition submodule and uses a target detection algorithm to obtain the position information of all vehicles in the real-time image to generate the second image.

9. The deep learning-based vacant parking space batch detection system according to claim 5, characterized in that: The set value in the judgment module is 80%.

10. The deep learning-based vacant parking space batch detection system according to claim 5, characterized in that: The empty parking space generation module includes: a calculation submodule, configured to calculate the number of remaining contours and center point coordinates in the fourth image, mark the parking spaces where the center point coordinates are located in red, and obtain the number of empty parking spaces by subtracting the number of parking spaces marked in red from the total number of parking space areas in the first image; The empty parking space output submodule is connected to the calculation submodule and is used to output the number of empty parking spaces and the parking space parking image.