How to extract velocity in mm unit using Optical Flow
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fahad Aljehani
el 29 de Jun. de 2021
Editada: Prakhar Rai
el 30 de Jun. de 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.
0 comentarios
Respuesta aceptada
Prakhar Rai
el 29 de Jun. de 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 comentarios
Prakhar Rai
el 30 de Jun. de 2021
Editada: Prakhar Rai
el 30 de Jun. de 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.
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Camera Calibration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!