How to convert pixels to cm?

12 ビュー (過去 30 日間)
Epah
Epah 2013 年 10 月 26 日
コメント済み: MOUNA RAHAL 2021 年 4 月 9 日
How to convert pixels into cm for the area and major axis length?
results =
Area: 16414
MajorAxisLength: 213.8713

採用された回答

Image Analyst
Image Analyst 2013 年 10 月 27 日
  2 件のコメント
Epah
Epah 2013 年 10 月 27 日
Thank you Image Analyst.
Stelios Fanourakis
Stelios Fanourakis 2019 年 1 月 1 日
Thank you so much Image Analyst. Happy New Year.

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

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 10 月 26 日
You can't tell if that is the only information you have.
  8 件のコメント
Image Analyst
Image Analyst 2021 年 4 月 8 日
I said that, not Walter, and I gave you an example already, with the moon. Let me paraphrase it and maybe you'll understand it better.
Let's say you had your camera in your front yard on a tripod, and in the field of view you could see a ruler standing on its edge on a table. And let's say just above that you could see the moon in the sky just above the ruler. Now we know the ruler is 12 inches and let's say you measure it some how, like with imdistline() or improfile(), and found out the ruler is 1200 pixels. The spatial calibration factor is therefore (12 inches) / (1200 pixels) = 0.01 inches / pixel. So now we know that for things at that distance of the ruler, they can be measured accurately. If I measure, say, a water bottle that is also standing on the table and find that it is 400 pixels wide, then the real world width of the water bottle would be 400 * 0.01 = 4 inches.
Now let's consider the moon, which is not on the table at a distance of 10 feet, but is actually 239,000 miles away. Let's now measure the moon in the photo, and let's say it's 100 pixels. So now, can we say that the real world diameter of the moon is only 100 * 0.01 = 1 inch? Of course not. We know that the moon is actually 2159 miles in diameter! Why is it not one inch???? The answer is because it is not in the same plane as the ruler where we made our spatial calibration so the magnification is different.
Does that explain it better?
MOUNA RAHAL
MOUNA RAHAL 2021 年 4 月 9 日
Sorry i thought that it 's Walter.That is clear for me.thank you. So i need another calibration in that position.

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


Epah
Epah 2013 年 10 月 26 日
What other information do I need?
  1 件のコメント
Walter Roberson
Walter Roberson 2013 年 10 月 26 日
Lens aperture and distance to the object. Or, something in the image at the same distance as the object and which is of known length. Or something in the image that is of known length, and the distance to both that reference object and the target object are known.
That is, you can use optical properties to determine the true size of the target object, or you can use trigonometry.

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

カテゴリ

Help Center および File ExchangeMATLAB Support Package for USB Webcams についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by