Clear Filters
Clear Filters

How to extract velocity in mm unit using Optical Flow

9 views (last 30 days)
I am using Optical Flow to extract metrics as velocity and angle of a moving object. The output of Optical Flow is (u,v) which are the velocities (in pixel unit I assume) in x and y axes. My question is how to convert the resultant u and v (pixel) into mm?
I saw that different techniques can be applied as taking an image of a ruler and evaluate how many pixels in i.e. mm. I think this is not a good solution beause it depends on the intrinsic and extrinsic parameters of the camera.

Accepted Answer

Prakhar Rai
Prakhar Rai on 29 Jun 2021
Using this you could calculate it for your situation/dpi :
dpi is the pixel density or dots per inch.
96 dpi means there are 96 pixels per inch.
1 inch is equal to 25.4 millimeters.
1 inch = 25.4 mm
dpi = 96 px / in
96 px / 25.4 mm
Therefore one pixel is equal to
1 px = 25.4 mm / 96
1 px = 0.26458333 mm
  3 Comments
Prakhar Rai
Prakhar Rai on 30 Jun 2021
Edited: Prakhar Rai on 30 Jun 2021
Yess camera calibration can deal with radial distortion of an image.
The radial distortion coefficients model this type of distortion. The distorted points are denoted as (xdistorted, ydistorted):
xdistorted = x(1 + k1*r2 + k2*r4 + k3*r6)
ydistorted= y(1 + k1*r2 + k2*r4 + k3*r6)
  • x, y — Undistorted pixel locations. x and y are in normalized image coordinates. Normalized image coordinates are calculated from pixel coordinates by translating to the optical center and dividing by the focal length in pixels. Thus, x and y are dimensionless.
  • k1, k2, and k3 — Radial distortion coefficients of the lens.
  • r2: x2 + y2
Typically, two coefficients are sufficient for calibration. For severe distortion, such as in wide-angle lenses, you can select 3 coefficients to include k3.
You could refer this link : calibration calibrator radialDistortion
Specialized software packages as Photomodeler or Camera Calibration toolbox for Matlab are designed for the calibration of non-metric cameras.
Calibration is the solution of radial distortion and pixel density won't help you much.

Sign in to comment.

More Answers (0)

Products


Release

R11.1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!