Keywords

1 Introduction

India is one of the biggest auto markets with over 40 million vehicles on road already [1]. In any average-sized Indian city, almost 40% of the road spaces are used for parking a vehicle rather than the movement of the traffic [2]. This kind of system sadly causes a lot of problems such as traffic congestion, accidents, environment problems, obstruction to the emergency services. In country like ours, where sales of automobiles did not even slow down, during the recession period of 2009 and 2010 [1], there is a demand for very effective and smart parking system. Needless to say, the problem of parking is worldwide and there are numerous systems being adopted worldwide over the period of time to tackle the problem [3] like off-street parking, 30-degree parking, 45-degree parking, 90-degree parking, underground parking, multistoried parking, and advanced multilevel parking.

During our research for the subject, we came across that in India there are lot of companies that are making advanced multilevel parking systems that require a mechanical setup and incur huge cost [4], but we could not find any good, smart solution for existing multistoried parking buildings. In India, lot of malls, multiplex, shopping complex, housing complex, and busy commercial complex have multistoried parking of concrete buildings (mostly underground) and they are manually operated; as a result, users find the following difficulties—identifying the free parking slot available in the parking, locating the exact spot where they had parked the vehicle in the multistoried parking, etc. Secondly, in the existing scenario, there is a need for manual resources to be deployed to keep track of the vehicles. We have developed a system where all these processes are automated using an intelligent algorithm on MATLAB and a couple of cameras. This ensures that overall cost of the system shall remain the minimum.

2 Technical Background

Several systems exist for automated parking systems, but they are based on magnetic, ultrasonic, IR sensors [5, 6]. When we read about those systems, we figured out that they require a lot of hardware to be employed in them which adds to the cost and also they would require a lot of maintenance. The chances of failures and getting false alarms are higher in such systems. Lastly, we found out vehicle tracking was difficult to employ with these systems as it would have required us to use a separate technology. We wanted one single technology solution for our complete system to make it robust. We decided to implement our problem statement using image processing. We found out some work done using image processing as well [7], but the algorithm was more complex and they are considering the entire parking area during processing. However, in our system, we have used simpler approach where only parking slots are singled out and processing is done; secondly, our system also has provision of locating the vehicle which is a novel idea and not being implemented yet in any automated parking system. For vehicle tracking and locating, we are capturing the images of number plates of the vehicles, performing the image processing to extract registration numbers, and maintaining a log file. The related approach is implemented for a different application in [8].

3 Proposed Solution

Our system consists of three subsystems, all working simultaneously as shown in the following block diagram (Fig. 1). The first subsystem is deployed at the entrance of the parking slot, which consists of a camera that captures the image of number plate of the vehicle by Optical Character Recognition (OCR) technique and maintains a log file of registration numbers of the vehicle. The second subsystem consists of another camera in the parking slot which monitors and transmits real-time availability of parking slot information through GUI to administrator and to a display near the entrance. The display near the entrance guides the user to the nearest available parking slot. The third subsystem is a back-end system which ties the parking slot and parking floor number with the vehicle registration number along with date and time stamp and maintains a log. This enables user to locate the parking slot of his vehicle from anywhere in the building by just entering his vehicle registration number (or a part of it) in GUI developed by us. Our GUI runs on displays put up on different floors of buildings (such as malls, multiplexes).

Fig. 1
figure 1

Block diagram

4 Implementation

We are presenting our implementation details in two parts: software implementation and hardware implementation.

4.1 Software Implementation

In line with the system block diagram, our software implementation details have three parts.

Number Plate Recognition

Figure 2 is the flowchart of Number Plate Recognition, where we have used the technique of Optical Character Recognition (OCR). The image of number plate of vehicle is obtained by the camera in RGB form. This RGB image is converted into grayscale image with the threshold of 0.5 taking in account the ambient light conditions. The image is then converted into a binary image. Then, we have performed preprocessing on the binary image to remove unwanted noise (anything below 70 pixels). We have used the following two functions for preprocessing:

Fig. 2
figure 2

Flowchart

$$ {\text{bwareaaopen}}\left( {{\text{image1}}, 70} \right) $$
(1)
$$ {\text{medfitl2}}\left( {\text{image1}} \right) $$
(2)

We have used edge detection function to acquire number plate region. Next, our algorithm identifies the individual character by using segmentation technique using the following functions:

$$ \left[ {{\text{r}},{\text{c}}} \right] = {\text{find}}\left( {\text{image}} \right)\% {\text{r}} \to {\text{rows}},{\text{c}} \to {\text{column}} $$
(3)
$$ {\text{maxc}} = { \hbox{max} }\left( {\text{c}} \right);{\text{minc}} = { \hbox{min} }\left( {\text{c}} \right) $$
(4)
$$ {\text{maxr}} = { \hbox{max} }\left( {\text{r}} \right);{\text{minr}} = { \hbox{min} }\left( {\text{r}} \right) $$
(5)
$$ {\text{image1}} = {\text{image}}\left( {{\text{minc: maxc}},{\text{minr: maxr}}} \right) $$
(6)

Now after having the images of individual characters, we correlate these obtained images with predefined templates as shown in Fig. 3. The last step is writing the obtained characters (vehicle registration number) into a text file.

Fig. 3
figure 3

Predefined templates

Parking Slot Allocation Algorithm

This begins with a camera system initialization followed by the acquisition of image of the parking slot. The acquired image is converted into a binary image as explained above, and we have assumed that the parking area is always white (or light color) with black (or dark colored) boundary.

The most important step in this algorithm is image segmentation, which clearly differentiates parking slots from rest of the area, and to check whether the slot is occupied or vacant. From the acquired image of the parking slot, the parking slots are cropped and each cropped parking slot is assigned a respective variable. For each vacant parking slot, we have calculated the total number of pixels; now, when car enters the parking slot, the number of pixels of parking slot area (white area) decreases which we have compared against the certain threshold level to be sure that only the vehicle has occupied the slot not any foreign object.

Depending upon the angle of the camera, a number of pixels for different parking slots vary from each other. Number of Pixels = Number of Rows X Number of Columns.

We have taken a pseudoparking slot with two parking slots whose images are captured from a certain angle. As a result, the pixels obtained are different for two slots as follows: Slot 1—67,000 and Slot 2—33,000.

Different vehicles have different sizes; also, binary images of same vehicle may differ from one another depending upon the angle of the camera. For our test cases, we have taken a threshold of 28,000 pixels for a vehicle.

Figure 4 is a binary image of our pseudoparking slot. Figure 5 is the flowchart of the program.

Fig. 4
figure 4

Original and binary image of pseudoparking slot, chairs emulating a vehicle

Fig. 5
figure 5

Flowchart

Back-End System (Database Management)

In back-end system, we need to tie the parking slot number along with the parking floor number with registration number of the vehicle parked on that slot. We are using the concept of file handling in MATLAB. The parking slot is assigned a variable P: It can return two values 0, when vacant, and 1, when occupied. When it returns the value 1, a program is run which assigns the latest occupied parking slot number to latest vehicle that has entered the parking area. File handling is used to open the notepad file which contains the vehicle registration number obtained during Number Plate Recognition.

4.2 Hardware Implementation

The hardware of the project consists of two sets of camera: one in the parking slot and another at the entrance of the parking. A Windows OS computer that processes the obtained images in MATLAB is used. A display unit with GUI which is deployed near the entrance is used to display the availability of vacant slots, and several display units at different floors of building with GUI are installed that will help the users to locate their parked vehicle. All displays are connected to the computer.

5 Test Cases and Results

We have considered a pseudounderground parking slot with two parking slots. We have used some objects which act as vehicle. We have a GUI which displays the slot availability. Here are the test cases.

Case 1—Vehicle entering the parking slot and vehicle registration number getting captured

As shown in Figs. 6 and 7, when vehicle enters the parking slot, an image of number plate is captured. Using image processing, the registration number is extracted and stored in the log file with date and time stamp. For each vehicle entering, log file is updated with a new entry.

Fig. 6
figure 6

First car entering the parking slot

Fig. 7
figure 7

Second car entering the parking slot

Case 2—GUI displaying the slot status

At the entrance of the parking slot, the real-time information about the nearest parking slot availability is presented on a GUI display. This will help the driver in locating the nearest available parking slot for parking his vehicle. For our test purpose, we have considered two parking slots in the parking slot. When both slots are vacant, GUI will return a numerical value 0 (Fig. 8) indicating to the driver that both slots are available for parking.

Fig. 8
figure 8

Both slots vacant, GUI returning 0 for both slots

When a slot is occupied, GUI will return a numerical value 1, indicating the occupancy of the slot. In Fig. 9, left slot is occupied; in Fig. 10, right-hand-side slot is occupied.

Fig. 9
figure 9

Slot 1 occupied

Fig. 10
figure 10

Slot 2 occupied

When both slots are occupied as shown in Fig. 11, the value returned in GUI for both slots is 1. We can certainly make our GUI more interactive by replacing the numerical values of 0 and 1 by either text messages or color codes.

Fig. 11
figure 11

Both slots occupied

Case 3—Slot allocation and database management

The final task is to append the parking slot number (where the vehicle is parked) to the vehicle registration number. This is a very important step, because this will help the owner of the vehicle to locate his/her vehicle from anywhere in the building (e.g., mall, shopping complex). Each floor of the building will be equipped with a GUI display on which owner will enter his vehicle registration number (or a part of registration number) and the system will display the exact parking slot number (location). Figures 12 and 13 show the database where the vehicle registration number is appended to parking slot number and the log file is maintained. Figure 12 shows that the first vehicle with registration number AWR310 is assigned Slot 1, and Fig. 13 shows that the second vehicle with registration number KPT295 is assigned Slot 2.

Fig. 12
figure 12

Slot 1 assigned to the first vehicle

Fig. 13
figure 13

Slot 2 assigned to the next vehicle

6 Future Scope and Conclusions

6.1 Future Scope

We have tested our system on pseudoparking slot. We plan to either use a bigger parking slot or actual parking slot. Currently, our Number Plate Recognition is working on certain set of images (number plate font, etc.) and we plan to make it universal. In our present work, we have used parking slot as white surface with black marking. We plan to make it universal for the surface of any color. We plan to improve our system of assigning slot number to the vehicle registration number. Lastly, we plan to add automatic ticketing to our system.

6.2 Conclusion

The objective of the project was to automate the existing multistoried parking facilities by employing a low-cost system which requires very minimal dependencies on hardware. This ensures that system is more robust and requires very limited maintenance. Our system is boon to those users who frequently use multistoried parking as for them locating a vacant parking slot for their vehicle and locating their parked vehicle upon return are quite simplified. We have successfully tested our system.