MATLAB Routine for AVI to RGB conversion -
avi2rgb.m
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).
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
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.
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.
Connect the various blocks as shown in Figure 6. Save the model (EdgeDetectionPictureDSK6416.mdl).
Generate code&create project. Double-click the " Generate code&.." block.
Build the project. Double-click the “Build Project” block.
Load the project. Double-click the “Load Project” block.
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?