How do I measure the conversion between pixels to cm from an image?

3 visualizaciones (últimos 30 días)
Riccardo Consolo
Riccardo Consolo el 13 de Jul. de 2018
Comentada: Image Analyst el 14 de Jun. de 2020
I have a picture that includes part of a ruler. I want to measure the length of the ruler by tracing a line on the image and see how many pixels correspond to the length of it. How do I trace a line on the picture manually after it is already displayed and save the length in pixels? I can easily do the conversion once I have the length in pixels, but I don't know the function to trace the line.
Thank you.

Respuestas (1)

Image Analyst
Image Analyst el 14 de Jul. de 2018
Run my attached spatial calibration demo. It will show you exactly what to do.
  2 comentarios
kamran  zahid
kamran zahid el 14 de Jun. de 2020
Excellen.
Do I need to know the area of my camera covering rectangular frame for this or not?
Image Analyst
Image Analyst el 14 de Jun. de 2020
No, but if you do that makes it easy. Just divide the real world distance of your field of view by the number of pixels across. The demo asks you to draw a line across some known distance, like a ruler or whatever, and then it computes the ratio of real world distance over pixels, which you can then multiply by any pixel-based distance to get the real distance, or multiply its square by areas in pixels to get areas in real world units.

Iniciar sesión para comentar.

Categorías

Más información sobre Camera Views en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by