File Exchange

image thumbnail

Apply djkstra algorithm to trace contour

version (35.4 KB) by Su Dongcai
trace single object's contour via the classic shortest path algorithm


Updated 25 Jan 2012

View License

please run the follows commands to duplicate the

mex vcTraceContour.cpp %complie only onece
im = imread('h.gif'); [x, y] = traceContour(~im);
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 (2020). Apply djkstra algorithm to trace contour (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)


Having compilation issues on MAC OS X Lion with R2011b and Xcode 4.3.


add 'cal_disconnectPoint.m' to fix a bug, change the title which I misspell 'djkstra'

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux