SOBEL_ED_CVIP

sobel_ed_cvip() - performs sobel edge detection.

Contents

SYNTAX

[ edge_mag, edge_dir ] = sobel_ed_cvip( input_image, kernel_size )

Input Parameters include:

output Parameters include:

DESCRIPTION

This function applies the Sobel edge detection operator with the given kernel_size to the input_image. It approximates the gradient by using a row and a column mask, whick will approximate the first derivative in each direction. So at each pixel point we have two numbers: s1, corresponding to the result from the vertical edge mask, and s2, from the horizontal edge mask. The edge_mag and edge_dir are defined as follows

REFERENCE

1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

% Read image

  input_image = imread('butterfly.tif');

% Kernel size

  kernel_size = 7;

% Calling function

  [edge_mag, edge_dir] = sobel_ed_cvip(input_image, kernel_size);

% Display input image

  figure;imshow(input_image);title('Input Image');

% Display output image

  figure; imshow(hist_stretch_cvip(edge_mag,0,1,0,0),[]);title('Output Magnitude Image');

  figure; imshow(hist_stretch_cvip(edge_dir,0,1,0,0),[]);title('Output Phase Image');

CREDITS

Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website