Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

vision.Crosscorrelator System object

Package: vision

2-D cross-correlation of two input matrices

Description

The Crosscorrelator object computes 2-D cross-correlation of two input matrices.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

H = vision.Crosscorrelator returns a System object, H, that performs two-dimensional cross-correlation between two inputs.

H = vision.Crosscorrelator(Name,Value) returns a 2-D cross correlation System 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).

Properties

OutputSize

Specify dimensions of output

This property controls the size of the output scalar, vector, or matrix produced as a result of the cross-correlation between the two inputs. This property can be set to one of Full, Same as first input, Valid. If this property is set to Full, the output is the full two-dimensional cross-correlation with dimensions (Ma+Mb-1, Na+Nb-1). if this property is set to same as first input, the output is the central part of the cross-correlation with the same dimensions as the first input. if this property is set to valid, the output is only those parts of the cross-correlation that are computed without the zero-padded edges of any input. this output has dimensions (Ma-Mb+1, Na-Nb+1). (Ma, Na) is the size of the first input matrix and (Mb, Nb) is the size of the second input matrix. The default is Full.

Normalize

Normalize output

Set this property to true to normalize the output. If you set this property to true, the object divides the output by (I1pI1p)×(I2I2), where I1p is the portion of the input matrix, I1that aligns with the input matrix, I2. This property must be set to false for fixed-point inputs. The default is false.

 Fixed-Point Properties

Methods

stepCompute 2-D correlation of input matrices
Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

Compute the 2-D correlation of two matrices.

 hcorr2d = vision.Crosscorrelator;
 x1 = [1 2;2 1];
 x2 = [1 -1;-1 1];
 y = step(hcorr2d,x1,x2);

Algorithms

This object implements the algorithm, inputs, and outputs described on the 2-D Correlation block reference page. The object properties correspond to the block parameters.

Extended Capabilities

Introduced in R2012a

Was this topic helpful?