Worldwide university communities grow yearly, and the Autonomous University of Chihuahua (UACH) is no exception. In the past decade, enrollment has grown from approximately 26,000 students in 2010 to 29,180 by 2019 , increasing along with it the need for parking spaces. UACH’s Engineering and Chemistry Departments, the object of this study, has parking space issues during peak hours, with drivers wasting a lot of time locating where to park. Due to these arguments, a need to implement an intelligent system arises, which allows drivers to easily and quickly visualize where there are places available, thus optimizing times, reducing accidents and CO2 emissions.
Drivers in big cities spend an average of 20 minutes hunting for a parking space , making parking one of the most inefficient daily activities. A study realized by the company INRIX in 2017, Americans spent about 17 hours a year hunting for parking spots, and they wasted around 345 dollars in time, fuel, and emissions . Globally, this inefficiency has big consequences in our lives: 30% of urban traffic is generated by drivers looking for parking , in average, more than 50 hours per driver are spent looking for a parking spot annually ; the time and fuel wasted costs consumers and local economies about $600 million US dollars per year . Bill Ford, Executive Chairman of Ford Motors, warned in 2011 that “the freedom of mobility is being threatened”, since the world fleet of 800 million cars will grow to 2 - 4 billion by 2050, when 75% of the population will live in cities. This will lead to a “global gridlock”, which “will stifle economic growth and our ability to deliver food and healthcare”. The solution to this challenge is not to build more roads, but to develop smart roads, smart public transportation, and smart parking .
Automation inside parking lots has allowed drivers to be comfortable and safe, using programmable technology   . These techniques provide various tools, such as the use of a digital platform with a guide detection of empty spaces system, to indicate which parking spot is available or occupied within the parking lot. This project developed an available spaces detection software prototype for a small area within the Faculty and Staff parking lots at UACH’s Engineering and Chemistry Departments. With the development of an application, it was possible to detect empty or occupied parking spots, through a driver-friendly web page. The main purpose of this research was to contribute and benefit the UACH’s community and to improve the service to the vehicle fleet. Additionally, to reduce the driving stress to all staff and students, while helping find available space to leave your vehicle in a safe and timely manner.
Since the end of the 19th century, specifically in 1885, when the first vehicle was built, and in 1889, when the first car making companies were created, automobiles have been considered as the main means of transport . Since the 1990’s, the number of private vehicles has increased to such an extent that it has exceeded the capacity of the road infrastructure of urban centers. This has made circulation more difficult, therefore generating large parking demands, leading to the need to adapt automation within a vehicular parking system .
Parking automation is considered the global trend procedure to solve the above-mentioned issues. Implementing new technologies, such as automatic collection, capacity, or empty spaces’ detection, within public spaces, are some of the solutions being implemented to this date . In the case of public parking lots, with a rate according to its time of use, automation turns out to be a good business, while for private parking lots, is also considered as an opportunity area for administration and optimization, to automate services and/or control of access and exits .
1.2. Current Parking System in Mexico
In Mexico, most of the parking lots do not have highly structured systems, since access control is generally done manually, causing the availability of spaces to be validated through a personal review. However, to improve the parking service, as a minimum, a basic model is required, in which generally there is a surveillance booth, operated manually . Whether or not there is a security booth, at least one person must be present at the parking lot’s access point, responsible for providing information about whether there are enough parking spaces available and delivering a ticket with the date and time of entry. However, there are places where only a ticket is provided, and the driver must circulate through the whole parking lot until an empty space is located. This model could also be improved by adding the use of automatic barriers and card/ticket readers .
1.3. Applicable Technology in Parking Lots
Current technological advances developed to optimize parking lots include pass printing and automatic payments, efficient lighting systems, intelligent systems to find available parking spots, and even chargers for electric vehicles . To run a system or application that specializes in empty spaces’ detection, the Arduino platform implementation, with artificial vision or video detection, and a Radio Frequency Identification (RFID) technology was implemented  . It should be considered, however, how these systems typically present high costs for installation and execution .
1.4. Smart Parking Systems in Latin America
In Latin America, some projects have been carried out, such as in the Pontifical Catholic University of Peru (in 2008), where a vehicle detection system for a parking lot was developed, recognizing the presence of cars through a detection sensor that was installed in the access lane and another in the exit lane, limiting vehicles to enter and exit using the same lane . In Ecuador in 2011, the National Polytechnic School developed the PROPARK tool. This system enables searches in any smart phone, users can find the closest parking spot to their location, as well as availability of other unoccupied places. Its operation requires global positioning system (GPS), wireless technologies such as Bluetooth, and consultation through text messages (SMS) . In 2012, the Army Polytechnic School (Mendoza and Romero, 2012) presented an artificial vision system, which consists of an image processing system, which allowed or denied access to vehicles wishing to enter the university. All information is processed in data analysis system . Also, in the National Polytechnic School of Ecuador (2014), a smart vehicle accommodation system was designed through video recording and the implementation of a test prototype. After digital images are processed in the application, through matrices, recognizing the parking area of each of the available and occupied spaces, thus providing a result to the app user .
1.5. Smart Parking Systems in Mexico
In 2011, the Technological Institute of Aguascalientes presented a project where the main goal was to automate and provide support for greater security to achieve vehicular access control. The automation works with RFID technology, a radio frequency identification card, with a unique and unrepeatable number, which manages to provide security . Also, a proposal for smart parking based on sensors with internet in the Malecon area and downtown Mazatlán, was developed by the Autonomous University of Sinaloa, using an optical photoresistor sensor (LDR). It works with light interruption, if an obstacle interrupts the passage of light, the LDR increases its resistance and interrupts passage of current through the control circuit. These are installed in each parking spot and then connected to the Internet via Wi-Fi. Later, a mobile application in Microsoft C # language and the .NET platform were developed since it is cross-platform for optimal operation . In 2018, a parking space counting prototype was developed at Puebla’s Iberoamerican University. An optical sensor was placed in each parking space, it detected the presence of a person or an object that interrupts light reaching the sensor, which use solar cells to charge the sensors’ batteries. For the LED lamp panels, red and green LEDs were used to signal the system. In addition, resistors, an Arduino Uno system (which is necessary for the counter programming) were used .
The main goal of this project consisted in developing an accessible and not expensive parking spot detection system prototype. The study area included only the parking spaces reserved for Faculty and Staff at the Engineering Department at UACH (Figure 1). To complete the prototype development, the project was carried out in several stages, where each of them needed to be finished before starting the next one.
2.1. Geometric Design
The geometric design of the parking lot facilities was visualized both in situ and
Figure 1. Faculty and Staff parking spaces distribution of the Engineering and Chemistry Departments at UACH .
digitally. It was possible to recognize the entire area with the bay designs and each parking space location. An interesting fact about this parking lot is that all vehicles must be parked in reverse, making the system’s goal easier. It is also necessary to mention, that the parking area is not homogeneous, since it has spaces separated by narrow connectors and differences in elevation, in addition to the access point, with a booth, located in its middle section.
First of all, it was necessary to generate an inventory of all available parking spaces, and due to the complexity of the parking lot’s terrain, it was divided into two areas: area “A”, made up of all the space located to the west of the access booth, only accessible through a card reader sensor west of the booth; and area “B”, which encompasses the surface located to the east of the booth, the Chemistry Department parking space, as seen in Figure 2.
Parking spaces were grouped by color following their function, others by their geometry and usage. The colorless parking spots in Figure 2 are those available without restrictions. The ones in green are reserved for pregnant women and seniors; and those in blue are reserved for people with disabilities or wheelchairs. Finally, the spots shown in red are reserved for institutional vehicles such as cars, busses, vans, etc. In addition, there are some parking spots poorly drawn and with a size that does not correspond to standard measurements. Furthermore, some spots are designated for official vehicles (busses, vans, or even trucks). Table 1 shows the distribution of parking spots by parking area. According to the different existing categories it was possible to determine capacities for both area A and area B.
2.2. Vehicle Capacity
Vehicle capacity was measured by counting all the vehicles entering and leaving the parking lot during a 24/7 period. The study was carried out using a TimeMark air impulse gauge with 4 inlets for pneumatic tubes, being placed at the access point in area A. Other counting devices were installed at the entrance/exit door
Figure 2. The engineering (a) and chemistry (b) Departments’ parking lot division in two broad parking areas. Black spot: access booth; blue zones: disability spots; green zones: seniors and pregnant women spots; red zones: institutional vehicles spots.
Table 1. Distribution of numbers of parking spaces according to their classification.
to area B, where 4 pneumatic tubes were used for 6 days. After all this, the gauges with their respective pneumatic tubes were removed, data was downloaded, and files were transferred from the counter to a computer using the Vehicle Identification and Analysis System (VIAS software). The data was organized in tables and graphs, where it was classified according to date, hour, and number of vehicles, allowing to distinguish peak hours, total capacity and, above all, vehicle rotation.
2.3. Machine Vision and Video Processing
The parking lot in question has a surveillance camera that can only monitor area A at its top (Figure 3), so the prototype only focuses on this zone. All information provided by the camera was acquired, and those videos that focused the parking spots with a clear line sight were delimited. Having the artificial visualization of the study area, several scenarios were considered, such as the empty parking lot, the parking maneuvers, and a completely packed parking lot, to be able to process the video through the images obtained. Once the video is captured, it is converted to a sequence of images (JPEG files). The Ffmpeg program for Windows needs to be downloaded; then, work with the commands Prompt (cmd) and Ffmpeg to convert the video into images. The video is trimmed to
Figure 3. View of the surveillance camera of the parking lot area “A”.
obtain the necessary images and they must be placed in the same folder where the video is, to work with them at the same time.
2.4. Object-Oriented Programming (OOP) in MATLAB
To create the empty spaces’ detection program, a reading and writing images execution algorithm was developed using an Object-Oriented Programming (OOP) within MATLAB 2016. First thing done was to extract the “base” image that is represented by the empty parking lot, giving it a numerical value starting from the left side to the right side (Figure 4(a)). Subsequently, the cursor delimits the area of each of the parking spots, determining their X and Y coordinates, in addition to creating a polymask to make the comparison with other images where time has elapsed (Figure 4(b)).
This polymask was designed in a binary way through the drawn polygon (Figure 5(a)); it is represented by the number 1 and graphically is white, which is the determined area of the parking spot. The number 0 is represented by the black color, which is the area that complements the parking image of the other parking spaces and the environment. Subsequently, the comparison was made at different times where the parking space is occupied and when it is free. For this, the MATLAB SURF feature detector function was used with the input images in gray scale, where coincident points are obtained in the image sets. The SURF detector process begins by finding the image characteristics, then these are extracted, and the points of interest are marked.
When the parking spot is occupied by a vehicle (Figure 5(b)), no characteristics matches appear by comparing the input image with an empty space, or base image, previously saved. Instead, when the space is empty, the interest points of the input and base images are very similar, and a match is produced. The red circles and green signs on Figure 5(c) indicate the exact location of these coincidences. When the detector process (the SURF feature in MATLAB) ends, an analysis is made with the results of the variables of the points of interest, so that the result is displayed and exported to a text file, informing when a parking spot is free or occupied.
Figure 4. Base image used for the prototype. (a) Numbered parking spaces; (b) MATLAB delimitation of the parking space.
Figure 5. MATLAB SURF detector process. (a) Polygon drawn for a parking space; (b) Same polygon with a vehicle; (c) Same polygon for the empty space, where points of interest from the base image are detected.
A website was created to show users the available parking spots, and which ones are already occupied, allowing the drivers to go to the place where can park with no loss of time. In addition, the representative way of the results was modified using only the parking space number (0 or 1). The number 1 is used for spots not available and number 0 for the free ones, which is saved in the text file.
The development of the steps to create the web page is represented in a flowchart (Figure 6). The Wampserver software was used, it served as an auxiliary to have a server on the laptop, and to process all the previous analysis in MATLAB. With the help of the test server, it was possible to assess different web designs, and make changes quickly. The web page can be accessed from the local network or by enabling the accessibility settings from the internet with an IP address. It was necessary to have all the files on the web page in a folder inside the Wampserver server document root folder (wamp64), as well as the MATLAB processing
Figure 6. Flowchart followed to detect empty parking spaces.
files. All the required prototype files were stored in the app folder, in the text file of the web page, it was written in html language and with the support of Php. To access the website, the Wampserver must be activated so that the user can enter with the following link localhost/app or with an IP/app address, 192.168.42.48/app. Both the users and the server must be connected to the same wireless network for its correct operation.
The text file that MATLAB generated with the binary representation of the available parking spaces (Figure 8), was extracted by the app webpage, and then it created an auxiliary variable ($aux[ ]), where the numbers’ chains were stored.
Continuing with the webpage code, a loop with a control variable was applied ($i), starting with number “0” and repeating until reach the number of parking spots analyzed. Additionally, a basic function was executed to subtract the characters, and with the help of the conditioning “if”, it was able to evaluate the numbers, leaving “0” for available and “1” for taken spots. Finally, with the help of Quixlab graphic interface, it was possible to create a friendly visual representation of empty parking spots for users.
3.1. Vehicle Capacity Analysis
Vehicle counting in and out of the parking lot, as mentioned above, was carried out in a 24/7 for an entire week. The hour with the highest incidence of entries during the week was detected from 7:00 am to 10:00 am (Figure 7(a)). Unlike the hours of entry, the peak hours of departure varied according to the day, although it is constant between 13:00 and 15:00, and between 18:00 and 21:00 with a different magnitude, as appreciated in Figure 7(b). The day with the highest vehicle turnover in the 200 available parking spaces, was Tuesday with a rotation
Figure 7. Representative histograms of entries and exits of the parking lot on Wednesday. (a) Entries; (b) Exits.
of 98.3%, followed by Wednesday with 92.3%, Thursday with 84%, Friday 83.8%, Monday with 75% and finally on Saturday with only 14.3%.
Comparing the parking lot capacity with the vehicle counting analysis, it is notable how during mornings of weekdays, finding an available parking spot without delay gets more complicated. Is during these “congested times” when the proposed detection system would help greatly.
3.2. MATLAB Analytic Tests
Several tests were performed using the algorithm created in MATLAB, to assure the correct operation. Above all, it was possible to reach the exact count of the availability in each of the parking spaces in different images. As can be seen in the upper portion of Figure 8, four spots are occupied/taken: 3, 4, 5 and 6 and the rest are free, in addition, this same interpretation appears in a text box using numbers 1 and 0, as previously explained (Figure 8 below).
3.3. Functional Tests of the Website
When entering the localhost/app address or the ip/app/address in the browser, just press enter to view the web page as shown in Figure 9.
Shown in the prototype webpage are the parking slot number, a drawn car, and a text box. If the parking spot is available, it is presented with a blue car accompanied by a text box of the same color with the word “Available”. If the spot is occupied, the spot is represented with a pink car and a text box of the same color displaying the word “Taken”. Then there is a button to update the information shown in the page. This prototype webpage needs to be improved by adding a map of the parking spot numbers, as suggested by the test users.
Figure 8. Parking spots with and without vehicles, and the respective MATLAB output represented with 0 (empty/available space) and 1 (taken space).
Figure 9. Access to webpage with localhost/app, showing the free and occupied spots (in blue and pink, respectively).
This project allowed designing a simple parking detection system prototyping in a crowded parking lot. Only the use of a camera, a computer, digital data processing, and free software support is required. It is possible to detect and report the available parking spaces in a parking lot through image processing. This search system provided the parking spot’s availability, allowed quick decision-making when looking for parking spaces alternatives, avoiding the stress of searching the entire area to find an available place. It also helps in reducing CO2 emissions and, increases productivity while reducing parking related stress for the UACH’s Staff.
Machine vision and image processing eased the prototype design, so it was possible to manipulate images from a video, to understand their relationships with a function attached to MATLAB. With the SURF detector, it was possible to extract the characteristic and relevant points of an image, then later determine if there is an object or not. In addition, throughout the development process, functionality tests were performed by making a visual comparison with images, thus corroborating the detection system. With the polymask binarization, essential for the program to run efficiently, it was possible to discriminate unnecessary information outside the parking spaces, and in turn, generate the coordinates and the specific area for each parking spot, to make the analysis and avoid delays in executing it with so much information.
Effects caused by changes in environmental lighting while image processing, was a variable not evaluated in this research, since it may cause many problems, especially in night shifts, as the prototype had a conflict with the shadows of the trees during daylight. This remains as a future work point. A user-friendly web page allowed to show the final data obtained in the prototype, so that it can easily be seen by users, on digital media such as computers, tablets and/or cell phones.
The authors express their gratitude to the Facultad de Ingeniería from the Universidad Autónoma de Chihuahua, specially to Dr. Cornelio Alvarez and M.I. David Maloof for all their support and contributions to this research.
 Heimberger, M., Horgan, J., Hughes, C., McDonald, J. and Yogamani, S. (2017) Computer Vision in Automated Parking Systems: Design, Implementation and Challenges. Image and Vision Computing, 68, 88-101.
 Jang, C., Kim, C., Lee, S., Kim, S., Lee, S. and Sunwoo, M. (2019) Re-Plannable Automated Parking System with a Standalone around View Monitor for Narrow Parking Lots. IEEE Transactions on Intelligent Transportation Systems, 21, 777-790.
 Wu, G., Xu, X. and Lu, X. (2020) Considering the Influence of Queue Length on Performance Improvement for a New Compact Robotic Automated Parking System. International Journal of Information Management, 50, 487-497.
 Gutiérrez, W. (2017) Automatización de estacionamientos en los parqueaderos de centros comerciales en Valledupar.
 Ruiz, A. and Alexander, R. (2015) Diseño de un prototipo de aplicación móvil (android) “parquil” para la administración y localización de parqueaderos públicos ubicados en las parroquias rocafuerte y pedro carbo-concepción de la ciudad de guayaquil.
 Parra, S., Motta, N. and García, W. (2016) Diseño de Prototipo de software móvil para la programación y control del parqueadero UD. Universidad Distrital Francisco José de Caldas, Bogota.
 Sojos, A., Nugra, M. and Ernesto, H. (2016) Desarrollo de una aplicación loT para el monitoreo y predicción del tráfico en la avenida Simón Bolívar de Quito, utilizando una red de sensores basados en la plataforma Arduino. Universidad de las Fuerzas Armadas ESPE, Sangolquí.
 Bohorquez, I.B. (2008) Diseño de un sistema electrónico para el aviso automático de disponibilidad en estacionamientos vehiculares. Pontificia Universidad Católica del Perú, Lima.
 Porras-Torres, E.X. (2011) Desarrollo de un sistema prototipo de consulta de parqueaderos libres. Escuela Politécnica Nacional, Facultad de Ingeniería Eléctrica y Electrónica.
 Mendoza, D. and Romero, W. (2012) Diseño y construcción de un prototipo de sistema de control para monitorear e incrementar la seguridad en el acceso vehicular al parqueadero de la ESPE-L, utilizando procesamiento digital de imágenes. Departamento de Ciencias de la Energía y Mecánica; Carrera de Ingeniería en Mecatrónica. ESPE. Extensión Latacunga.
 Veintemilla D.J. and Siguencia Y.F. (2014) Diseño de un sistema inteligente de parqueo vehicular mediante videograbación e implementación de un prototipo de prueba para la FIEE. Escuela Politécnica Nacional, Facultad de Ingeniería Eléctrica y Electrónica.
 Hernandez, C., Perazca, J., Olivarría, M. and Cobain, J. (2017) Estacionamiento Inteligente basado en sensores con Internet de las cosas en la zona del Malecón y Centro de Mazatlán. Universidad Autónoma de Sinaloa, Culiacán.
 Acosta, L.A. (2018) Desarrollo de un prototipo de conteo de lugares de estacionamiento vacíos en la Universidad Iberoamericana de Puebla. Universidad Iberoamericana Puebla, Puebla.