A public infrastructure has various parking lots. The parking lots get completely occupied very often and the public visiting the infrastructure spend too much time looking for a parking space, unaware that the parking lot is completely occupied. They would like to implement an automated solution to convey this information by displaying the number of available parking spaces at the entrance to the parking lot.
These parking lots are overlooked be surveillance cameras. The task is to leverage them to detect and count the empty parking spots.
The data set consists of images from three separate parking lots parking1a, parking1b and parking2. Each of the parking has data set sorted for three different scenarios cloudy, rainy and sunny. Each single day is represented by the folder, for example the folder (e.g. PKLot/parking/cloudy/2012-12-12/) contains multiple snapshot images (like 2012_12_12_10_00_05.jpg) and the corresponding ground truth file (like 2012_12_12_10_00_05.xml).
Each image in the parking2 has 100 annotated parking spaces (see image below), along with the location, and occupancy information of the parking spot (Every image is supplemented with a ground truth file. For example (parking2/cloudy/2012-09-12/2012-09-12_06_05_16.jpg) has the ground truth file (parking2/cloudy/2012-09-12/2012-09-12_06_05_16.xml).
XML File description:
|Space: each parking spot
Id: Space ID
Occupied: 0 – unoccupied, 1-occupied
Center: Of the rectangle
Size: of the rectangle
Angle: orientation of the rectangle Contour:
Points on the contour
Please note that OpenCV python does not have rotatedRect data structure. One would have to come up with your own logic to extract the bounding box.
- Create a training dataset
- Train a cascade classifier.
- Car Detection: Use the classifier to detect cars in a test image.
- Parking spot analysis application: Use the detected cars to decide if a parking spot is empty.
Cascade Classifier Training:
- Training set (3 Pts):
- Use Sunny scenario in each parking lot set to create your training set.
- Write a python program to extract training images using the XML file.
- Use any XML parser library to read the xml file and extract training images. Example below
- Train your cascade classifier (3 Pts)
(OpenCV provides utilities to train cascade classifier:
- Please provide examples of the sample dataset used for positives and negatives and report and justify the number of positive and negative samples used along with the no of stages used to train the cascade classifier and justify in the report.
- Use two sets of features to train your classifier
- HAAR – Haar-like features
- LBP – Local binary patterns
- Report performance of the classifier that is chosen 3. Car Detection (3 Pts):
- Use images from rainy and cloudy datasets to test your algorithm
- Write a python program that takes the cascade classifier parameters as input and a test image (from rainy and cloudy datasets) and performs car detection
- Test your detection using both sets of features, Haar and LBP 4. Parking lot analysis (3 Pts):
- Using the detected cars, and the location of the parking spots, determine, if a parking spot is occupied or empty.
- Use the ground truth to compare and summarize your results.
- Test 25 images each from rainy and cloudy (total 50 tests) dataset and report the true positives, false positive, accuracy.
- Some scenarios might have multiple cars but the parking spots might not be annotated, report your results only with respect to the annotated parking spaces and ignore the rest.
- Populate the table below with your findings.
- Report (3 Pts):
- Document your findings in the report
- In each of the steps of training, testing, and performance analysis, please include in your report, with example images, a discussion of the following:
- what challenges or limitation do you see in each step and what could be done to improve the same
- compare/show or discuss expected difference(s) before and after the improvement action.
- Submit code on Github
- All coding must be done using python
- Use tools available in OpenCV.
- Dataset can be downloaded at: