Disable "Warning: The ROIPosition property was modified by the device."

10 views (last 30 days)
I'm recording a custom region of interest, which does not change. However, every time I run my script Matlab displays this notification:
Warning: The ROIPosition property was modified by the device.
How can I turn this warning off?
Thanks

Accepted Answer

David Tarkowski
David Tarkowski on 18 Mar 2013
Although Image Acquisition Toolbox will allow you to specify arbitrary values for the ROIPosition property (within the allowed range of values), not all devices will accept all values. Commonly, devices will require the size or offset values to be multiples of four or eight. There are two ways to deal with this warning:
  1. After the warning is displayed, the ROIPosition property has been updated to an allowed value. If you set the property to this value, you should no longer see the warning.
  2. The warning function in MATLAB will allow you to suppress individual warnings. Depending on the hardware that you are using, the identifier for the message that you are receiving changes, so I can't give you the exact command, but after you receive the warning, you can use the lastwarn function to determine the identifier:
set(vid, 'ROIPosition', newROIvalue);
[~, ident] = lastwarn
You can then add the following line to your script (before you try to set the ROIPosition property):
warning('off', 'value of the ident variable from above');

More Answers (0)

Community Treasure Hunt

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

Start Hunting!