Image Acquisition Toolbox: Obtaining Camera Property Constraint Values

I'm currently attempting to obtain the available range of values for a number of camera settings using the Image Acquisition Toolbox, using multiple cameras that require either Mathlab's 'dcam' or 'gige' adaptor. In the case of the dcam, this is no problem, as I simply do the following:
vid = ('dcam',1,'someFormat');
src = getselectedsource(vid);
info = propinfo(src);
limits = info.someProperty.ConstraintValue;
The ConstraintValue field for each property gives me all the information I need. Now for the problem: in the case of the 'gige' adaptor, the ConstraintValue fields return as empty. However, it seems that this constraint info must exist somewhere, as if I try to set properties to values that are apparently outside their bounds using imaqtool, I get a message like the following:
Warning: The value of AcquisitionFrameRateAbs should be between 0.014552 and 5.084944.
So is there some way [other than propinfo()] to find this information using the Image Acquisition Toolbox ?

댓글 수: 2

Evan
Evan 2012년 9월 26일
편집: Evan 2012년 9월 26일
Note that "AcquisitionFrameRateAbs" was probably a bad example, as another property lists the value bounds for the Framerate. Other properties, however, do not have this information stored in another field, so this solution wouldn't work for any other setting.
Finally, one workaround that I could think of would be to set each property to a value that is always "wrong," then parse the warning message by calling lastwarn. Manageable, but certainly messy and will complicate code considerably. If at all possible, I'd like to avoid this.

댓글을 달려면 로그인하십시오.

 채택된 답변

Evan
Evan 2012년 9월 27일
Just for the sake of having a "temporary" answer for this question, below is described the workaround I settled on for this issue:
if strcmp(info.Constraint,'none') %If propinfo() doesn't return information
set(src,'someProperty',-1e010) %Set property to "out-of-bounds" value
limits = regexp(lastwarn,'(\d+(\.\d+)?)','match'); %Parse warn for limits
else
limits = info.someProperty.ConstraintValue;
end

추가 답변 (0개)

질문:

2012년 9월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by