Effacer les filtres
Effacer les filtres

How to extract velocity in mm unit using Optical Flow

9 vues (au cours des 30 derniers jours)
Fahad Aljehani
Fahad Aljehani le 29 Juin 2021
Modifié(e) : Prakhar Rai le 30 Juin 2021
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.

Réponse acceptée

Prakhar Rai
Prakhar Rai le 29 Juin 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 commentaires
Prakhar Rai
Prakhar Rai le 30 Juin 2021
Modifié(e) : Prakhar Rai le 30 Juin 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.
Fahad Aljehani
Fahad Aljehani le 30 Juin 2021

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Optics dans Help Center et File Exchange

Produits


Version

R11.1

Community Treasure Hunt

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

Start Hunting!

Translated by