IntensityGradDir

Compute the 3x3 intensity gradient direction. Gradients range from 1 to 8.

 

function call:

[out_img1]=vsg('IntensGradDir',in_img1);

 

Arguments:

in_img1 input image, 3 channel RGB, 1 channel greyscale or binary image, or DICOM image.

 

Description:

out_img1 - An image which has dimensions the same as the input image. The output image displays the direction of the gradient of the image according to these values:

1 2 3

4 – 5

6 7 8

 

Example:

img = openimage('lake.jpg');

h=figure;image(img); set(h,'Name','Input');

[out_img1]=vsg('IntensGradDir',img);

h=figure;imagesc(out_img1(:,:,1));colormap(gray);set(h,'Name','Intensity Gradient Direction');

Notes:

For DICOM and RGB images, the function operates on each channel/slice separately.

Home       Functions       Back