2-D cross-correlation of two input matrices
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).
|Code Generation Support|
|Supports MATLAB® Function block: Yes|
|System Objects in MATLAB Code Generation.|
|Code Generation Support, Usage Notes, and Limitations.|
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.
Set this property to true to normalize the output. If you set this property to true, the object divides the output by , where is the portion of the input matrix, that aligns with the input matrix, . This property must be set to false for fixed-point inputs. The default is false.
|clone||Create 2-D cross correlator object with same property values|
|getNumInputs||Number of expected inputs to step method|
|getNumOutputs||Number of outputs from step method|
|isLocked||Locked status for input attributes and nontunable properties|
|release||Allow property value and input characteristics changes|
|step||Compute 2-D correlation of input matrices|
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);
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.