GithubHelp home page GithubHelp logo

Comments (4)

rplankenhorn avatar rplankenhorn commented on June 7, 2024

@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?

Screenshot 2023-11-16 at 2 10 29 PM

from speed-camera.

kempokempo avatar kempokempo commented on June 7, 2024

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.

pageauc avatar pageauc commented on June 7, 2024

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.

bartek avatar bartek commented on June 7, 2024

@kempokempo @pageauc Awesome, thank you for the explanation! Apologies for not responding sooner.

from speed-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.