Parking Spot Availability Detector

Project Overview:

This project leverages computer vision and machine learning to accurately detect and classify parking spot occupancy using a single camera feed. The system was trained locally and combines a machine learning classifier with efficient real-time processing techniques to identify available parking spots.

Technologies Used:

Libraries: OpenCV, Scikit-learn, Pandas, Pillow, Scikit-image, Matplotlib.

Development Environment: The system was developed and trained locally for optimal performance.

Methodology:

  • Classifier Training:

    • Using a labeled dataset of 3,046 images of empty parking spaces and 3,046 images of occupied spaces, a Support Vector Classifier (SVC) was trained with hyperparameter tuning via grid search, chosen for its effective handling of non-linear data boundaries.

    • The classifier achieved a 100% accuracy rate on the test data, making it highly reliable for distinguishing between empty and occupied spots. However, it’s important to note that while the test and training data are from different frames, they were all taken from the same video, with consistent lighting, weather conditions, etc. For a real-life project, more extensive and diverse training data would be needed to ensure robust performance across various conditions.

  • Application on Footage:

    • The trained classifier was then applied to real-time footage to detect the status of parking spots.

    • To optimize performance, the system checks for potential changes in occupancy by comparing the average pixel differences between consecutive frames. Only spots with a pixel difference exceeding a threshold of 0.4 are passed to the classifier for further analysis. This approach minimizes computational load by avoiding unnecessary classification on unchanged spots.

Challenges and Solutions:

While this project focused on consistent video footage, the modular and adaptable nature of the system allows for retraining to account for varying lighting conditions, weather, and seasonal changes.

Real-World Considerations and Potential Improvements:

Deploying this system in real-world scenarios would introduce new challenges that may require additional considerations:

  • Varying Lighting and Weather Conditions: Real-world environments can have changes in lighting (day vs. night, shadows) or weather (rain, snow, fog), which may impact detection accuracy. Additional training on a diverse dataset covering various conditions would help improve model robustness.

  • Camera Angles and Resolutions: Parking lots may use different camera positions and resolutions, affecting detection and classification accuracy. Calibration and additional data preprocessing steps may be necessary for consistent performance.

  • Occlusions: Vehicles, pedestrians, or other objects may partially block the view of a parking spot. Implementing techniques such as advanced tracking algorithms or handling occlusions could further enhance system reliability.

Results:

The integrated detection and classification system accurately identifies parking spot availability in real-time. The use of pixel-difference checks ensures efficient processing, making it suitable for deployment in practical scenarios.

GitHub: https://github.com/BrandtBrandtBrandt/parking-spot-availability-detector.git

Acknowledgment:

This project was part of the Computer Vision in 30 Days Coding Challenge by Felipe, also known as the Computer Vision Engineer on YouTube.

Previous
Previous

Synthetic Data with Stable Diffusion

Next
Next

OCR Text Reader Comparison