Equation to measure meters from pictures

24 ビュー (過去 30 日間)
Abdussalam Elhanashi
Abdussalam Elhanashi 2020 年 12 月 21 日
回答済み: Image Analyst 2020 年 12 月 24 日
Hi,
I am measuring the distance between the centroid of bounding boxes for detected objects in pixels in the images .I am looking for an equation which convert the measurment in pixels into meters .
Best
  1 件のコメント
Matt Gaidica
Matt Gaidica 2020 年 12 月 21 日
編集済み: Matt Gaidica 2020 年 12 月 21 日
You're going to need a reference in your frame—do you have that? (e.g., a ruler) Once you have that, you have some ratio of pixels/meters, and you divide your object pixel distances by that to get your answer.

サインインしてコメントする。

回答 (2 件)

Rishabh Mishra
Rishabh Mishra 2020 年 12 月 24 日
Hi,
To find distance between 2 points, you require their co-ordinates. Assuming co-ordinates for 2 points are stored in arrays x & y respectively. The distance ‘D’ between these 2 points is given by,
x= [1 2 3];
y= [3 4 5];
D = norm(x-y);
The distance value so obtained has units as pixels. Convert pixels into meters using the conversion value given below:
1 pixel = 0.0002645833 m
Hope this helps.
  1 件のコメント
Image Analyst
Image Analyst 2020 年 12 月 24 日
Where did you get that number?

サインインしてコメントする。


Image Analyst
Image Analyst 2020 年 12 月 24 日
See my spatial calibration demo. It will show you how you can get the meters per pixel, or whatever real world units you're using.

カテゴリ

Help Center および File ExchangeFeature Detection and Extraction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by