使用网络摄像头测量物体尺寸 [英] Measuring object size using webcam

查看:741
本文介绍了使用网络摄像头测量物体尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用网络摄像头计算两点之间的距离。现在抓住的是我不需要它与cm或其他任何实际测量相关。我想要的是使用不同分辨率的不同网络摄像头,它们都应该提供相同的测量。我会解释一下。



假设我正在使用640x480的网络摄像头观看方形,并将其视为一个单元。然后我使用1024x768的网络摄像头从相同的位置查看相同的对象,它仍然应该测量为1个单位。我该怎么办?

I need to calculate distance between two points using a webcam. Now the catch is I don't need it to be any way related to actual measurements in cm or whatever. What I want is to use different webcams of different resolutions and they should all give the same measurement. I'll explain.

Suppose I am viewing a square shape using a webcam of 640x480 and it measures as one unit. I then view the same object from the same positions using a webcam of 1024x768 and it should still measure as 1 unit. How do I do this?

推荐答案

你是说你有一个你决定描述为一个单元的物体,然后用它来校准每个相机?

如果是这样,很简单!以像素为单位测量形状 - 对于该相机,该像素数= 1个单位。

从那时起,您知道在网络摄像头a,X像素= 1个单位,在网络摄像头b,Y像素= 1单位。



如果没有,那么我认为这是不可能的 - 你必须校准,以便每个摄像机知道1个单位是什么。 (例如,一个可能有一个广角镜头,一个是变焦镜头 - 它不仅仅是分辨率有所不同)
Are you saying that you would have an object which you decide to describe as being one unit, then use it to calibrate each camera?
If so, easy! Measure the shape in pixels - and for that camera, that number of pixels = 1 unit.
From then on, you know that on webcam a, X pixels = 1 unit, and on webcam b, Y pixels = 1 unit.

If not, then I think it is impossible - you must calibrate in order that each camera knows what 1 unit is. (one may have a wide angle lens, one a zoom, for example - it's not just the resolution that makes a difference)


这篇关于使用网络摄像头测量物体尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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