Class: CameraRuby::WebCam
- Inherits:
-
Object
- Object
- CameraRuby::WebCam
- Defined in:
- lib/camera_ruby.rb
Overview
Webcamera class.
Class Method Summary collapse
-
.take_snapshot ⇒ Object
Instruct webcam to take snapshot based on configuration settings.
Class Method Details
.take_snapshot ⇒ Object
Instruct webcam to take snapshot based on configuration settings.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/camera_ruby.rb', line 10 def self.take_snapshot image_name = File.read("image_config/image_name.txt").strip image_num = File.read("image_config/image_num.txt").strip.to_i image_num = image_num + 1 system("cd images; fswebcam -d /dev/video1 -p YUYV -r 1600x1200 --jpeg 85 -D 2 -F 15 #{image_name}_#{image_num}.jpeg") open("image_config/image_num.txt", "w") { |f| f.print image_num } end |