Show RF: Utility Pole Lean Detector
Project description:
I built a system that can measure the lean of utility poles in my neighborhood. A windshield mounted phone records the drive, a self-hosted Roboflow Workflow segments each pole and measures its lean, and then every pole is mapped by severity. It runs on a phone and a laptop, with no special hardware.
Utility poles fail, and when they do they cause power outages, road closures, injury, and property damage. Pole health depends on several factors, and lean is one of them. A 2019 resilience study sets a healthy lean below 15 degrees and critical from 15 to 25, and says utilities choose the value themselves (there is no standard).
Objective
Drive through my neighborhood and by using a phone alone, flag every pole that is leaning 15 degrees or more to identify the ones where maintenance should be prioritized before they fall.
Data and Workflow
I used a fixed windshield mount for my Android phone and captured 125 images of poles on various streets during different lighting scenarios (cloudy and daylight). Smart Select was used to label the pole trunks and were used to train a RF-DETR segmentation small model. A custom workflow was used to calculate the pole angles and both the inference and workflow were run locally.
While driving I captured GPS for the pole mapping and inertial data that was intended for camera roll correction. I ultimately decided that the inertial data was out of scope for this project (There’s further detail about this decision later in this post).
Accuracy Limitations
Before detailing how the angle was actually measured, it makes sense at this point to discuss the obvious limitation with the approach of using just my phone for this project: the camera can only see one perspective of the pole, so it can only detect the in-plane lean.
Poles leaning toward or away from the camera will have a less accurate measurement, but because of foreshortening, the angle I am calculating is the floor. Meaning, that the measurement tells us that a pole is leaning “at least this much”. If this was a production use case, I would likely have multiple cameras that can see the pole from different perspectives.
Ultimately the value with this project is that I can identify poles that have excessive leans relative to each other.
Angle Measurement
These are the steps that I used to determine the angle:
- First I segmented just the wooden shaft of the pole.
- Next I found the axis of the pole by using PCA on the mask.
- Then I measured the axis against the vertical to calculate the angle for the same pole in each frame that it was visible.
- And lastly, I chose the best single frame to use for the angle measurement and used this frame for the masking on the final video rendering.
The ground truth vertical in this case was essentially the video frame edge. Since I was capturing video while my car was moving, I did have a concern about camera roll. My intent was to do a frame by frame correction by using the inertial data captured by phone at the time the video was recored.
I decided to first use a clinometer app on my phone to understand what the typical roll was while driving, and I learned that it only varied by a few degrees unless I was turning at an intersection. This is because my neighborhood is relatively flat with long straight roads. The windshield mount itself was only off center by about .5 degrees, so ultimately I didn’t think the calibration would be worth the effort.
Which frame to choose to lock in the angle measurement for a given pole was based on the following criteria:
- Minimum mask elongation
- Bounding box not touching the top edge
- Minimum box height
- Minimum confidence score
Ultimately I mapped 556 poles. Here are the stats:
- Healthy (under 10 degrees) = 547
- Borderline (10 to 15) = 9 (1.6%)
- Over threshold (15+) = 0
Pipeline
This is the complete pipeline for capturing and processing the video:
- Step 1: Workflow, detect, track, segment, and measure every frame
- Step 2: Selection, gate and rank each pole’s frames, lock one trusted angle
- Step 3: Redraw, render the video with the frozen angle, axis, and color
- Step 4: Map, join each locked pole to its GPS and pin it curbside by status
