Inspiration
I ride County Road 116 in Shulin, New Taipei, every day. Just before it climbs onto a bridge, 85 metres squeeze a scooter from both sides: a solid line on the left, a narrowing painted island ahead, and on the right a drain strip with seven steel grates. Nothing is obviously illegal. Every piece sits at the edge of a written limit, and they all land on the same stretch and the same rider. I wanted to turn that feeling into numbers anyone can check.
What it does
Send one street photo to the endpoint. It checks that the photo shows a road, then measures against written rules: how far the red no-stopping line moved (using the line's own legal 10 cm width as the ruler) and how sharply the lane closes (against the design table's 5:1 at 30 km/h). A number is reported only if it holds across four versions of the image. It says what it measured, what it couldn't and why, and ends with what to do next: which document to request from which office, tied to what it found in the photo.
Offline, the same OpenCV 5 methods produced the evidence in the story:
- In 16 of 16 top-down photos, the new red line runs straight across a drain grate.
- The red line moved out 0.60–0.68 m, onto the drain strip; a bank card confirms the 10 cm ruler (95–97 mm).
- The painted island closed at about 4–5:1 before it was repainted (at the limit) and about 12:1 after (passes).
How I built it
OpenCV 5.0.0 in an arm64 container on AWS Lambda behind API Gateway. Grates are found by gap darkness, morphology and a bar-periodicity (FFT) test; the red line by LAB colour and line fitting; the island's edges only when two independent recognisers agree (outermost paint and EDLines); the ground angle from vanishing points and the camera intrinsics, with a self-check that the lane edge meets the horizon at the road's own vanishing point. Every published number is pinned to the file that produced it and checked by a script; 212 tests.
Challenges I ran into
My first published taper, "about 10:1", was wrong. Re-saving the photo once turned 11.9 into 23.2. Drawing what the program had picked showed it was grouping different painted lines, not the island's two edges. I withdrew the number, rebuilt the measurement so two recognisers must agree, and added the four-version check to the endpoint. The deployment also hit the AWS account's 3,008 MB Lambda memory cap, so full-resolution photos currently time out online.
Accomplishments that I'm proud of
Every number in the story has a source and an uncertainty, and the ones that did not survive re-checking are listed as withdrawn rather than removed. The system refuses rather than guesses.
What I learned
A measurement that changes when the image is re-saved is not a property of the road. Drawing what the algorithm picked is faster than any statistic at showing whether it is measuring the right thing.
What's next
Request the three documents the system lists (marking plans, the works' traffic plan, the drain records); measure the grate step and wet grip on site with a 3 m straightedge and a skid tester; photograph the stretch at night; raise the Lambda memory limit so full-resolution photos run online.
Built With
- amazon-api-gateway
- amazon-cloudwatch
- amazon-ecr
- arm64
- aws-lambda
- docker
- numpy
- opencv
- python

Log in or sign up for Devpost to join the conversation.