SUGISAKAMASANORI

Journal of Advances in Artificial Life Robotics
Vol. 4(4); March (2024), pp. 204–208
ON LINE ISSN 2435-8061; ISSN-L 2435-8061
https://alife-robotics.org/jallr.html

International JournalAdvances in Artificial Life Robotics
ICAROB series
Editor-in-Chief
Masanori Sugisaka
Co-Editor-in-Chief
Takao Ito

ISSN 2435-8061
Publisher Masanori Sugisaka(Global Register of Publishes)
regstrated in Jan, 25, 1996
Handadai Higashi 2-8-4, Oita, 870-1108, Japan

Research Article

Parking Space Recognition Method Based on Digital Image
TechnologyHao He, Fangyv Liu, Jiaxin Wang

Tianjin University of Science and Technology, Tianjin,300222, China

ARTICLE INFO
Article History
Received 11 November 2023
Accepted 17 July 2024
Keywords
Open CV
Parking spot detection
Convolutional neural networkIntelligent transportation

ABSTRACTIn recent years, the urban landscape has witnessed a surge in vehicular population, exacerbating
the challenge of finding adequate parking spaces. Consequently, the development of automatic
methods to identify parking availability has gained significant attention. This study introduces adesign and implementation framework aimed at discerning the status of urban parking spotsutilizing digital image processing and allied technologies. Real-time images of multiple parking
spaces are gathered to assess their occupancy, thereby facilitating efficient space utilization.
Experimental findings affirm the practical viability and efficacy of the proposed approach,underscoring its relevance in tackling parking detection challenges through advanced digital
image processing techniques.

© 2022 The Author. Published by Sugisaka Masanori at ALife Robotics Corporation Ltd.
This is an open access article distributed under the CC BY-NC 4.0 license(http://creativecommons.org/licenses/by-nc/4.0/).

1. Introduction

through advanced image algorithms. Thus, this paper
investigates a parking space recognition method based on
digital image technology.
This thesis consists of four main parts. The first partdescribes the background of the research. The second partgives a brief introduction to the development environmentand covers the basic concepts of Python, OpenCV, andCNN. The third part describes the system process in detail,including data preprocessing, parking space division, CNN
model construction and parking space detection; Thefourth part summarizes and summarizes the main contentsof the thesis.

In recent years, the rise in family car ownership has
exacerbated urban traffic congestion and highlighted
challenges in managing urban parking spaces.
In recent advancements in intelligent parking
management systems, the evolution of technology has
refined methods for identifying parking space statuses.
Initially, various sensor-based approaches were employed,each with its drawbacks: ultrasonic methods suffered fromincreased sensor errors due to multiple echoes, infrared
methods were susceptible to ambient light and heatvariations, leading to higher misjudgment rates, andgeomagnetic detection was hindered by complex
installation requirements.
Consequently, experts across relevant fields havesought innovative solutions, leading to a burgeoning
research focus. Emerging findings highlight theadvantages of employing digital image technology forreal-time monitoring and analysis of parking lot utilization

2. Introduction to development environment
2.1. Introduction to Python
Python is a high-level programming language firstpublished by Guido van Rossum in 1991. It is known for
its clean and easy to read syntax, rich standard library, andstrong community support. Python is widely used in a

Corresponding author’s E-mail: hehao0310252022@163.com

204

variety of fields, including data science, artificial
intelligence, web development, automated scripting, andsoftware development.
Application field:
 Data science: Python libraries such as NumPy,Pandas, and Matplotlib are widely used in data
analysis and visualization.
 Artificial Intelligence: Libraries like TensorFlow,Keras, and PyTorch make Python stand out in thefield of machine learning and deep learning.
 Web Development: Frameworks such as Django andFlask have made Python very popular for webdevelopment.
 Automation: Python is often used to write scripts toautomate repetitive tasks and system administration.
 Software development: Python can be used todevelop desktop applications, games, and othersoftware solutions.
Overall, Python is a very popular programming
language in many areas because of its simplicity andpower.

developed in C++, it also provides binding interfaces
for Python, Java, C# and other languages, allowing
developers to develop in languages they are familiarwith.
Open Source and Community support: As an open
source project, OpenCV has an active development
community and a large amount of documentation,tutorials, and sample code to support developers tocustomize and extend.
Overall, OpenCV is used for a wide variety of computer
vision and image processing tasks due to its powerfulfeatures, cross-platform support, and active community,
and is an important tool for developers and researchers [1],[2].
2.3. Introduction to CNN
Convolutional Neural networks (CNNS) are a class ofdeep learning models specifically designed to process datawith a grid-like structure. It is most commonly used forimage processing, but can also be applied to other types ofgrid data, such as video and audio signals. The design of
CNN is inspired by the biological visual system,
specifically the structure and function of the human visualcortex.
Advantages:
 Automaticfeatureextraction:
CNN
canautomatically extract features from the original
image without the need for manual featureengineering.
 Efficiency: With parameter sharing and local
connections, CNNS are able to process highdimensional
data
while
maintaining
low
computational complexity.
 Scalability: CNNS can handle more complex tasks bystacking multiple convolutional and pooled layers.
Overall, convolutional neural networks have madesignificant progress in the field of computer vision and area central tool for solving various image and video related
problems.

2.2. Introduction to OpenCV
OpenCV (Open Source Computer Vision Library) is an
open source computer vision and machine learning libraryoriginally developed by Intel and later maintained by
Willow Garage and Itseez (later OpenCV organization).
OpenCV provides a wealth of tools and capabilities forcomputer vision and image processing that are widely used
in industry, academic research, and business.
Main features:Rich features: OpenCV includes hundreds of image
processing, computer vision, and machine learning
capabilities, including image filtering, featuredetection, target tracking, classification, object
recognition, and more.
Efficiency: OpenCV optimizes many computeintensive operations, uses C++ implementation,
supports multi-threading and GPU acceleration, andcan run under efficient real-time processing
requirements.
Cross-platform support: OpenCV supports multiple
operating systems such as Windows, macOS, Linux,and mobile platforms such as Android and iOS,making it suitable for a variety of developmentenvironments.
Language bindings: Although OpenCV is mainly

3. Methodology
The system design process involves several stages: preprocessing, parking space segmentation, CNN model
construction and training, and real-time parking spacerecognition. In the pre-processing stage, data is filtered toretain only relevant information. Parking spaces aresegmented and stored as samples. The CNN model is then205

trained to classify whether a parking space is occupied.
Finally, real-time monitoring identifies available spots andmarks them accordingly.

Fig.1 original image

3.1. pretreatmentDue to various natural factors, such as low contrast
between the target object and the background scene, andthe limited available information, direct recognition of
parking spaces from images is challenging. Therefore,
extensive preprocessing of the original image is necessary.
This includes tasks like noise reduction and enhancing
image details to differentiate the target object from thebackground image.
To enable post-processing, it is recommended to initiallyconduct background filtering to eliminate any irrelevant
background details in the image and make subsequent
recognition easier. This can be achieved by defining amask, establishing maximum and minimum thresholds,
and converting information outside the threshold range
into zero value data.
The second step involves converting the image tograyscale. This transformation focuses solely on thebrightness data, removing extraneous details and thus
decreasing the computational effort needed for subsequent
processing steps.
The third step involves using Canny edge detection,
which consists of four main processes: applying Gaussian
blur, computing the gradient magnitude and direction,
performing non-maximum suppression, and applying adouble threshold technique. This method effectivelyidentifies both actual and potential edges, improving theprecision in boundary detection [3].
Fig. 1 displays the original image, while Fig. 2
illustrates the image after preprocessing.

Fig.2 Pretreatment result
3.2. Parking space division
Upon observation, parking lots are structured with distinct
straight lines, which can be effectively segmented using
the Hough transform, a prominent feature detection
algorithm in computer vision. This method enhances
accuracy by specifying the types of shapes to identify,
employing a voting mechanism in parameter space todetermine object shapes while filtering out outliers withoverly large or small intervals. It's crucial to note that someimperfections like cracks or other line segments in images
might falsely resemble parking space lines; however,genuine parking space lines predominantly exhibit verticalor horizontal orientations. Calculating the slopes of theseline segments can further refine accuracy by eliminating
irregular segments.
3.3.CNN network training
Following the acquisition of parking space images,
datasets were partitioned into training and test sets with a
70%-30% split. Further segmentation categorized images
into occupied and non-occupied classes based on vehicle
presence, facilitating subsequent model training.
Due to the limited size of the dataset, enhancing data
becomes crucial for improving model performance. Dataaugmentation, whether conducted online or offline, helps
expand the dataset effectively. Offline methods are
particularly suitable for small datasets, increasing sample
size by transforming images—for instance, by rotations—206

enhance system speed and adaptability to diverse parkingscenarios, ensuring timely and efficient data for effective
parking lot management.

thereby boosting dataset diversity. Supervised methods,commonly employed, analyze existing data completenessand apply rules to expand it, typically through single ormulti-sample enhancements.
The training dataset is then fed into the model fortraining. Upon completion, the test set achieves anaccuracy of 91.4%, consistent with expectations.
Subsequently, consideration was given to switching from
VGG16 to ResNet50 to enhance accuracy further.
However, due to ResNet50's slower training speed
compared to VGG16, efficiency considerations led to thedecision to stick with VGG16.

References
1.
2.

3.

Fig. 3 presents the outcomes of the parking spacedetection process.

Yaling Zhou, Traffic flow detection system based onOpenCV. Beijing: Beijing University of Posts andTelecommunications, 2015.
Minglu Zhang, Xiaodong He, Research on Traffic
flow statistics Algorithm based on OpenCV.
Computer Knowledge and Technology, 2016,12(19) : 169-170.
Mingrui Zhao, Research on parking status detection
method based on machine vision. Shenyang:Shenyang Jianzhu University, 2021.

Authors Introduction
Ms. Hao He

Ms. Fangyv Liu

Fig.3.Parking test results

She is currently an undergraduate in
Tianjin University of Science andTechnology. She is majoring in robotics
engineering.Her research area is about
Image processing based on OpenCV.

She is currently an undergraduate in
Tianjin University of Science andTechnology. Her research area is about
intelligent robot and intelligent control.

4.Conclusion
The program will conduct real-time image processing todetect and display vacant parking spaces in green whileleaving occupied spaces unmarked. There are occasional
inaccuracies, such as incorrectly marking the guiding lines
in the parking lot as empty spaces, which could be refined
through adjustments to the CNN model. Despite theseoccasional errors, overall detection and statistical analysisof remaining areas generally meet anticipated standards,
achieving effective processing and identification of
parking space status.
Utilizing OpenCV and convolutional neural networks(CNNs), the study achieves real-time monitoring ofparking space occupancy, offering practical urban parking
management solutions. Future optimizations aim toMs. Jiaxin Wang

207

She is currently an undergraduate in
Tianjin University of Science andTechnology. She is majoring in robotics
engineering. Her research area is about
Image processing based on OpenCV.