How to extract velocity in mm unit using Optical Flow

조회 수: 10 (최근 30일)
Fahad Aljehani
Fahad Aljehani 2021년 6월 29일
편집: Prakhar Rai 2021년 6월 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.

채택된 답변

Prakhar Rai
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
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.
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Optics에 대해 자세히 알아보기

태그

제품


릴리스

R11.1

Community Treasure Hunt

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

Start Hunting!

Translated by