PREWITT_ED_CVIP

prewitt_ed_cvip() -perform prewitt edge detection.

Contents

SYNTAX

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

Input Parameters include :

output Parameters include :

DESCRIPTION

This function applies the Prewitt operator with the given kernel_size to the input_image. Prewitt is similar to Sobel , but with different mask coefficients. 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 = 3;

% Calling function

 [edge_mag, edge_dir] = prewitt_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 Edge Magnitude Image');

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

CREDITS

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