<< Chapter < Page Chapter >> Page >
This module will describe the use of the “Edge Detection” Simulink® Block, to generate real-time DSP code for image and video processing.

Introduction

This chapter will describe the use of the “Edge Detection” Simulink® Block, both for stills images and video files.

The edge detection block

The "Edge Detection" block from the "Analysis&Enhancement" group of the Video and Image Processing Blockset (Please refer to Figure 1).

The Edge Detection Block

This block will enable you to simulate the edge detection procedure in the input image using the Sobel, Prewitt, Roberts, or Canny methods.

If the selected method is Sobel, Prewitt, or Roberts, the Edge Detection block finds the edges in an input image by approximating the gradient magnitude of the image. The block convolves the input matrix with the Sobel, Prewitt, or Roberts kernel. The block output can be either the result of this convolution operation (two gradient components of the image) or a binary image, obtained by comparing the convolution result against a threshold. If a pixel value is ‘1’, in this binary image it is an edge. Please refer to Figure 2

The Edge Detection Block Configuration Window for Sobel, Prewitt and Roberts Methods

If the selected method is Canny, the Edge Detection block finds edges by looking for the local maxima of the gradient of the input image. It calculates the gradient using the derivative of the Gaussian filter. The Canny method uses two thresholds to detect strong and weak edges. Please refer to Figure 3.

The Edge Detection Block Configuration Window for the Canny Method

Image (stills) processing

Simulation

  1. Open the “ stills_R_W.mdl ” Simulink model (generated in the " A Framework for Image Processing with the DSK6416 " module).
  2. Add the "Edge Detection" block from the "Analysis&Enhancement" group of the Video and Image Processing Blockset (Please refer to section ).
  3. Connect the various blocks as shown in Figure 4. Save your model.
    The Edge Detection Simulation Model for Stills
  4. Running this gives you the images shown in Figure 5.

    Input picture

    The processed picture

    Edge Detection - Simulation Results

You may repeat the simulation here to experiment the various algorithms with different thresholds.

Real-time

  1. Open the “ stills_R_W.mdl ” Simulink model (generated in the " A Framework for Image Processing with the DSK6416 " module).
  2. Add the "Edge Detection" block from from the "Analysis&Enhancement" group of the Video and Image Processing Blockset, as it was done for the simulation.
  3. Connect the various blocks as shown in Figure 6. Save the model (EdgeDetectionPictureDSK6416.mdl).
    The Edge Detection Real Time Implementation Model
  4. Generate code&create project. Double-click the " Generate code&.." block.
  5. Build the project. Double-click the “Build Project” block.
  6. Load the project. Double-click the “Load Project” block.
  7. Run the target. Double-click the “Run” block.
  8. Run the file “ “EdgeDetectionPicturescript.m” ”, this should give you the images in figure 7.

    The original color picture

    The original grayscale picture

    The received image(after edge detection)

    Edge Detection on the DSK6416

Video processing

Simulation

  1. Open the model “video_sim.mdl” model
  2. Add the "Edge Detection" block from from the "Analysis&Enhancement" group of the Video and Image Processing Blockset
  3. Add a second Video Viewer and connect the various blocks as shown in Figure 8. Save your model (EdgeDetectionVideoDSK6416.mdl).
    The Edge Detection Simulation Model for Video
  4. Run the model. A single frame of the input and output video is shown in Figure 9.

    Input video

    Processed video

    Edge Detection on Video

You may repeat the simulation here to experiment the various algorithms with different thresholds.

Real-time

  1. Connect the camera and the display to the board and open the “ Video_R_W.mdl ” (placed in the “ A Framework for Video Processing with the DM6437 DVDP ” module.).
    The Edge Detection Real Time Implementation Model
  2. Change the name of the “Video Processing” block to “Edge Detection” (Please refer to Figure 10). A new window will be opened
  3. Add the "Edge Detection" block from the "Analysis&Enhancement" group of the Video and Image Processing Blockset, as it was done for the simulation.
  4. Add the "Image Data Type Conversion" block from the " Conversion" group of the Video and Image Processing Blockset.
  5. Set the model in the Simulation->Configuration Parameters, as shown in Figure 11.
  6. Generate code&create project. Double-click the " Generate code&.." block
  7. Build the project. Double-click the “Build Project” block.
  8. Load the project. Double-click the “Load Project” block.
  9. Run the target. Double-click the “Run” block. The results will be diaplyed in the screen as shown in Figure 12.
    Configuration Parameters for CCS
    Edge Detection on Real-time Video

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask