This module describes general procedures for reading and writing stills images with the DSK6416. The scripts and models created her will serve as the framework for image processing algorithms simulation and implementation.
Introduction
This module describes general procedures for reading and writing stills images. The scripts and models created in this chapter will be the basis for image processing algorithms simulation and implementation using the DSK6416.
This section will show you how to activate CCS under the Simulink.
Create a new Simulink model.
Open the Simulink library browser and add the "C6416DSK" from the "Target Preferences" group of the "Embedded Target for the TI TMS320C6000 DSP" Blockset (Please refer to Figure 1).
The C6416DSK Block
Set the model to “Generate a CCS Project” in the Simulation->Configuration Parameters ->Build Action, as shown in the following picture:
Configuration Parameters for CCS
We now need to create Simulink dedicated blocks to execute CCS commands. The first is the “Build”. We can do this in many ways: clicking Build icon, pressing Ctrl-B or in MATLAB® typing make_rtw. Given this command is available in MATLAB, we will create a custom block with this command.
Give it a name. In our example we use “Generate Code&Create Project”
Choose the shadow, colour etc…
Right click on the Subsystem, choose “ Block Properties”. Go to the Callbacks tab, and under OpenFcn enter: “make_rtw;”, as shown in the following picture:
Creating the “Generate Code&Create Project” Simulink block
Repeat this process for the following commands as follows:
Your model should look as follows:
Simulink Blocks for CCS commands
Image (stills) i/o
Simulation
Figure 5 shows the data flow for the edge detection simulation. The Edge detection model reads the source picture from a file in the PC, and displays both the original and the processed images.
Simulation Environment
Reading and displaying a picture
Start by creating a new model in Simulink
Open the Simulink library browser and add the "Image from File" from the "Sources" group of the Video and Image Processing Blockset (Please refer to Figure 6). This block reads an image and converts it to the RGB format in Simulink .
The "ImageFrom File" Simulink Block
Double Click and select the
TMW2.jpg image (Please refer to Figure 7).
The Source Block Configuration
In order to display the picture the "Video Viewer" from the "Sinks" group of the Video and Image Processing Blockset (Please refer to Figure 8). This block displays an input RGB or intensity video stream or image. The edge detection block operates on intensity images.
The Video Viewer Block
Select the "intensity" input format as shown in Figure 9.
Video Viewer Configuration
The conversion from RGB to intensity will be executed in the Color Space Conversion: from the "Conversions" group of the Video and Image Processing Blockset (Please refer to Figure 10).
The Color Conversion Block
Double Click and select the "R'G'B' to intensity" conversion scheme as shown in Figure 11.
Configuring the Color Conversion Scheme
Connect the three blocks as shown in Figure 12.
Reading and Displaying a Picture
Run the model, you should get the image shown in Figure 13
The Video Viewer Display
Receive real-time job alerts and never miss the right job again
Source:
OpenStax, From matlab and simulink to real-time with ti dsp's. OpenStax CNX. Jun 08, 2009 Download for free at http://cnx.org/content/col10713/1.1
Google Play and the Google Play logo are trademarks of Google Inc.
Notification Switch
Would you like to follow the 'From matlab and simulink to real-time with ti dsp's' conversation and receive update notifications?