How to extract velocity in mm unit using Optical Flow
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Prakhar Rai
2021-6-29
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 个评论
Prakhar Rai
2021-6-30
编辑:Prakhar Rai
2021-6-30
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Optics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!