Calculating volume from a photo

68 ビュー (過去 30 日間)
kkk
kkk 2014 年 10 月 6 日
コメント済み: Image Analyst 2014 年 10 月 6 日
Hi! I want to ask is there a way to calculate the volume of wine inside the wine glass like in this photo? Or do I need more photos of this wine glass from different perspectives?

採用された回答

Image Analyst
Image Analyst 2014 年 10 月 6 日
We can't see your photo. But if you assume the glass is round, and if you've calibrated spatially, then you should be able to calculate approximate volume. You may need to throw in a small fudge factor to account for the refraction near the edges. To do that you could fill the glass with known volumes, then measure the area in pixels and calculate the volume. Prepare a function to transform the pixel volume into an actual volume in milliliters.
  4 件のコメント
José-Luis
José-Luis 2014 年 10 月 6 日
編集済み: José-Luis 2014 年 10 月 6 日
I'm curious. How would something of known size help if you don't know the depth of field? Wouldn't you need both its size and position relative to the glass and camera? It is relatively easy to make perspectives lie.
Image Analyst
Image Analyst 2014 年 10 月 6 日
If you put a ruler at the same plane as the glass, and assume the glass is round, and assume the vanishing point issue is minimal over the range of camera distances we're dealing with (from front to back of the glass), then you can get the width at each row and convert it to a volume of a disc with V = (lineSpacing)*pi*Diameter^2/4. Then do that for every line in the wine to get a rough volume. Of course if you have an angle view so that you're seeing the top surface of the glass, it gets a lot more complicated - not so straightforward as if you have a perfectly perpendicular viewpoint. That's why I said to calibrate by getting a transfer function of true volume vs. pixel area.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by