How to convert pixel size to inches
Show older comments
I have an image of my experimental specimen. I know the dimensions of my specimen. I have taken a picture of my specimen. Now, how can I convert pixel information from the image to get the dimensions of my specimen? Basically, I can measure pixel distance and want to correlate to real life dimensions.
Accepted Answer
More Answers (2)
Ash.P
on 15 Jan 2017
0 votes
@Image Analyst - The 'calibration factor' that you talk about here would be different for objects at different distance from the camera right? How do you account for this fact?
6 Comments
Image Analyst
on 15 Jan 2017
Right. Personally I don't, as I assume the things to be measured are all in the same plane. For situations like you describe, the Mathworks handles that with the camera calibration capabilities of the Computer Vision System Toolbox. https://www.mathworks.com/products/computer-vision/features.html#camera-calibration
Ash.P
on 15 Jan 2017
Thank you for the reply Image Analyst.
In the camera calibration, are you referring to the intrinsic parameters that help determine this conversion?
Image Analyst
on 15 Jan 2017
Not sure what the question means. I haven't used it, but I assume you'll have to enter some kind of information like working distance, focal length, or whatever.
Ash.P
on 15 Jan 2017
Yes. That was my question. Intrinsic matrix uses those except the operating distance. I am trying to estimate 'calibration factor' at different planes without using the calibration matrix. I have an object of known dimension at depth1 and I estimate what 1 pixel corresponds to at this distance and estimate the value of 1 pixel at all other distances using this value and scene geometry.
Do you have any inputs for this?
Image Analyst
on 15 Jan 2017
Like I said, I have used the camera calibration software provided with the Computer Visions System Toolbox. I'd have to figure it out just like you'll have to. Contact the Mathworks for help. Good luck.
Ash.P
on 16 Jan 2017
Thank you! Appreciate it!
Ashwini
You correct distance by correcting 2 angles, vertical and horizontal.
Try Michael Chan's perspective correction pack available from the File Exchange
it prompts you to key in a few points to reference elements in the picture and the a perspective transform is applied.
If you find this link useful, would please be so kind to mark my answer as accepted answer?
Thanks for time and attention,
John BG
Categories
Find more on Introduction to Installation and Licensing 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!