Main Content

edge3

Find edges in 3-D intensity volume

Description

BW= edge3(V,'approxcanny',阈值)returns the edges found in the intensity or a binary volumeVusing the approximate Canny method. The approximate Canny method finds edges by looking for local maxima of the gradient ofV.edge3calculates 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.

example

BW= edge3(V,'approxcanny',阈值,sigma)returns the edges found in the intensity or binary volumeV, wheresigmaspecifies the standard deviation of the Gaussian smoothing filter.edge3chooses the size of the filter automatically, based onsigma.

BW= edge3(V,'Sobel',阈值)accepts an intensity or a binary volumeV和returns a binary volumeBWwith1s where the function finds edges inV0s elsewhere.

The Sobel method finds edges using the Sobel approximation to the derivative. It returns edges at those points where the gradient ofVis maximum.edge3ignores all edges that are not stronger than阈值.

BW= edge3(V,'Sobel',阈值,'nothinning')speeds up the operation of the algorithm by skipping the additional edge-thinning stage. By default, or when'thinning'is specified,edge3适用边缘变薄。

Examples

collapse all

Load volumetric data and remove any singleton dimensions.

loadmriV = squeeze(D);

View the volume usingvolshow..

volshow.(V);

Detect edges in the volume usingedge3with the approximate Canny method.

BW = edge3(V,'近似扫描',0.6);

View the detected edges usingvolshow..

volshow.(BW);

Input Arguments

collapse all

Input volume, specified as a 3-D numeric array.

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|logical

Sensitivity threshold, specified as one of the following.

Method Threshold value
Canny Numeric scalar
Approximate Canny 2-element numeric row vector. The first element is the low threshold, and the second element is the high threshold,[LowThresh Highthresh]
Numeric scalar representing the high threshold.edge3sets the low threshold as0.4*thresh.
Sobel

Numeric scalar

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|logical

高斯过滤器的标准偏差,指定为各向同性卷的数字标量或表格的1×3数字矢量[SigmaX SigmaY SigmaZ]for anisotropic volumes that have different scales in each direction.

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|logical

Output Arguments

collapse all

Detected edges, returned as a 3-D numeric array of the same size asV. Pixel values of1indicate edges and pixel values of0indicate flat regions.

See Also

Introduced in R2017b