Hello, I'm using matlab gui to count objects in an image and plot an histogram which shows the size distribution of these latest. My problem is the X axis of the histogram corresponds to the number of pixels forming the edges of the objects. In the image i want to analyse, I have a bar which corresponds to the scale in meter. Does anyone know how to measure this scale to convert the number of pixels in the X axis to meter ?
Thank you in advance :) Hadi

답변 (1개)

Image Analyst
Image Analyst 2017년 2월 9일

0 개 추천

You need to calculate/determine a spatial calibration factor. Are you looking through a microscope or telescope? The number of meters per pixel will be vastly different for those two cases. What is your field of view? Basically to get linear distances you need to multiply pixels by meters per pixel, and to get squared things, like area, you need to multiply by (meters per pixel)^2.
See my attached spatial calibration demo.

댓글 수: 5

Hadi Hijazi
Hadi Hijazi 2017년 2월 9일
Hello, thank you for your answer. This is the kind of images i have, and the scale is not the same for all my images, so i have to measure the scale in each one to know what is the scalar i should multiply by the number of pixels to obtain the real lengths of objects edges.
Thank you :)
Image Analyst
Image Analyst 2017년 2월 9일
You can easily find the length of the bar just by examining the line that contains the bar. But you'd have to know the real world distances. Hopefully it's in the header of the image and you don't have to do OCR on the numbers in the image.
Hadi Hijazi
Hadi Hijazi 2017년 2월 10일
Thank you for your help :)
Nagendra babu Gurram
Nagendra babu Gurram 2018년 11월 8일
can we use vanishing points for this problem
Image Analyst
Image Analyst 2018년 11월 8일
Yes but you'd have to measure at two locations and develop a spatial calibration "image" that gives you the spatial calibration at each location. I think that's probably what the camera calibration function in the Computer Vision System Toolbox does, though I haven't used it. See https://www.mathworks.com/products/computer-vision/features.html#camera-calibration since that's exactly what you need.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2017년 2월 8일

댓글:

2018년 11월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by