Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Parking distance calculation for a car

I want to make a parking assistant in my garage, by using a camera and opencv. My idea was to place to camera on the ceiling, very close to the wall ( max 20cm from the wall) looking down. Angling the camera so the corner between the wall and the floor is visible in the video.

I then want to calculate the distance from the wall to my car as it is backing into the garage. It should be able to handle a situation if the car comes in at an angle to the wall.

Assumptions and known variables:

  • Ground is flat
  • Height from camera to floor is known
  • Camera is calibrated

I am able to detect the line the edge between my wall and floor makes, by using canny edge detection and hough transform. As I know its pixel position and its world Z position from the camera, I can easely calculate its X and Y coordinates in the world.

My problem is with the car. I am not able to get a proper detection of the edge of the car as it moves into the garage. The other problem being tracking it when i first find it.

I thought of other solutions like detecting the gap my car and wall makes instead. I am quite new to OpenCV, so I am not too sure where to start with this.

If anyone could point me in the right direction, or know a good solution to this problem, that would be much appreciated.