Apply djkstra algorithm to trace contour
Version 1.1.0.0 (35.4 KB) by
Su Dongcai
trace single object's contour via the classic shortest path algorithm
please run the follows commands to duplicate the
screenshot:
mex vcTraceContour.cpp %complie only onece
im = imread('h.gif'); [x, y] = traceContour(~im);
Note:
a. The core cpp routine which implement the shortest path routing is in 'cShortestPath', which with computational complexity of O(N*log(N)), where N is the perimeter of the object.
b. the input image must contains only one object(white area.)
Cite As
Su Dongcai (2026). Apply djkstra algorithm to trace contour (https://www.mathworks.com/matlabcentral/fileexchange/34708-apply-djkstra-algorithm-to-trace-contour), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R14
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Graph and Network Algorithms in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
