<< 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

How we are making nano material?
LITNING Reply
what is a peer
LITNING Reply
What is meant by 'nano scale'?
LITNING Reply
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
How can I make nanorobot?
Lily
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
how can I make nanorobot?
Lily
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!





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