Comments (4)
@pageauc I am also interested in this and figured I would piggy back on this issue instead of creating a new one.
Since we adjust these four values:
CAL_OBJ_PX_L2R = 80 # L2R Moving Objects, Length of a calibration object in pixels
CAL_OBJ_MM_L2R = 4700 # L2R Moving Objects, Length of the calibration object in millimetres
CAL_OBJ_PX_R2L = 85 # R2L Moving Objects, Length of a calibration object in pixels
CAL_OBJ_MM_R2L = 4700 # R2L Moving Objects, Length of the calibration object in millimetres
Am I right in just assuming that the CAL_OBJ_PX value is just an arbitrary distance in pixels and CAL_OBJ_MM is just that same distance in millimeters? So we are just creating a ratio for converting any pixel width to millimeters?
For my case, I have two very convenient trees. I was thinking about just measuring the distance they are apart in pixels and then physically measuring how far apart they are in millimeters and then just using that as my input values. Or am I missing something?
from speed-camera.
A bit late, i know - but this confused me for a minute too and I thought I'd share my findings.
The idea of calibration is to account for how far away the moving object (i.e. a car) is from the camera - the further away from the camera, the more distance/area is covered by one pixel. So using those two trees wouldn't work, as they are closer to the camera than the car. Equally, a parked car won't work as it might also be further away than a moving car. The calibration object is a moving car, not the capture box, which only shows the area of the image in which the system is looking for motion.
To calibrate, i drove past in my car, which I have precise measurements for, and measured the number of pixels my car took up as i drove past in each direction. So I have the same CAL_OBJ_MM value for both L2R and R2L, but different pixel counts.
from speed-camera.
Explanation is correct. Count length in pixels of actual vehicle bumper to bumper works best. Then take a tape measure and measure the same vehicle from bumper to bumper and convert to millimeters. repeat for other roadway since it will be a differnt distance away. You now have pixel and mm distance. Put these numbers in calibration settings in config.py. A mm per pixel will be calculated. speed can be calculated by timing pixels traveled and is then converted to mph or kph.
from speed-camera.
@kempokempo @pageauc Awesome, thank you for the explanation! Apologies for not responding sooner.
from speed-camera.
Related Issues (20)
- No Window to view camera HOT 6
- Windows not displaying on host machine HOT 1
- Frames dropped due to contour out of bounds? HOT 2
- Docker Install always 11.22 HOT 1
- Calibration with different Screen Ratio and Framerate HOT 1
- No detections or speed calcs HOT 2
- No images
- How do I manually trigger the camera? HOT 4
- Can I reposition calibration marks? HOT 1
- Capture being triggered by small objects and missing all vehicles. HOT 1
- Warnings in startup log: "Unsupported V4L2 pixel format" HOT 1
- Vehicles at higher speeds being missed. HOT 4
- search-speed / Not compatible with the major rewrite? HOT 2
- Bigger resolution - `picam720` plugin - `speed_camera Out - 0/6` messages HOT 1
- Vehicles detected twice: Ideal `MO_TRACK_EVENT_COUNT`
- `MO_MIN_AREA_PX` is not the area of the rectangle
- Capture video HOT 2
- RPI 5, Bookworm - speed_cam.py process starts, then stops HOT 1
- Over reading speed on large vehicles HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speed-camera.