| |
Program Functions
156
vr.m
This reset script removes all variables, globals, functions and MEX links. In addition, it closes
all open and hidden figure windows. Finally, the MATLAB path is updated.
vShift.m
This function performs a non-circular shift on a given 2D matrix. Areas that were shifted into
the image from outside are set to NaN.
vShiftPhase.m
In mrFindBorders, the phase values in a phase-wedge image should ideally be within the in-
terval [ /2 3 /2]. The function vShiftPhase determines the phase shift that is needed to shift
the phases into that interval. At first, a histogram of the phase values in the matrix is calcu-
lated. The histogram is extended to both sides before the convolution with a vector of ones is
determined. This vector has a length that corresponds to the interval width [ /2 3 /2]. Finding
the maximum of the convolution leads to an estimate of the phase offset. The convolution
sum is defined as
n
l
n
l
l
u
v h
¥
-
=-¥
=
.
Equation 29: Convolution
Source: [Gray and Good-
man, 1995 #58]
Crosscorrelation is similar to convolution, but involves the complex conjugate of one signal,
and it does not reverse one signal [Gray and Goodman, 1995 #59]. Since the phase values are
not complex, and the vector of ones does not change when reversed, the convolution can be
calculated instead of the crosscorrelation here. The result is the same.
|  |
|
| |
|
|