This action might not be possible to undo. Are you sure you want to continue?
Machine Vision and Smart Sensor for Intelligent Lab. University of Klagenfurt. Email: Alireza.Fasih@uni‐klu.ac.at
What Is Video and Image Processing Blockset? Video and Image Processing Blockset is a tool used for the rapid design, prototyping, graphical simulation, and efficient code generation of video processing algorithms. Video and Image Processing Blockset blocks can import streaming video into the Simulink environment and perform two‐dimensional filtering, geometric and frequency transforms, block processing, motion estimation, edge detection and other signal processing algorithms. You can also use the blockset in conjunction with Real‐Time Workshop® to automatically generate embeddable C code for real‐time execution.Video and Image Processing Blockset blocks support floating‐point, integer, and fixed‐point data types. To use any data type other than double‐precision and single‐precision floating point, you must install Simulink Fixed Point.
you have three separate RGB signal.Sample 1: Loading and Displaying an Image Create a new project on simulink program. After this step. you must double click on the component. open video and image processing blockset tab. To change parameters value. Load New Image If you want to access a RGB layer. This blockset can load papers.png file by default. in image signal combobox select “Separate Color Signal” item. and drag “Image From File” blockset to the page. 2 .
and system can detect it automatically. And press F5 to see the result. Drag a “Video Display” component on the page. Next step is wiring these two components. similar process to the previous step. It means that you can connect any kind of multi dimensional signal to this component. By default Input signal in this component is multi dimensional signal. If you need three separate RGB signal. 3 . Connects the component same as below image. Method for displaying an image or video signals is easy as loading image. go to properties and change the Image signal to Separated Color Signal.
Such as RGB.Sample 2: Color Conversion using Blockset– RGB to Gray Level For converting RGB Color space to Gray level scale. Result: Gray Scale Image Sample 3: Implementing RGB to Gray Scale by basic components We have a simple equation for color conversion from RGB to gray scale: (Gray Scale Value) Luminance value = 0.11 B For implementing this equation we need three multipliers and two adders. 4 .59 G + 0. HSV. Intensity. etc. we need a color conversion component.3 R + 0. By this component we can convert the color information between 9 different color spaces.
Result: Gray Scale Image 5 . Change the parameters: Output data type in all component must change to (uchar 8) unsigned char 8bit.
production‐quality C code for embedded applications. This block works with a subset of the MATLAB language called the Embedded MATLAB subset. 6 . Sample 4: Embedding Matlab Code in Simulink An Embedded MATLAB Function block lets you compose a MATLAB function in Simulink like the following example: This capability is useful for coding algorithms that are better stated in the textual language of MATLAB than in the graphical language of Simulink. which provides optimizations for generating efficient.
Double Click on it and Change the Code 7 . according to the RGB to Gray Scale equation. and double click on it. Change the function content. the component schematic IO. After this step. It will open a new Matlab Code Editor. First of all. if you close the editor page. drag and drop “Embedded Matlab Function” on the page. will change according to the function input and output parameters.
Homework‐1: Design a project in Simulink for loading and displaying an image. Assign zero for those pixels value which are greater than 127. 8 . 2007 Help and Mathworks Company Web site. The scale is between 0 and 255. Only Display pixels value smaller than 127 and filter the rest. after that embed a Matlab Code for Image Thresholding. Result must be similar to this Image. Reference: Matlab Rev. Hint: Don’t forget to change the data type parameters to uchar‐8.