The problem: one more lap around every row

In mall and hospital car parks, drivers enter without knowing where the free spaces are, so they circle the rows and the queue at the entrance grows. The known fix is a sensor above or under every space, but that means hundreds of sensors, cabling and maintenance. So we asked: is one camera overlooking the whole car park enough?

This is the story of building Rakaiz Mawqif, and the numbers in it come from a real run on aerial footage of a car park with 69 spaces.

First surprise: the model saw no cars

We started with a well-known general detection model, the same kind we use for visitor counting and safety-gear detection. We ran it on the overhead shot and got zero: not a single car. These models learned what a car looks like from street-level photos, and from above a car is a different shape: a coloured rectangle with no wheels and no front.

The fix was a model from the same family trained on aerial images, which draws a rotated box that follows each vehicle's direction instead of an ordinary square. On the same frame it found around 60 vehicles. The lesson: the right model depends on the camera angle, not on the name of the thing you are looking for.

When is a space occupied?

Detecting a car is not enough; we need to know which space it is in. A car may park at an angle, or a van may cross the line. We tried several rules and settled on a simple one: a space is occupied when a vehicle covers at least 35% of it. A lower share counts an angled car on two spaces, and a higher one makes a small car in a large space look absent.

Second problem: shaky numbers

On the first run the number on the screen jumped: 14, then 13, then 14 within a second. The cause was a car driving down the aisle and briefly covering the edge of a space, or a frame where detection missed. Drivers do not trust a screen like that.

The fix is a vote: the system analyses 12 frames a second, and a space only changes state when the change holds in most of the last seven frames, about half a second. The result on a 28-second video: free spaces ranged between 12 and 15, with only 3 real changes, all of them cars that actually left, and no false jumps.

Defining the spaces: once, at installation

The camera does not know where the lines are, so we have to tell it where the spaces are. There are three ways: draw rectangles on the camera image, use a regular grid for even rows, or automatic calibration: the system watches the car park for 10 seconds and treats every place where a car stayed still the whole time as a space. In our test, automatic calibration found 54 spaces, all of which match the hand-drawn ones, after we dropped a van standing in the loading bay because it is far larger than a normal space. Spaces that were empty during calibration are of course not found, so they are added by hand or by repeating calibration at peak time.

Speed on an ordinary computer

Analysing one frame took 0.4 seconds on an ordinary processor with no graphics card. That is more than enough, because a space does not change state every fraction of a second. In a real installation, a small device next to the camera analyses one or two frames a second and sends only the numbers, not the video.

Why bundle it with Rakaiz Obour?

The overhead camera knows how many spaces are free, and Rakaiz Obour at the gate knows who came in and who left. Together, the entrance screen shows free spaces the moment the plate is read, management knows parking duration and occupancy for every hour, and reports bring the gate and the spaces into one place.

What we learned

  • The camera angle decides the model: an excellent street-level model may see nothing from above
  • A simple rule is enough: one clear coverage share beats complex logic that is hard to tune
  • Stability matters more than speed: a number half a second late that stays steady beats an instant one that shakes
  • Test on your own footage: the video used here is a ready-made aerial clip used for demonstration only, and before any installation we test on the site's own camera, angle and lighting

Running a car park?

See Rakaiz Mawqif, read about Rakaiz Obour, or get in touch and we will try the system on footage from your car park's camera.