please any help to CHANGE THIS CODE to acquire one gray image per 3 minute

hi i have this code that take video and many frame
all what i want is to take one gray image and one frame only avery 3 minute
imaqreset;
obj = videoinput('winvideo',1,'YUY2_640x480');
% triggerconfig(obj,'manual');
set(obj,'FramesPerTrigger',Inf);
set(obj,'ReturnedColorspace','RGB');
obj.FrameGrabInterval = 1;
framesneed = 1;
start(obj);
while(obj.FramesAcquired<=framesneed)
RGB2=getsnapshot(obj);
imshow(RGB2);
pause(3);
end
stop(obj);
delete(obj);

回答 (2 件)

Mahdi
Mahdi 2013 年 4 月 3 日

0 投票

Change the pause line to pause(180). It reads it in seconds.

4 件のコメント

mangood UK
mangood UK 2013 年 4 月 3 日
thank you
what about the number of frame i need only one frame ??
and for gray???
Walter Roberson
Walter Roberson 2013 年 4 月 3 日
FramesPerTrigger 1
ReturnedColorspace grayscale
Mahdi
Mahdi 2013 年 4 月 3 日
Thanks Walter, I must be tired. I didn't notice the other questions.
mangood UK
mangood UK 2013 年 4 月 3 日
thank you both
i will keep thread open for more problem if happen
rgards

サインインしてコメントする。

mangood UK
mangood UK 2013 年 4 月 3 日

0 投票

thier is aproblem
my webcam have high resolution as i think
but in matlab say maximum resolution is only 640*480
how to solve this
can any suggestion
regards

2 件のコメント

Please show us the output of
devinfo = imaqhwinfo('winvideo', 1);
devinfo.SupportedFormats
mangood UK
mangood UK 2013 年 4 月 6 日
hi walter
sorry for delay
this is the output of your code
Columns 1 through 2
'YUY2_160x120' 'YUY2_320x240'
Column 3
'YUY2_640x480'

サインインしてコメントする。

製品

質問済み:

2013 年 4 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by