Contour Tracing & Line Following
No License
Contour Tracing of a Black White Image (Binary Image).
Save this file in the MATLAB/Work folder and on the MATLAB Command Prompt type "help contour_trace"
Assuming Foreground to be in Black and Background to be in White, this function traces the entire contour and requires row and column value of any pixel which lies on the contour and returns the (row,column) values of all the points which lie on the contour.
This can be used in Line Following Algorithms also.
Syntax :
[pixel,I]=contour_trace(BW,r,c)
Input :
r,c - row, column value of a single pixel on the contour.
BW - Black & White Image (Binary Image).
Output :
I - Binary Image containing just the desired contour.
pixel - N x 2 matrix which stores the pixel value of the contour, column1 gives the rows & column2 the corresponding column.
Cite As
Anoop Sadani (2024). Contour Tracing & Line Following (https://www.mathworks.com/matlabcentral/fileexchange/4497-contour-tracing-line-following), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Test and Measurement > Image Acquisition Toolbox > Image Data Acquisition >
- Image Processing and Computer Vision > Image Acquisition Toolbox > Image Data Acquisition >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |