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) |