主要内容

Vision.localmaximafinder

Find local maxima in matrices

Description

To find local maxima in matrices.

  1. Create theVision.localmaximafinderobject and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, seeWhat Are System Objects?

Creation

Description

example

lmaxfinder= vision.LocalMaximaFinderreturns a local maxima finder System object,H,这在输入矩阵中找到了本地最大值。

lmaxfinder= vision.LocalMaximaFinder(maxnum,neighborsize)returns a local maxima finder object with theMaximumNumLocalMaximaproperty set tomaxnum,邻里property set toneighborsize, and other specified properties set to the specified values.

lmaxfinder= vision.LocalMaximaFinder(Name,Value)sets properties using one or more name-value pairs. Enclose each property name in quotes. For example,lmaxfinder= vision.LocalMaximaFinder('ThresholdSource','Property')

Properties

expand all

Unless otherwise indicated, properties arenontunable,这意味着您在调用对象后不能更改其值。呼叫时锁定对象,然后release功能解锁它们。

If a property istunable, you can change its value at any time.

For more information on changing property values, seeSystem Design in MATLAB Using System Objects

最大最大数量可以找到,指定为正标性整数。

零元值的邻域大小, specified as a two-element vector

Source of threshold, specified as'Property'或者'Input port'

所有最大值应匹配或超过的值,指定为MATLAB的标量®内置数字数据类型。当您设置该属性时,此属性将适用ThresholdSourceproperty to'Property'

可调:Yes

Indicator of Hough transform matrix input, specified as真的或者false。该块适用于其他处理,特定于输入矩阵的右侧和左边界的Hough变换。将此属性设置为真的if the input is antisymmetric about the rho axis and the theta value ranges from π 2 to π 2 radians, which correspond to a Hough matrix.

数据类型的索引值, specified asdouble,single,uint8,UINT16, oruint32

用法

Description

example

idx= lmaxfinder(I)returns [xy] coordinates of the local maxima in anM-by-2 matrix,idxM表示发现的局部最大值的数量。最大值Mmay not exceed the value set in theMaximumNumLocalMaximaproperty.

idx= lmaxfinder(I,临界点)finds the local maxima in the input imageI,使用阈值值临界点, when you set theThresholdSourceproperty to'Input port'

Input Arguments

expand all

Video frame, specified as grayscale or truecolor (RGB).

所有最大值应匹配或超过的值,指定为MATLAB的标量内置数字数据类型。

Output Arguments

expand all

Local maxima, returned as anM-by-2 matrix of one-based [xy]坐标,哪里M表示发现的局部最大值的数量。

Object Functions

要使用对象函数,请将System Object™指定为第一个输入参数。例如,释放名称的系统对象的系统资源obj,使用此语法:

release(obj)

expand all

initialize Initialize video frame and points to track
step RunSystem objectalgorithm
release Release resources and allow changes toSystem objectproperty values and input characteristics
reset 重置内部状态System object

Examples

collapse all

Create an example input.

I = [0 0 0 0 0 0 0 0 0 0 0 0;。。。0 0 0 1 1 2 3 2 1 1 0 0;。。。0 0 0 1 2 3 4 3 2 1 0 0;。。。0 0 0 1 3 5 7 5 3 1 0 0;。。。0 0 0 1 2 3 4 3 2 1 0 0;。。。0 0 0 1 1 2 3 2 1 1 0 0;。。。0 0 0 0 0 0 0 0 0 0 0 0 0];

Create a local maxima finder object.

hLocalMax = vision.LocalMaximaFinder('Maximummummlocalmaxima',1,。。。'NeighborhoodSize',[3,3],。。。'Threshold',1);

Find local maxima.

位置= hlocalmax(i)
位置=1x2 uint32 row vector7 4

Extended Capabilities

已经rsion History

在R2012B中引入