<< DilateImage IPD - Image Processing Design DrawBoundingBoxes >>

IPD - Image Processing Design >> IPD - Image Processing Design > DistanceTransform

DistanceTransform

calculates the distance transform of an edge image

Calling Sequence

DistanceImage = DistanceTransform(EdgeImage);

Parameters

EdgeImage

2D matrix of type boolean

DistanceImage

2D matrix of type uint8, has the same size as EdgeImage

Description

This function calculates the distance transform of an edge image.

Examples

global IPD_PATH;

RGB = ReadImage(IPD_PATH + 'demos\teaset.png');

Image = RGB2Gray(RGB);

global EDGE_SOBEL;

Gradient = EdgeFilter(Image, EDGE_SOBEL);

EdgeImage = ~SegmentByThreshold(Gradient, 60);

DistanceImage = DistanceTransform(EdgeImage);

figure(); ShowImage(DistanceImage, 'Result of Distance Transform', jetcolormap(256));

See Also

<< DilateImage IPD - Image Processing Design DrawBoundingBoxes >>