The screen capture of Figure
H
shows a fully-
decorated view that includes the clipping limits,
blockers, and noise sources as configured for my
setup. The clipping limits are the horizontal blue
lines that span the image width. The bright red
squares on the trees depict blockers. Small blue
rectangles outline pesky moving branches that
are configured as noise sources. The upper image
also shows a bright green contour which is the
outline of the blob created by the moving pickup
truck, and there is a blue rectangle showing the
limits of the blob. The truck has been tracked for
several frames and there is a speed estimation
label on the lower right. The bright blob in the
lower image shows how effective the logic is at
detecting the moving vehicle.
Speed estimation works best for a relatively
clear view of traffic that basically moves
horizontally across the frame. By default, the
software is configured to only track the three
largest blobs in each frame. This limit reflects
performance and complexity considerations; Pi
CPU usage is typically 80% with a video framerate
of 10 or 12 frames per second. The system works
well for a typical residential street, but not for a
busy highway.
SPEED CALIBRATION
Once the clipping limits and blockers are
configured, you’ll make calibration runs to adjust
the speed estimation for your street monitoring
setup. Simply drive through the entire camera
view at a safe, steady speed. Then stop the
program and play the recorded video file to
see the estimated speed. Compute the ratio of
your actual speed to the estimated speed. Find
the speedfactor value in the source code and
multiply it by your ratio.
Based on my setup, the app is coded to save
JPEG screen captures of any vehicles going by
at 28mph or greater if the speed estimation
passes various quality checks and there’s enough
daylight to yield a decent photo (Figure
I
). These
criteria are in the trail_complete Python
method, which also does routine logging of the
vehicle speeds to a text file. You can have fun
adjusting the criteria for your deployment. The
text logging doesn’t consume much storage and
Trap app: A desktop view of
the speed trap app running.
H
Busted! A white SUV clocked at 28.3mph.
I
81
make.co
M83_076-83_PiCamSpeedTrap_F1.indd 81M83_076-83_PiCamSpeedTrap_F1.indd 81 10/10/22 4:16 PM10/10/22 4:16 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.202.187