We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › How to measure distance from screen to person
Page Index Toggle Pages: 1
How to measure distance from screen to person? (Read 2332 times)
How to measure distance from screen to person?
Oct 24th, 2006, 4:05pm
 
Hi all,
I'm in the early stages of developing a Processing-driven audiovisual installation that will feature an interactive projection on a screen.

One of the technical "details" I have to solve is how to measure/track the distance between the user and the projection. I don't know if this can be effectively done using a zenital video camera, or if there are better techniques recommended for doing that.

Thanks a lot for any input regarding this.

Best regards,
Nico.
Re: How to measure distance from screen to person?
Reply #1 - Oct 24th, 2006, 8:04pm
 
I'd use an arduino board and an ultrasonic rangefinder sensor.    Http://arduino.cc

in the US: http://sparkfun.com, and specifically the rangefinder that I've used and got to work was here:
http://www.sparkfun.com/commerce/product_info.php?products_id=639
Re: How to measure distance from screen to person?
Reply #2 - Oct 24th, 2006, 9:29pm
 
Thanks steve!
That sounds interesting, but i'd prefer trying to solve it with as little extra hardware as possible. I'm not in the US, so i don't know how hard could it be to get an arduino processor or the ultrasonic rangefinder. Not to mention my budget at the moment is as close to 0 as it can get...

You don't think this is possible to do at all with computer vision? Or maybe it cannot be done reliably?

I looked at the components you mention, they are not *that* costly, but with courier and taxes...oh my...
Re: How to measure distance from screen to person?
Reply #3 - Oct 24th, 2006, 10:22pm
 
I can think of 2 possible ways to do it with jsut a camera.

1: like you said a camera on the ceiling looking down, and using a blob-detection algorithm (and some calibration) to try to work out the distance.

2: A camera not too high up, looking slightly down, along the floor. You should be able to work out how close someonw is by finding where their feet are on the floor, and then doing a bit of trigenometry to work out what angle that is from the camera (and knowing how high the camera is etc), and so the distance.
Re: How to measure distance from screen to person?
Reply #4 - Oct 25th, 2006, 4:14pm
 
Thanks for the ideas! I just ordered my webcam (an el-cheapo logitech one) so I can start experimenting. In the meantime, i'd like to ask you a few questions that may guide me.

As i told you, i need to measure distance from the user to the screen to drive the interactivity of the system. In that respect, it should be able to:

- Detect small distance changes.
- Have enough granularity so as to create smooth responses to movement.
- React in real time.

Do you think that can be achieved using a webcam as the "distance sensor"? Will the processing of the video take the machine down? How difficult do you think it is to implement this?
Re: How to measure distance from screen to person?
Reply #5 - Nov 14th, 2006, 4:02pm
 
stevecooley wrote on Oct 24th, 2006, 8:04pm:
I'd use an arduino board and an ultrasonic rangefinder sensor.    Http://arduino.cc

in the US: http://sparkfun.com, and specifically the rangefinder that I've used and got to work was here:
http://www.sparkfun.com/commerce/product_info.php?products_id=639


Hey Steve, I sent you a PM the other day...
Re: How to measure distance from screen to person?
Reply #6 - Oct 19th, 2007, 11:32am
 
nickdatz wrote on Oct 25th, 2006, 4:14pm:

Should be able to:

1. Detect small distance changes.
2. Have enough granularity so as to create smooth responses to movement.
3. React in real time.


All of these points sounds like challenges when using a web cam as a measuring device.

1) This will probably be the biggest challenge. Cheap web cams are low res and feature poor quality cmos/ccd chips that has a lot of noise. So i think it will be hard to detect small distance changes, but it might be possible.

2) I guess you could do apply som smoothing etc to get good movement, but noise is a problem with web cams, and might add movement thats not actually there.

3) More or less real-time shouldn't be a problem i think. With some decent code i am sure it should be possible to at least get 15-30 fps, depending on the web cam maybe.


Ultrasonic sensor would be a very nice way to do this i think. Gives you fairly accurate, less error-prone readings and shouldn't set you back too much. I guess it can be a bit more scary to handle external hardware like that though, if you are not used to "interface" with external hardware Smiley
Page Index Toggle Pages: 1