You are here : matlabImage Processingimgradient3

imgradient3() - Image Processing

= imgradient3(I) returns the gradient
magnitude, Gmag, gradient direction, Gazimuth,
and gradient elevation Gelevation for the grayscale
or binary 3-D image I.[Gmag,Gazimuth,Gelevation]
= imgradient3(I,method) calculates
the gradient magnitude and direction using the specified method.[Gmag,Gazimuth,Gelevation]
= imgradient3(Gx,Gy,Gz) calculates
the gradient magnitude and direction from the directional gradients
along the X-axis, Gx, Y-axis, Gy and Z-axis, Gz. Code Generation support:
Yes.MATLAB Function Block support:


= imgradient3(I) example[Gmag,Gazimuth,Gelevation]
= imgradient3(I,method)[Gmag,Gazimuth,Gelevation]
= imgradient3(Gx,Gy,Gz)


Compute 3-D Gradient Magnitude and Direction Using Sobel MethodOpen This Example
Read 3-D data into the workspace and prepare it for processing.volData = load('mri');
sz = volData.siz;
vol = squeeze(volData.D);
Calculate the gradients.[Gmag, Gaz, Gelev] = imgradient3(vol);
Visualize the gradient magnitude as a montage.figure,
title('Gradient magnitude')

Output / Return Value


Alternatives / See Also