Products & Services Solutions Academia Support User Community Company

Learn more about Video and Image Processing Blockset   

2-D Standard Deviation (Obsolete) - Find standard deviation of each input matrix

Library

Statistics

Description

The 2-D Standard Deviation block computes the standard deviation of each M-by-N input matrix or of a sequence of inputs over time. Use the Running standard deviation check box to select between the block's basic and running operation. This block's functionality is different from the Signal Processing Blockset Standard Deviation block, which computes the standard deviation of each column in the input.

PortInput/OutputSupported Data TypesComplex Values Supported

Input / I

Vector or matrix of intensity values

  • Double-precision floating point

  • Single-precision floating point

Yes

Rst

Signal that triggers a reset event

  • Double-precision floating point

  • Single-precision floating point

  • Boolean

  • 8-, 16-, and 32-bit signed integer

  • 8-, 16-, and 32-bit unsigned integer

No

ROI

  • Rectangle — [r c height width]

  • Lines — [r1 c1 r2 c2], where r1 and c1 are the row and column coordinates of the beginning of the line and r2 and c2 are the row and column coordinates of the end of the line.

  • Binary mask — Binary image matrix that enables you to specify which pixels to highlight.

Rectangles and lines —

  • Double-precision floating point

  • Single-precision floating point

  • Boolean

  • 8-, 16-, and 32-bit signed integer

  • 8-, 16-, and 32-bit unsigned integer

Binary mask —

  • Boolean

No

Label

Matrix where pixels equal to 0 represent the background, pixels equal to 1 represent the first object, pixels equal to 2 represent the second object, and so on.

  • 8-, 16-, and 32-bit unsigned integer

No

Label Numbers

Vector containing the label numbers for the regions for which the block will compute the statistics.

  • 8-, 16-, and 32-bit unsigned integer

No

Output / Out

Without ROI processing — Standard deviation of each M-by-N input matrix, or the standard deviation of a sequence of M-by-N inputs.

With ROI processing — Vector of separate statistical values for each ROI or a scalar value that represents the statistical value for all specified ROIs.

Same as Input port

Yes

Flag

Boolean value that indicates whether the ROI is within the image bounds or the label number is within the label matrix.

Boolean

No

Length-M 1-D vector inputs are treated as M-by-1 column vectors.

Basic Operation

If you clear the Running standard deviation check box, the block outputs the standard deviation of each M-by-N input matrix.

For purely real or purely imaginary inputs, the standard deviation is the square root of the variance and is given by the following equation:

where µ is the mean of the input matrix u. For complex inputs, the block outputs the total standard deviation of the input matrix, which is the square root of the total variance.

The total standard deviation is not equal to the sum of the real and imaginary standard deviations.

Running Operation

If you select the Running standard deviation check box, the block computes the standard deviation of a sequence of M-by-N inputs.

For example, suppose A is the first input to the block and B is the second and current input to the block, where

and

The block computes the standard deviation as

and outputs

For the next input, the block computes the standard deviation for each element of the first three inputs, and so on.

Resetting the Running Standard Deviation

The block resets the running standard deviation whenever a reset event is detected at the optional Rst port. The reset signal rate must be a positive integer multiple of the rate of the data signal input.

You specify the reset event using the Reset port parameter:

ROI Processing

To calculate the statistical value within a particular region of each image, select the Enable ROI processing check box. This option is not available when the block is in running mode.

Use the ROI type parameter to specify whether the ROI is a rectangle, line, label matrix, or binary mask. A binary mask is a binary image that enables you to specify which pixels to highlight, or select. In a label matrix, pixels equal to 0 represent the background, pixels equal to 1 represent the first object, pixels equal to 2 represent the second object, and so on. When the ROI type parameter is set to Label matrix, the Label and Label Numbers ports appear on the block. Use the Label Numbers port to specify the objects in the label matrix for which the block calculates statistics. The input to this port must be a vector of scalar values that correspond to the labeled regions in the label matrix. For more information about the format of the input to the ROI port when the ROI is a rectangle or a line, see the Draw Shapes block reference page.

For rectangular ROIs, use the ROI portion to process parameter to specify whether to calculate the statistical value for the entire ROI or just the ROI perimeter.

Use the Output parameter to specify the block output. The block can output separate statistical values for each ROI or the statistical value for all specified ROIs. This parameter is not available if, for the ROI type parameter, you select Binary mask.

If, for the ROI type parameter you select Rectangles or Lines, the Output flag indicating if ROI is within image bounds check box appears in the dialog box. If you select this check box, the Flag port appears on the block. The following tables describe the Flag port output based on the block parameters.

Output = Individual statistics for each ROI

Flag Port OutputDescription
0ROI is completely outside the input image.
1ROI is completely or partially inside the input image.

Output = Single statistic for all ROIs

Flag Port OutputDescription
0All ROIs are completely outside the input image.
1At least one ROI is completely or partially inside the input image.

If the ROI is partially outside the image, the block only computes the statistical values for the portion of the ROI that is within the image.

If, for the ROI type parameter you select Label matrix, the Output flag indicating if input label numbers are valid check box appears in the dialog box. If you select this check box, the Flag port appears on the block. The following tables describe the Flag port output based on the block parameters.

Output = Individual statistics for each ROI

Flag Port OutputDescription
0Label number is not in the label matrix.
1Label number is in the label matrix.

Output = Single statistic for all ROIs

Flag Port OutputDescription
0None of the label numbers are in the label matrix.
1At least one of the label numbers is in the label matrix.

Dialog Box

The 2-D Standard Deviation dialog box appears as shown in the following figure.

Running standard deviation

Select this check box to enable the block's running operation.

Reset port

Determines the reset event that causes the block to reset the running standard deviation. The reset signal rate must be a positive integer multiple of the rate of the data signal input. This parameter is available if you select the Running standard deviation check box.

Enable ROI processing

Select this check box to calculate the statistical value within a particular region of each image. This parameter is not available when the block is in running mode.

ROI type

Specify the type of ROI to use. Your choices are Rectangles, Lines, Label matrix, or Binary mask.

ROI portion to process

Specify whether you want to calculate the statistical value for the entire ROI or just the ROI perimeter. This parameter is only visible if, for the ROI type parameter, you specify Rectangles.

Output

Specify the block output. The block can output a vector of separate statistical values for each ROI or a scalar value that represents the statistical value for all the specified ROIs. This parameter is not available if, for the ROI type parameter, you select Binary mask.

Output flag indicating if ROI is within image bounds

If you select this check box, the Flag port appears on the block. For a description of the Flag port output, see the tables in ROI Processing. This parameter is visible if, for the ROI type parameter, you select Rectangles or Lines.

Output flag indicating if label numbers are valid

If you select this check box, the Flag port appears on the block. For a description of the Flag port output, see the tables in ROI Processing. This parameter is visible if, for the ROI type parameter, you select Label matrix.

See Also

2-D Autocorrelation

Video and Image Processing Blockset software

2-D Correlation

Video and Image Processing Blockset software

Histogram

Video and Image Processing Blockset software

Mean

Video and Image Processing Blockset software

Median

Video and Image Processing Blockset software

Variance

Video and Image Processing Blockset software

Maximum

Signal Processing Blockset software

Minimum

Signal Processing Blockset software

Standard Deviation

Signal Processing Blockset software

std

MATLAB software

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS