how to convert Pixel to cm or inch (i want to know 1 pixel equal = ?? mm or = ?? cm = ?? inch)
29 views (last 30 days)
Show older comments
Sir, i want to know 1 pixel equal = ?? mm or = ?? cm = ?? inch
my Pixel Weld Area shown after area calculation is 23842 i getted from weld image region.
How i convert Pixel to cm or inch
There is any equation or formula to convert Pixel to cm or inch
Plz Help me.
2 Comments
Nishan Dangi
on 3 Oct 2021
Calculation of units (Px/Inch/cm/mm)
Pixels (px)
A small square variable units , it depends upon resolution. Resolution: Resolution is a quantity of pixels per inch , we called it DPI (dots per inches) some preset of resolution ; For screen quality; resolution (R)= 72 dpi For printing quality , resolution® = 300 dpi That means : 1 inch = 72 px or 300 px
Inch<> px 1 inch = resolution (R) px 1 px = 1/R inch
cm<> px 1 px = 1/R inch = 1/ R * 2.54 cm ( 1 inch = 2.54 cm) = 2.54/R cm Therefore , 1 cm = R/ 2.54 px
mm<>px
1 px = 2.54 /R cm
= 2.54/r * 10 mm ( 1 cm = 10 mm)
= 25.4 /R mm
Therefore ,
1 mm = R / 25.4 px
summary 1 inch = R px 1 cm = R/2.54 px 1 mm = R/ 25.4 px
For resolution 72 dpi, 1 inch = 72 px 1 cm = 72/2.54 px =28.3464567 px 1 mm = 72/ 25.4 px = 2.8346457 px
Image Analyst
on 4 Oct 2021
@Nishan Dangi, that has nothing to do with the resolution in his image. He wants to know how big the weld is in his image, not how big it is on his screen -- that's meaningless. If you just viewed the image on a larger screen, that does not mean the weld in the image is bigger. The weld is the same size regardless of screen size or how many DPI your screen or video adapter has.
Answers (2)
Image Analyst
on 28 Jun 2014
Edited: Image Analyst
on 28 Jun 2014
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_measure_a_distance_or_area_in_real_world_units_instead_of_in_pixels.3F
I've also attached a demo for you.
5 Comments
Image Analyst
on 4 Apr 2016
The area from bwarea() or regionprops() is initially in pixels. We really don't distinguish between linear pixels and square pixels - it's understood from the context. So length and area are both in pixels - you just have to know that to get real world distance you must multiply by the calibration factor, and to get real world areas you must multiply the pixels by the square of the calibration factor. Just think about it and it will eventually make sense to you.
Waqar Buriro
on 23 Mar 2018
Hello , But how can i find the real length of dicom image if that is taken from a online data source. i can not use ruler to measure its mm size? Is there any way.
6 Comments
Image Analyst
on 28 Mar 2020
Amit, you need to use the 'XData', and 'YData' inputs to imshow() and then call impixelinfo().
Devyani Sankhe
on 29 Jan 2021
@Image Analyst can you please write a code to evaluate this distance? I am new user at Matlab
See Also
Categories
Find more on Convert Image Type 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!