Pixels to inch conversion

16 次查看(过去 30 天)
Hello everyone, I need to convert the number of pixels into inches(cm)...I know the calculation but if the image is taken as a photograph, based on the camera distance number of pixels are varied...Then what is the relationship between number of pixels and camera focal length...Thanks in advace ...

采纳的回答

Image Analyst
Image Analyst 2014-3-17
See my spatial calibration demo, attached. It lets you specify some known distance in the image and then make measurements based off of that.

更多回答(2 个)

Walter Roberson
Walter Roberson 2014-3-17
Unknown. You need at least two pieces of information to determine this. For example the lens aperture together with the focal length.
Usually the easiest way to proceed is to calibrate the camera at any reasonable distance: take a picture of an object of known length, count the pixels occupied in the image, convert to a pixels per inch (or pixels per mm) ratio; that together with the focal length is enough to calibrate for all distances, using standard trigonometry (e.g., twice the focal length would render the same sized object as half as many pixels)

Amit Nambiar
Amit Nambiar 2014-3-17
Hi harjan, Walter suggested a good thing. I wanted to do the same thing in my assignment. It is not a good idea to find out the pixels/inch factor by knowing the camera's cmos sensor dimensions or aperture and all. It introduces lot of errors while measurement. I wanted reasonable accuracy. So what I did is i placed a 4 cms square scale(you can take anything as per your convenience) near the object whose image is taken. I separated the scale's region in image using rgb values and found out the pixel counts of each side and then measured my objects dimensions. I got 95% accuracy by this method!

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for IP Cameras 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by