Niranjan Dixit
Niranjan Dixit

Reputation: 115

Auto parking space detection - how to initialize parking map/space with OpenCV and Python

I am working on a project "smart parking", and I stumbled upon a YouTube video that contains what we exactly need. We had already achieved 1st half that is live perspective transform from video feed and the next step is to define it as a set of rectangles

I basically need to know how he has done this: "the parking map is defined as a set of rectangles". Any help is appreciated.

The link to the original video Auto parking space detection

Upvotes: 0

Views: 3068

Answers (1)

Saikat
Saikat

Reputation: 1219

From the video its not clear exactly what kind of algorithm has been used but if you want to develop it on your own, you can proceed as follows. To make the overall procedure simple, we assume that the camera is fixed i.e., it cannot rotate or zoom.

  1. Define background image - Take snapshot of the parking space as background image (without having any car parked in the parking lot and marking lines clearly visible).
  2. Initialize parking map as rectangles - Do it manually(as we assumed the camera is fixed) or automatically by detecting white marker lines through color or line detection or any other image processing technique.
  3. Continuously check for parking status - For each frame of the camera feed, check if parking spaces(marked rectangular positions) are occupied or not by background subtraction method or any other methods.
  4. Update status - Update parking status accordingly (as shown in the right window of the video).

Upvotes: 1

Related Questions