Okay, here’s my blog post about setting up foot traffic counters for tourist attractions, written from my personal experience and in a casual, conversational tone:

So, I’ve been messing around with this project lately – trying to figure out a good way to count how many people are walking through different spots at tourist attractions. It’s trickier than you might think! I wanted to share what I did, what worked, and what totally bombed.

The First Idea (and Why It Flopped)

My first thought was, “Hey, I’ll just use those cheap infrared beam break sensors!” You know, the kind you see in some stores that ‘ding’ when you walk in? Seemed simple enough. I ordered a bunch online and started tinkering.

I set them up across a few pathways at a local park (with permission, of course!). I figured I’d just hook them up to a little counter and be done. Boy, was I wrong.

  • Problem 1: Sunlight. Turns out, direct sunlight totally messes with these things. They’d trigger randomly, giving me crazy high numbers.
  • Problem 2: People walking side-by-side. If two people walked through at the exact same time, it would only count as one.
  • Problem 3: Leaves, birds, squirrels… you name it. Anything breaking the beam would trigger it. My counts were way off.

So, the infrared beam break sensors were a bust. Back to the drawing board.

Getting a Bit More Serious

I realized I needed something more reliable and a bit smarter. I started looking into cameras and some basic computer vision stuff. This got a little more complicated, but it was way more interesting.

I grabbed an old webcam I had lying around and installed some open-source software that can do object detection. The idea was to have the camera “watch” a specific area and count people as they walked by.

This was definitely better than the infrared sensors, but still had some issues:

  • Problem 1: Lighting changes. Shadows and different times of day would sometimes confuse the software.
  • Problem 2: Processing power. My old laptop was struggling to keep up with the video processing, especially if there were a lot of people.
  • Problem 3: Accuracy: The software is not always accurate, sometimes count 2 people as 1.

Improve and Try Again!

To solve these problems, I did the following improvements:

  • I changed an old webcam to a camera which more suitable for outdoor.
  • I used a more powerful computer to boost processing power.
  • I spent several days to train the software’s model, I showed it hundreds of pictures of that area, and taught it to better recognize when a “person” was passing through.

Finally, I got a quite reliable tool of foot traffic counter.

It’s not perfect, but it’s a huge improvement! I’m still tweaking things, but it’s been a fun learning experience. I’ll keep you all posted on any further developments!