计算图像的像素长度 [英] Calculating pixel length of an image

查看:352
本文介绍了计算图像的像素长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以知道以厘米为单位计算1像素长度的方法是什么?我的图像是640x480。我想比较图像上不同位置的2个像素,找出距离的差异。因此,我需要找出以厘米为单位的像素长度。
谢谢。

May I know what are the ways to calculate the length of 1 pixel in centimeters? The images that I have are 640x480. I would like to compare 2 pixels at different places on the image and find the difference in distance. Thus I would need to find out what's the length of the pixel in centimeters. Thank you.

推荐答案

像素是一个相对的度量单位,它没有绝对大小。

A pixel is a relative unit of measure, it does not have an absolute size.

修改。关于编辑:再次,您只能计算图像中两个像素之间的距离(以像素为单位),而不是以厘米为单位。作为一个简单的例子,想想视频投影仪:如果你将3×3px图像投影到墙上,最左边和最右边像素之间的距离可以是几毫米到几米之间的距离。如果您将投影机移近墙壁或更远离墙壁,则像素尺寸会发生变化,无论您之前计算的距离如何都会出错。

Edit. With regard to your edit: again, you can only calculate the distance between two pixels in an image in pixels, not in centimeters. As a simple example, think video projectors: if you project, say, a 3×3px image onto a wall, the distance between the leftmost and the rightmost pixels could be anything from a few millimeters to several meters. If you moved the projector closer to the wall or farther away from it, the pixel size would change, and whatever distance you had calculated earlier would become wrong.

计算机显示器和其他设备也是如此(正如JohannesRössel在他的回答中所解释的那样)。在那里,以厘米为单位的像素大小取决于诸如屏幕的物理分辨率,图形界面的分辨率以及图像显示的缩放系数等因素。

Same goes for computer monitors and other devices (as Johannes Rössel has explained in his answer). There, the pixel size in centimeters depends on factors such as the physical resolution of the screen, the resolution of the graphical interface, and the zooming factor at which the image is displayed.

根据定义,像素没有固定的物理尺寸。它只是图片的最小可寻址单位,无论大小,都是如此。

A pixel does not have a fixed physical size, by definition. It is simply the smallest addressable unit of picture, however large or small.

这篇关于计算图像的像素长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆