simultaneous pan/tilt with MPTZ cameras

4 views (last 30 days)
James Ball
James Ball on 23 Mar 2017
Hi there, I'm fairly new to using the image acquisition toolbox. Using a motorized pan-tilt-zoom camera I would like to be able to set multiple properties simultaneously to create smooth diagonal motion. This motion is possible using this camera by quickly changing two sliders in a program such as AMCap, however using imaqtool one slider overrides the other. Also when scripted only the last command in the sequence fully executes even though both properties have changed.
The code below causes the camera to twitch on the tilt axis, then pan to -170 (because of the pause), next it twitches the tilt axis again and pans back to 170. When queried at this stage, the camera will return 90 even though it is still in -30 position. Is it possible to change two properties simultaneously or at-least preserve one change while implementing another?
vid = videoinput('winvideo',2,'YUY2_1920x1080');
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
preview(vid);
for i = 0:10
set(src,'Tilt',-30);
set(src,'Pan',-170);
get(src,'Tilt') % Shows -30
pause(7);
set(src,'Tilt',90);
set(src,'Pan',170);
get(src,'Tilt') % shows 90 but is really still -30
pause(7);
end
Thanks!

Answers (0)

Community Treasure Hunt

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

Start Hunting!