live image acquisition and histogram display -凯发k8网页登录
this example shows how to use simulink® blocks to display live video stream and a histogram of its rgb values side by side.
image acquisition toolbox™ provides a simulink block to acquire live image data from image acquisition devices into simulink models. this example uses the from video device block to acquire live image data from the logitech® quickcam® zoom webcam into simulink. this example uses the histogram block in dsp system toolbox™ to calculate the histograms of r, g, and b values in each video frame.
this example requires simulink, dsp system toolbox and computer vision toolbox™ to open and run the model.
. (10 seconds)
example model
the following figure shows the example model using the from video device block.
open_system('demoimaqsl_rgbhistogram_win');
close_system('demoimaqsl_rgbhistogram_win');
live video input
the input video is acquired live from a winvideo image acquisition device (logitech quickcam zoom). in this example, the block acquires rgb frames from the logitech camera and outputs them into the simulink model at every simulation time step. the data type output from the block is uint8.
histogram display results
the example displays the histograms of r, g, and b values in the rgb histogram window and displays the original rgb video in the viewer window.
even though a winvideo logitech webcam was used for this example, this model can be easily updated to connect your models to other supported image acquisition devices. this provides you the flexibility to use the same simulink model with different image acquisition hardware.
available example versions
windows® only:
platform independent:
windows-only example model contains the to video display block (supported only on windows) from computer vision toolbox and supports code generation. the platform independent version consists of video viewer block and does not support code generation.