Can System Objects be used with webcam video acquisition for live video in Video and Image Processing Blockset 3.0 (R2010a)?
I would like to have a live video that is captured by a webcam as an input to my system object:
reader = video.MultimediaFileReader
This means that whatever is captured by webcam will be instantly be read by system objects for further stream processing.
% Demo code below: % ----------- %% Initialization hCamera = videoinput('winvideo',1); triggerconfig(hCamera, 'manual'); % hSingle = video.ImageDataTypeConverter; hCSC = video.ColorSpaceConverter('Conversion', 'YCbCr to RGB'); hOF = video.OpticalFlow('OutputValue', 'Horizontal and vertical components in complex form', ... 'ReferenceFrameDelay', 1); hMean1 = video.Mean; hMean2 = video.Mean('RunningMean', true); hMedianFilt = video.MedianFilter2D; hClose = video.MorphologicalClose('Neighborhood', strel('line',5,45)); hErode = video.MorphologicalErode('Neighborhood', strel('square',2)); hVideo1 = video.VideoPlayer('WindowCaption', 'Original Video'); hVideo1.WindowPosition = [50 250 350 300]; hVideo2 = video.VideoPlayer('WindowCaption', 'Results'); hVideo2.WindowPosition = [475 250 350 300]; %% i=0; start(hCamera) while i < 150 % A hack to limit the demo to 150 frames image = getsnapshot(hCamera); I = step(hSingle,image); Irgb = step(hCSC, I); of = step(hOF, I(:,:,1)); of_mag = of .* conj(of); vel_th = 0.50 * step(hMean2, step(hMean1, of_mag)); filteredout = step(hMedianFilt, of_mag >= vel_th); th_image = step(hClose, step(hErode, filteredout)); step(hVideo1, Irgb); % Display Original Video step(hVideo2, th_image); % Display Moving Objects i = i+ 1; end %% stop(hCamera); %% close('all','force');
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.