DOC PREVIEW
MSU ECE 480 - Grayscale Conversion

This preview shows page 1-2-19-20 out of 20 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 20 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 20 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 20 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 20 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 20 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ECE 480 Team 3 Grayscale Conversion of a Color Image Using Simulink and Xilinx Blocks An Application Note Emmett Kuhn 11/19/2010Grayscale Conversion of a Color Image Using Simulink and Xilinx Blocks 2010 ECE 480 Team 3 | Executive Summary 2 Table of Contents Executive Summary ....................................................................................................................................... 3 Introduction .................................................................................................................................................. 3 Keywords ................................................................................................................................................... 3 Implementation ............................................................................................................................................ 4 Getting Started .......................................................................................................................................... 4 Setting Up Simulink Input Blocks .............................................................................................................. 4 Creating the Subsystem ............................................................................................................................ 9 Setting up the Output Blocks .................................................................................................................. 12 Running the Model ................................................................................................................................. 14 References .................................................................................................................................................. 16 Appendix A - sysgenColorConverter_imageData.mat ................................................................................ 17 Appendix B – sysgenColorConverter_PreLoadFcn.m .................................................................................. 18 Appendix C – sysgenColorConverter_StopFcn.m ....................................................................................... 19Grayscale Conversion of a Color Image Using Simulink and Xilinx Blocks 2010 ECE 480 Team 3 | Executive Summary 3 Executive Summary This guide will take an image and through Matlab and Simulink programming blocks, convert the image from color to grayscale. It does this using Matlab programming to format the input, Simulink and Xilinx Programming blocks for the algorithm, and finally Matlab programming for the output. Introduction This Application Note is a guide to convert a single color image into grayscale using Xilinx ISE Design Suite 12 and Matlab/Simulink 7.10 (R2010a). It does this via Simulink and Xilinx programming blocks for the mathematical algorithm of grayscale. Converting a color image to grayscale can have many different advanced applications. Often it is the first step to multiple image processing actions to an image, sometimes even in full video. This guide is the software side of use in an embedded FPGA for such applications. Keywords SLB – Simulink Library Browser FPGA – Field-Programmable Gate Array ISE – Integrated Software Environment RGB – Red, Green, Blue – A stream of data indicating the levels of Red, Green, and Blue in an imageGrayscale Conversion of a Color Image Using Simulink and Xilinx Blocks 2010 ECE 480 Team 3 | Implementation 4 Implementation Getting Started Three files must be saved to the intended directory for a successful grayscale conversion using Simulink and Xilinx blocks. Save the files “sysgenColorConverter_imageData.mat”, “sysgenColorConverter_PreLoadFcn.m” and “sysgenColorConverter_StopFcn.m” into the specified workspace folder. These files are in Appendix A, Appendix B, and Appendix C. The former inherits the source image from sysgenColorConverter_imageData.mat and then allows that input to be made into Simulink blocks. The latter allows the output to be graphed into Matlab. Setting Up Simulink Input Blocks First, start Matlab. In the Matlab Command Window, type “Simulink”Grayscale Conversion of a Color Image Using Simulink and Xilinx Blocks 2010 ECE 480 Team 3 | Implementation 5 A window should pop up. This is the Simulink Library Browser (SLB). To use Simulink and Xilinx Blocks, drag them into the model from the SLB. In the Simulink Library Browser which opens, click File -> New -> Model First Simulink blocks must be created to inherit the Matlab output of the source file. This will be done by separating the output into separate RGB signals that are very important to grayscaling. Grayscaling works by adding weighted components of the Red, Green, and Blue signals of an image into a single desired linear luminance value. In the SLB, browse to Simulink -> Sources on the left hand pane. Drag the “From Workspace” block into the model. Double click the model and set the following Parameters: Data: redSignal Sample time: 1 Uncheck Interpolate data Uncheck Enable zero-crossing detectionGrayscale Conversion of a Color Image Using Simulink and Xilinx Blocks 2010 ECE 480 Team 3 | Implementation 6 Form output after final data value by: Setting to zero Click “OK” Repeat this process for two additional “From Workspace” blocks named “greenSignal” and “blueSignal” but otherwise have the same parameters as redSignal. Model so far:Grayscale Conversion of a Color Image Using Simulink and Xilinx Blocks 2010 ECE 480 Team 3 | Implementation 7 This would be a good time to save the model. Save it to the directory that the two .m files from the Appendix are saved. This is critical as the files reference each other so the files must be in the same directory. Next, go back to SLB and navigate to “Xilinx Blockset” and then “Data Types.” Then drag 3 of the yellow “Gateway In” blocks into your model. They will be used to navigate into Xilinx blocks to be implemented efficiently on the board. Now, connect the RGB outputs to the Gateway ins as shown by clicking on the Image From File, then holding control and clicking on each Gateway In. This will create an arrow from one block to the other. Apply the following settings for each gateway in by double clicking it: Output Type: Signed (2’s Comp) Number of bits: 10 Binary Point: 0 Quantization: Round Overflow: Saturate Sample Period: 1Grayscale Conversion


View Full Document

MSU ECE 480 - Grayscale Conversion

Documents in this Course
ganttv1

ganttv1

6 pages

sd97

sd97

17 pages

ap_EO

ap_EO

14 pages

Load more
Download Grayscale Conversion
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Grayscale Conversion and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Grayscale Conversion 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?