IMAQ: Getting the ranges of the Device Specific Properties

1 回表示 (過去 30 日間)
Sid
Sid 2015 年 10 月 14 日
回答済み: Sid 2015 年 10 月 14 日
Hi everyone,
The question pertains to the Image Acquisition Toolbox. I'm interested in building a programmatic GUI, where I can have some sliders to control the basic settings like Contrast, Brightness, etc. For a script, what I have so far is the following:
clc; clear all; close all;
imaqreset;
% Setting up a couple of integers for device ID, and the resolution setting to use.
deviceIDToUse = 2;
resolutionList_IDX = 1;
dev_info = imaqhwinfo('winvideo',deviceIDToUse);
resolutionList = dev_info.SupportedFormats;
% Choose the main device ID to use.
vid = videoinput(...
'winvideo', deviceIDToUse,...
resolutionList{resolutionList_IDX});
src = getselectedsource(vid);
% Is there a way to get the 'ranges (e.g.: 0 - 255 for Brightness)' of the Device Specific Properties?
get(src)
One thing I cannot figure out is how I can get the ranges of the Device Specific Properties. I can access the values clicking the videosource variable in the workspace.
Would anyone have an idea on how I can access the ranges programmatically?
Thanks in advance.
Cheers

採用された回答

Sid
Sid 2015 年 10 月 14 日
Actually, I think I figured it out. What you need is propinfo (documentation here .)
For example, from the above code, if you want to take the Brightness values (and maybe set up a slider to control it,) what you need is propinfo(src,'Brightness').
Hope this helps someone else in case you are interested in doing programmatic GUIs.

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by