compare_coef ( : : RealCoef1, ImaginaryCoef1, RealCoef2, ImaginaryCoef2, MaxCoef, Damping : Distance )

Similarity of two contours.

The operator compare_coef calculates the Euclidean distance between two contours which are available as Fourier coefficients. In order to avoid that the higher frequencies are in some way too dominant, the following attenuation can be used:

  none           No attenuation.
  1/index        Absolute amounts of the Fourier coefficients will be
                 divided by their index.
  1/index*index] Absolute amounts of the Fourier coefficients will be
                 divided by their square index.
The higher the result value, the greater the differences between the pattern and the test contour. If the number of coefficients is not the same, only the first n coefficients will be compared. The parameter MaxCoef indicates the number of the coefficients to be compared. If MaxCoef is set to zero, all coefficients will be used.


Parameters

RealCoef1 (input_control)
real-array -> real
Real parts of the pattern Fourier coefficients.

ImaginaryCoef1 (input_control)
real-array -> real
Imaginary parts of the pattern Fourier coefficients.

RealCoef2 (input_control)
real-array -> real
Real parts of the Fourier coefficients to be compared.

ImaginaryCoef2 (input_control)
real-array -> real
Imaginary parts of the Fourier coefficients to be compared.

MaxCoef (input_control)
integer -> integer
Total number of Fourier coefficients.
Default value: 50
Suggested values: 0, 5, 10, 15, 20, 30, 40, 50, 70, 100, 200, 400
Restriction: MaxCoef >= 0

Damping (input_control)
string -> string
Kind of attenuation.
Default value: ''1/index''
Suggested values: 'none', ''1/index'', ''1/index*index''

Distance (output_control)
real -> real
Similarity of the contours.


Example
create_param_cont(trow,tcol,"unsigned_area",¶m_scale);
fourier_1dim(trow,tcol,param_scale,50,&frow,&fcol);
invariances(frow,fcol,1,"affine_invar",&invrow,&invcol);
absolute_invariant(invrow,invcol,1,2,"az_invar1",&absrow,&abscol);
compare_coef(contur1_row, contur1_col, contur2_row, contur2_col, 50,
             "1/index", &Distance_wert); 

Possible Predecessors

invariances



Copyright © 1996-1997 MVTec Software GmbH