How to convert pixels to cm?

34 views (last 30 days)
Epah
Epah on 26 Oct 2013
Commented: MOUNA RAHAL on 9 Apr 2021
How to convert pixels into cm for the area and major axis length?
results =
Area: 16414
MajorAxisLength: 213.8713

Accepted Answer

Image Analyst
Image Analyst on 27 Oct 2013
  2 Comments
Epah
Epah on 27 Oct 2013
Thank you Image Analyst.
Stelios Fanourakis
Stelios Fanourakis on 1 Jan 2019
Thank you so much Image Analyst. Happy New Year.

Sign in to comment.

More Answers (2)

Walter Roberson
Walter Roberson on 26 Oct 2013
You can't tell if that is the only information you have.
  8 Comments
Image Analyst
Image Analyst on 8 Apr 2021
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 on 9 Apr 2021
Sorry i thought that it 's Walter.That is clear for me.thank you. So i need another calibration in that position.

Sign in to comment.


Epah
Epah on 26 Oct 2013
What other information do I need?
  1 Comment
Walter Roberson
Walter Roberson on 26 Oct 2013
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.

Sign in to comment.

Categories

Find more on Data Distribution Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!