Changes

Jump to navigation Jump to search

Image acquisition package

545 bytes added, 05:32, 18 January 2014
formated example session
Lines starting with $ are commands executed on the octave prompt.
Let's load === Load the package and list available hardware===
<code>
$ pkg load image-acquisition
$ imaqhwinfo
ans =
scalar structure containing the fields:
driver = uvcvideo
card = UVC Camera (046d:0825)
capabilities = 83886081
device = /dev/video0
</code>$ === Open the v4l2 device and output the result === $ obj = videoinput("v4l2", "/dev/video0") obj = videoinput for v4l2
device = /dev/video0
driver = uvcvideo
VideoResolution = 320 x 240 px
VideoFrameInterval = 1/30 s (30.0 fps)
 === Query which properties are available for the used device ===The first 6 ones starting with an upper letter are fixed, the other specific to the used v4l2 device. $ get(obj) ans = {
[1,1] = SelectedSourceName
[2,1] = DeviceCapabilities
[17,1] = exposure_absolute
[18,1] = exposure_auto_priority
}$ $ get(obj, "DeviceCapabilities")ans =
=== Get device capabilities ===
$ get(obj, "DeviceCapabilities")
ans =
scalar structure containing the fields:
driver = uvcvideo
card = UVC Camera (046d:0825)
capabilities = 83886081
$ === List available video resolutions === $ set(obj, "VideoResolution") ans =
640 480
160 120
1280 960
=== Set the video resolution to 320x240px ===  $ set(obj, "VideoResolution", [320 240])$ === Get the current brightness value === $ get(obj, "brightness") ans = 100$ set(obj, "brightness")ans =
=== Query possible range for brightness ===
$ set(obj, "brightness")
ans =
scalar structure containing the fields:
min = 0
max = 255
default = 128
=== Set a new value for brightness === $ set(obj, "brightness", 100) $  === Start preview ===Close it with CTRL+C or with [X] on the preview window $ preview(obj)
== Using v4l2loopback for tests ==
217

edits

Navigation menu