Webcam as a light sensor

How I can do that? I found one lib, but it’s only for linux and I need
it running on windows.

You did not even provide the name of the lib.

You also did not write what this has to do with ruby.

This is not a lot of information you give to others here man.

I found this http://rubydoc.info/gems/camcapture/0.3.0/frames
but I can’t install it. Typing “gem install rb_webcam” in RubyGems
Package Manager didn’t work.
I also found other lib which uses ONLY V4L (Video for Linux) and
FireWire cameras. I need it to work on simple USB cameras or notebook
integrated ones.

“You also did not write what this has to do with ruby.”
I just need method to check if light is on or off. Simple binary state.

I found one website controlled by flicking your light switch and I
wanted to make a game which use this feature. For example - game like
VVVVVVV where if light is on - gravity is applied to floor and if there
is dark - gravity is applied to ceiling. I’m pretty sure it can be made
easier in Flash or something, but it would be too much effort to
learning whole new language and/or graphic/sound library (I’m using ruby
with GOSU now).

I believe there are no libraries dealing with webcams in Ruby. Sucks :frowning:

When I needed to do it, I used CommandCam:
http://batchloaf.wordpress.com/commandcam/ with RMagick. This gave me
a framerate of about 2 FPS. I was going to try and make a C Ruby
extension (basing the code on CommandCam), but never got around to it.

– Matma R.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs