Pixels to inch conversion
10 次查看(过去 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 ...
0 个评论
采纳的回答
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.
0 个评论
更多回答(2 个)
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)
0 个评论
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!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!