1

I am working on car parking system project. For that, I would like to detect the presence of a car.

Can anybody tell me how I can accomplish this using MATLAB?

Also, what is the algorithm for detecting a car?

Dima
  • 38,860
  • 14
  • 75
  • 115
sunny
  • 19
  • 1
  • 1
  • 2

3 Answers3

5

There's a whole world of methods for object detection in images. You need to learn a little bit about image processing to solve this problem. I suggest you read about template matching or more generally about Object recognition. Specifically for car detection, if you know they will be seen at a certain angle (head on, for example) i'd try Viola-Jones detection which is implemented in OpenCV as haar-based feature cascade detection. Although OpenCV is not a matlab library, you can probably find something in matlab's image processing toolboxes that does a similar job (or interface into OpenCV)

sinelaw
  • 16,205
  • 3
  • 49
  • 80
2

Background subtraction would be a simple place to start.

In a nutshell:

  • Can capture an image of your empty parking lot. This is your reference image.
  • Compare the current image of your parking lot with the reference image. The parts that are different will be of interest.

Problems:

  • You need to keep updating your reference image to stay current with the conditions (e.g. day, night, cloudy, raining). Sometimes this may not be possible, because your reference image needs to have no cars in it for the approach to work.
  • Moving things in the background (like trees shaking in the wind) will come up as false positives
mpenkov
  • 21,621
  • 10
  • 84
  • 126
  • If you can control the parking lot, you can solve the problem partially in hardware. For instance, paint the parking lot number on the ground so that a car will cover it. This should provide you with some sharp contrasts. – MSalters Jan 31 '11 at 13:50
  • You'd have to have a top down view of the parking lot to make use of the numbers or any other markings on the ground. This would require either a camera high above the lot with sufficient resolution to get the numbers, or a camera above each parking spot. Either option is impractical. Things like oil spills and people that paint numbers on top of their cars also spoil your approach. – mpenkov Jan 31 '11 at 14:26
0

Have you considered using 3D/stereoscopic imaging in addition to using 'normal' images? If yes you could open up a whole new world of methods and intelligent tricks to remove objects based upon their distance to the camera. Then, any object that is a certain, fixed distance from the camera (e.g. your background) is easily removable and you can just process the new parts of the image (e.g. cars).

If this interests you I can supply you with an algorithm I have developed to detect animals in a livestock pen, which is a similar concept.

Adam893
  • 143
  • 1
  • 3
  • 16