Find edges in 3-D grayscale volume
returns the edges found in the grayscale or binary volume
BW = edge3(
using the approximate Canny method. The approximate Canny method finds edges by
looking for local maxima of the gradient of
edge3 calculates the gradient using the derivative of a
Gaussian smoothed volume.
The approximate Canny method uses two thresholds to detect strong and weak edges, and includes the weak edges in the output only if they are connected to strong edges. This method is more likely than the Sobel method to detect true weak edges.
The Sobel method finds edges using the Sobel approximation to the derivative. It
returns edges at those points where the gradient of
edge3 ignores all edges that are not stronger than
Find Edges of MRI Volume using Approximate Canny Method
Load volumetric data and remove any singleton dimensions.
load mri V = squeeze(D);
Visualize original image.
Detect edges in the volume.
BW = edge3(V,'approxcanny',0.6);
Visualize the detected edges. You can also view the result using the Volume Viewer app.
V — Input volume
3-D numeric array
Input volume, specified as a 3-D numeric array.
thresh — Sensitivity threshold
numeric scalar | 2-element numeric row vector
Sensitivity threshold, specified as one of the following.
|Approximate Canny||2-element numeric row vector. The first element is the
low threshold, and the second element is the high threshold,
|Numeric scalar representing the high threshold.
sigma — Standard deviation of Gaussian filter
sqrt(2) | numeric scalar | 1-by-3 numeric vector
Standard deviation of the Gaussian filter, specified as a numeric scalar
for isotropic volumes or a 1-by-3 numeric vector of the form
[SigmaX SigmaY SigmaZ] for anisotropic volumes that
have different scales in each direction.
Run code in the background using MATLAB®
backgroundPool or accelerate code with Parallel Computing Toolbox™
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Version HistoryIntroduced in R2017b
R2022b: Support for thread-based environments
edge3 now supports thread-based