Documentation

vision.Maximum System object

Package: vision

Find maximum values in input or sequence of inputs

Description

The Maximum object finds maximum values in an input or sequence of inputs.

Construction

H = vision.Maximum returns an object, H, that computes the value and index of the maximum elements in an input or a sequence of inputs.

H = vision.Maximum(Name,Value) returns a maximum-finding object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1, Value1,...,NameN,ValueN).

Code Generation Support
Supports MATLAB® Function block: Yes
System Objects in MATLAB Code Generation.
Code Generation Support, Usage Notes, and Limitations.

Properties

ValueOutputPort

Output maximum value

Set this property to true to output the maximum value of the input. This property applies when you set the RunningMaximum property to false.

Default:true.

RunningMaximum

Calculate over single input or multiple inputs

When you set this property to true, the object computes the maximum value over a sequence of inputs. When you set this property to false, the object computes the maximum value over the current input.

Default: false.

IndexOutputPort

Output the index of the maximum value

Set this property to true to output the index of the maximum value of the input. This property applies only when you set the RunningMaximum property to false.

Default:true.

ResetInputPort

Additional input to enable resetting of running maximum

Set this property to true to enable resetting of the running maximum. When you set this property to true, a reset input must be specified to the step method to reset the running maximum. This property applies only when you set the RunningMaximum property to true.

Default: false.

ResetCondition

Condition that triggers resetting of running maximum

Specify the event that resets the running maximum as Rising edge, Falling edge, Either edge, or Non-zero. This property applies only when you set the ResetInputPort property to true.

Default: Non-zero.

IndexBase

Numbering base for index of maximum value

Specify the numbering used when computing the index of the maximum value as starting from either One or Zero. This property applies only when you set the IndexOutputPort property to true.

Default: One.

Dimension

Dimension to operate along

Specify how the maximum calculation is performed over the data as All, Row, Column, or Custom. This property applies only when you set the RunningMaximum property to false.

Default: Column.

CustomDimension

Numerical dimension to calculate over

Specify the integer dimension of the input signal over which the object finds the maximum. The value of this property cannot exceed the number of dimensions in the input signal. This property only applies when you set the Dimension property to Custom.

Default: 1.

ROIProcessing

Enable region-of-interest processing

Set this property to true to enable calculation of the maximum value within a particular region of an image. This property applies when you set the Dimension property to All and the RunningMaximum property to false.

Default:false.

ROIForm

Type of region of interest

Specify the type of region of interest as Rectangles, Lines, Label matrix, or Binary mask. This property applies only when you set the ROIProcessing property to true.

Default: Rectangles.

ROIPortion

Calculate over entire ROI or just perimeter

Specify whether to calculate the maximum over the Entire ROI or the ROI perimeter. This property applies only when you set the ROIForm property to Rectangles.

Default: Entire ROI.

ROIStatistics

Calculate statistics for each ROI or one for all ROIs

Specify whether to calculate Individual statistics for each ROI or a Single statistic for all ROIs. This property applies only when you set the ROIForm property to Rectangles, Lines, or Label matrix.

ValidityOutputPort

Output flag indicating if any part of ROI is outside input image

Set this property to true to return the validity of the specified ROI as completely or partially inside of the image. This applies when you set the ROIForm property to Lines or Rectangles.

Set this property to true to return the validity of the specified label numbers. This applies when you set the ROIForm property to Label matrix.

Default: false.

 Fixed-Point Properties

Methods

cloneCreate maximum object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
release Allow property value and input characteristics changes
resetReset computation of running maximum
stepCompute maximum value

Examples

Determine the maximum value and its index in a grayscale image.

 img = im2single(rgb2gray(imread('peppers.png')));
 hmax = vision.Maximum;
 [m, ind] = step(hmax, img);

Algorithms

This object implements the algorithm, inputs, and outputs described on the 2-D Maximum block reference page.

Was this topic helpful?