-2

我想建立一个计算人眼瞳距的应用程序当我用谷歌搜索时,我找到了一种使用信用卡或借记卡的磁条来计算距离的方法。
现在假设我有一个持有信用卡的人的图像,如何计算卡磁条的长度和图像中瞳孔之间的距离
任何形式的帮助都会起作用
提前谢谢

4

1 回答 1

1

This method would be useful if you know the distance between the pupils of a person in pixels, and you're trying to convert it to a physical unit like inches or mm. A credit card is 85.60 × 53.98 mm. The magnetic strip is 85.60 mm. So, if you see that the length of the strip is 43 px for example, you'd be able to calculate the scale as:

85.60 mm / 43 px = 1.99 mm/px

Then, if you saw that the distance between the pupils was 22 px, you could multiply that with the ratio to find the physical distance:

22 px * 1.99 mm/px = 43.8 mm

You can use the same method to figure out the distance using any other reference of a known length. For example, if you saw a tree that you knew was 12 feet high, you could use the same sort of calculation to figure out the height of something else in the picture.

One thing to remember is the angle the photo was taken at might change the proportions. If you're looking at something from a far distance or if you're using two distances that are parallel to the plane of the camera, you're fine. If you're looking at things that are angled relative to the camera's lens, the distances won't be quite proportional, due to perspective. For example, in this picture of a house taken at an angle, it looks a lot taller on one end than the other. Small angles won't change your calculation too much.

All of this assumes that you have a distance for the edge of the credit card or a distance between the two eyes in pixels first. That gets into image recognition, and unfortunately, I can't help you there. Once you have those distances in pixels, you can use this calculation to get distances in physical units.

于 2014-06-18T19:34:19.003 回答