Documentation

visboundaries

情节区域边界

Syntax

visboundaries(BW)
visboundaries(B)
visboundaries(AX,___)
obj = visboundaries(___)
H = visboundaries(___,Name,Value)

Description

example

visboundaries(BW)draws boundaries of regions in the binary imageBW上the current axes.BWis a 2D binary image where pixels that are logical真的属于前景区域和逻辑的像素falseconstitute the background.visboundaries用途Bwboundariesto find the boundary pixel locations in the image.

example

visboundaries(B)draws region boundaries specified byB, whereBis a cell array containing the boundary pixel locations of the regions, similar in structure to the first output fromBwboundaries. Each cell contains aQ-by-2 matrix, whereQ是啊f boundary pixels for the corresponding region. Each row of theseQ-by-2 matrices contains the row and column coordinates of a boundary pixel.

visboundaries(AX,___)draws region boundaries on the axes specified byAX.

obj= visboundaries(___)返回边界的HGGROUP对象。hggroup对象,obj, is the child of the axes object,AX.

example

H= visboundaries(___,Name,Value)passes the name-value pair arguments to specify additional properties of the boundaries. Parameter names can be abbreviated.

Examples

collapse all

阅读图像。

bw = imread('blobs.png');

Compute boundaries.

B = bwboundaries(BW);

Display image and plot boundaries on image.

imshow(BW)保持visboundaries(B)

读取图像并显示。

I = imread('toyobjects.png');imshow(i)保持

使用active contours (snakes) algorithm. First, specify the initial contour location close to the object that is to be segmented.

mask = false(size(I)); mask(50:150,40:170) = true;

Display the initial contour on the original image in blue.

visboundaries(面具,'颜色','b');

使用'edge'方法使用200次迭代。

bw = activeContour(i,mask,200,'edge');

Display the final contour on the original image in red.

visboundaries(bw,'颜色','r');标题('蓝色 - 初始轮廓,红色 - 最终轮廓');

Input Arguments

collapse all

Binary image, specified as a logical array.

Data Types:logical

边界像素位置, specified as a cell array ofQ-2包含行和列坐标的by-2矩阵,其中Q是啊f boundary pixels for the corresponding region.

Data Types:cell

Image on which to draw boundaries, specified as an axes object.

Data Types:double

Name-Value Pair Arguments

Specify optional comma-separated pairs ofName,Value参数。Nameis the argument name and价值是相应的值。Name必须出现在单引号中(' '). You can specify several name and value pair arguments in any order asNAME1,Value1,...,Namen,Valuen.

Example:visboundaries(bw,'Color','r');

collapse all

边界的颜色,指定为Matlab Colorspec。

Example:visboundaries(bw,'Color','r');

边界线的样式,指定为MATLAB线规范。

Example:visboundaries(bw,'LineStyle','-.');

Width of the line used for the boundary, specified as a numeric value. Specify this value in points, where one point = 1/72 inch.

Example:visboundaries(BW,“线宽”,4);

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

Augment the drawn boundary with contrasting features to improve visibility on a varying background, specified as the logical flag真的或者false.

Example:visboundaries(BW,“增强性可视性”,true);

Data Types:logical

Output Arguments

collapse all

边界线,指定为HGGROUP对象。hggroup对象是轴对象的孩子,AX.

在R2015a中引入

这个话题有帮助吗?