magicwand
Given an image and a pixel cooridinate, this function isolates all neighboring pixels with values within a preset tolerance. This function mimics the behavior of Adobe's Photoshop magic wand tool.
Y=magicwand(X, m, n);
Y=output image of type uint8(logical)
X=input image of type double
m=pixel cooridinate(row)
n=pixel cooridinate(col)
Y=magicwand(X, m, n, Tol);
Tol=Tolerance value for locating pixel neighbors(default=0.01)
Y=magicwand(X, m, n, Tol, eight_or_four);
eight_or_four=string such that if =='eigh', magicwand locates all eight-neighborhood pixels (default=four-neighborhood)
Cite As
Daniel Lau (2024). magicwand (https://www.mathworks.com/matlabcentral/fileexchange/130-magicwand), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Image Processing Toolbox > Image Filtering and Enhancement > Neighborhood and Block Processing >
Tags
Acknowledgements
Inspired: Magicwand Corrected for v6.5, Simulating Photoshop's magic wand tool
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 |