>  Docs Center  >  Libraries  >  ASTROLIB  >  CORRMAT_ANALYZE
Libraries

CORRMAT_ANALYZE

CORRMAT_ANALYZE

Name


CORRMAT_ANALYZE

Purpose


Find the optimal (x,y) offset to maximize correlation of 2 images

Explanation


Analyzes the 2-D cross-correlation function of two images
and finds the optimal(x,y) pixel offsets.
Intended for use with function CORREL_IMAGES.

Calling Sequence


corrmat_analyze, correl_mat, xoffset_optimum, yoffset_optimum,
max_corr, edge, plateau, [XOFF_INIT=, YOFF_INIT=, REDUCTION=,
MAGNIFICATION=, PLATEAU_THRESH=, /PRINT]

Inputs


correl_mat = the cross-correlation matrix of 2 images.
(as computed by function CORREL_IMAGES( imA, imB ) ).

Note


If correl_mat(*,*,1) is the number of pixels for each correlation,
(the case when /NUMPIX was specified in call to CORREL_IMAGES)
then sqrt( sqrt( # pixels )) is used as correlation weighting factor.

Optional Input Keywords


XOFF_INIT = initial X pixel offset of image_B relative to image_A.
YOFF_INIT = Y pixel offset, (both as specified to correl_images).
REDUCTION = reduction factor used in call to CORREL_IMAGES.
MAGNIFICATION = magnification factor used in call to CORREL_IMAGES,
this allows determination of offsets up to fractions of a pixel.
PLATEAU_THRESH = threshold used for detecting plateaus in
the cross-correlation matrix near maximum, (default=0.01),
used only if MAGNIFICATION > 1
/PRINT causes the result of analysis to be printed.

Outputs


xoffset_optimum = optimal X pixel offset of image_B relative to image_A.
yoffset_optimum = optimal Y pixel offset.
max_corr = the maximal correlation corresponding to optimal offset.
edge = 1 if maximum is at edge of correlation domain, otherwise=0.
plateau = 1 if maximum is in a plateua of correlation function, else=0.

Procedure


Find point of maximum cross-correlation and calc. corresponding offsets.
If MAGNIFICATION > 1:
the correl_mat is checked for plateau near maximum, and if found,
the center of plateau is taken as point of maximum cross-correlation.

Modification History


Written, July-1991, Frank Varosi, STX @ NASA/GSFC
Use ROUND instead of NINT, June 1995 Wayne Landsman HSTX
Remove use of non-standard !DEBUG system variable W.L. HSTX
Converted to IDL V5.0 W. Landsman September 1997



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us