Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted

1 solution

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)
 
Share this answer
 
Comments
Member 10450635 9-Dec-14 3:07am    
Oh:( I actually wanted the latter option as I was planning it to be a works out of the box solution. I might have to go for calibration after all. Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900