obtener grafica de un video
Publicado por fernando (3 intervenciones) el 07/03/2013 00:57:27
Buenas tardes el problema que tengo es, que quiero inciar la camara pero que en un figure me de la grafica del video en tiempo real, he encontrado muy poco de esto y solo tengo este codigo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
vid = videoinput('winvideo',2,'RGB24_640x480');
% only capture one frame per trigger, we are not recording a video
vid.FramesPerTrigger = 2;
% output would image in RGB color space
vid.ReturnedColorspace = 'rgb';
% tell matlab to start the webcam on user request, not automatically
triggerconfig(vid, 'manual');
% we need this to know the image height and width
vidRes = get(vid, 'VideoResolution');
% image width
imWidth = vidRes(1);
% image height
imHeight = vidRes(2);
% number of bands of our image (should be 3 because it's RGB)
nBands = get(vid, 'NumberOfBands');
% create an empty image container and show it on axPreview
%hImage = image(zeros(imHeight, imWidth, nBands), 'parent');
% begin the webcam axPreview
preview(vid);
obj = GetData(vid,1,'unit8');
values=mean(obj(:));
plot(values)
Valora esta pregunta


0