Editing Image acquisition package
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
The {{Forge| | The {{Forge|image_acquisition}} package is part of the [[Octave Forge]] project. | ||
There is not release package yet but if you can get the source here [http://sourceforge.net/p/octave/image-acquisition/ci/default/tree/] | |||
== Example session == | == Example session == | ||
Lines starting with | Lines starting with $ are commands executed on the octave prompt. | ||
Let's load the package and list available hardware | |||
<code> | |||
$ pkg load image-acquisition | |||
$ imaqhwinfo | |||
ans = | ans = | ||
scalar structure containing the fields: | scalar structure containing the fields: | ||
driver = uvcvideo | driver = uvcvideo | ||
card = UVC Camera (046d:0825) | card = UVC Camera (046d:0825) | ||
bus_info = usb-0000:00: | bus_info = usb-0000:00:16.2-2 | ||
version = 3. | version = 3.2.51 | ||
capabilities = | capabilities = 83886081 | ||
device = /dev/video0 | device = /dev/video0 | ||
</code> | |||
$ | |||
$ obj = videoinput("v4l2", "/dev/video0") | |||
obj = videoinput for v4l2 | |||
device = /dev/video0 | |||
device | driver = uvcvideo | ||
driver | card = UVC Camera (046d:0825) | ||
card | VideoInput = 0 | ||
VideoInput | VideoResolution = 320 x 240 px | ||
VideoResolution | VideoFrameInterval = 1/30 s (30.0 fps) | ||
$ get(obj) | |||
ans = | |||
{ | |||
[1,1] = SelectedSourceName | [1,1] = SelectedSourceName | ||
[2,1] = | [2,1] = DeviceCapabilities | ||
[3,1] = | [3,1] = VideoInput | ||
[4,1] = | [4,1] = VideoResolution | ||
[5,1] = | [5,1] = VideoFrameInterval | ||
[6,1] = | [6,1] = VideoFormat | ||
[7,1] = | [7,1] = brightness | ||
[8,1] = | [8,1] = contrast | ||
[9,1] = | [9,1] = saturation | ||
[10,1] = | [10,1] = white_balance_temperature_auto | ||
[11,1] = | [11,1] = gain | ||
[12,1] = | [12,1] = power_line_frequency | ||
[13,1] = | [13,1] = white_balance_temperature | ||
[14,1] = | [14,1] = sharpness | ||
[15,1] = | [15,1] = backlight_compensation | ||
[16,1] = | [16,1] = exposure_auto | ||
[17,1] = | [17,1] = exposure_absolute | ||
[18,1] = | [18,1] = exposure_auto_priority | ||
} | |||
$ | |||
$ get(obj, "DeviceCapabilities") | |||
ans = | |||
scalar structure containing the fields: | |||
driver = uvcvideo | |||
card = UVC Camera (046d:0825) | |||
bus_info = usb-0000:00:16.2-2 | |||
version = 3.2.51 | |||
capabilities = 83886081 | |||
$ | |||
$ set(obj, "VideoResolution") | |||
ans = | |||
640 480 | 640 480 | ||
160 120 | 160 120 | ||
Line 95: | Line 90: | ||
1280 960 | 1280 960 | ||
= | $ set(obj, "VideoResolution", [320 240]) | ||
$ | |||
$ get(obj, "brightness") | |||
ans = 100 | |||
$ set(obj, "brightness") | |||
ans = | |||
scalar structure containing the fields: | |||
min = 0 | min = 0 | ||
max = 255 | max = 255 | ||
Line 116: | Line 104: | ||
default = 128 | default = 128 | ||
$ set(obj, "brightness", 100) | |||
$ | |||
$ preview(obj) | |||
== Using v4l2loopback for tests == | == Using v4l2loopback for tests == | ||
If you don't have a v4l2 device but | If you don't have a v4l2 device but test the package you could create a loopback device: | ||
modprobe v4l2loopback | modprobe v4l2loopback | ||
gst-launch-0.10 videotestsrc ! v4l2sink device=/dev/video0 | gst-launch-0.10 videotestsrc ! v4l2sink device=/dev/video0 | ||
Line 176: | Line 132: | ||
There might be some warnings like "warning: function xyz shadows a built-in function" at start. | There might be some warnings like "warning: function xyz shadows a built-in function" at start. | ||
Exit octave and add libv4l2_debug.log to your bug report | Exit octave and add libv4l2_debug.log to your bug report | ||
Consider running the included tests: | Consider running the included tests: | ||
test @videoinput/videoinput | |||
test @videoinput/get | |||
test @videoinput/set | |||
test @videoinput/getsnapshot | |||