Skip to content

thewunderboy/CPSD

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAR PARKING SPACE DETECTION

This project detects and counts vacant car parking spaces in a video feed using OpenCV image processing (adaptive thresholding and pixel counting) — no machine learning model is required.

How it works

  1. ParkingSpacePicker.py lets you mark parking space positions on a reference image (carParkImg.png). Left-click to add a space, right-click to remove one. Positions are saved to the CarParkPos file. Press q to quit.
  2. main.py reads carPark.mp4, applies grayscale conversion, Gaussian blur, adaptive thresholding, and median blur to each frame, then counts non-zero pixels within each saved parking space region to decide whether it's occupied or free. Press q to quit.

Running the project

  1. Clone the repository to your local machine.
  2. Install the necessary dependencies: pip install -r requirements.txt
  3. (Optional) Re-mark parking spaces for your own footage: python ParkingSpacePicker.py
  4. Run the detector: python main.py
  5. The system displays each parking space as green (free) or red (occupied), along with a running count of available spots.

Files

  • main.py — runs the parking space detector on carPark.mp4.
  • ParkingSpacePicker.py — interactive tool for marking parking space positions.
  • CarParkPos — pickled list of parking space coordinates.
  • carParkImg.png — reference image used by the picker tool.
  • carPark.mp4 — sample video feed used by the detector.

Contributions to the project are welcome. Please submit a pull request with your changes.

About

This project aims to create a system that detects empty parking spaces using cameras and YOLO. It will display the number of available spots in real-time and can be integrated into smart parking systems.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%