From d77cf38896bbfdc82a91dedc4b45d31a5f79d826 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 12 Sep 2011 15:28:04 +0000 Subject: [PATCH] corrected formula formatting in phaseCorrelate docs (thanks to the author for the patch) --- .../motion_analysis_and_object_tracking.rst | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/imgproc/doc/motion_analysis_and_object_tracking.rst b/modules/imgproc/doc/motion_analysis_and_object_tracking.rst index 6aba212b81..e6b0996120 100644 --- a/modules/imgproc/doc/motion_analysis_and_object_tracking.rst +++ b/modules/imgproc/doc/motion_analysis_and_object_tracking.rst @@ -144,7 +144,7 @@ The function supports multi-channel images. Each channel is processed independen phaseCorrelate ------------------------------- -The function is used to detect translational shifts that occur between two images. The operation takes advantage of the Fourier shift theorem for detecting the translational shift in the frequency domain. It can be used for fast image registration as well as motion esitimation. For more information please see http://http://en.wikipedia.org/wiki/Phase\_correlation . +The function is used to detect translational shifts that occur between two images. The operation takes advantage of the Fourier shift theorem for detecting the translational shift in the frequency domain. It can be used for fast image registration as well as motion esitimation. For more information please see http://en.wikipedia.org/wiki/Phase\_correlation . Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed with ``getOptimalDFTSize`` . @@ -161,24 +161,28 @@ The function performs the following equations * Next it computes the forward DFTs of each source array: - ..math: + + .. math:: \mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\} where - :math:`\mathcal{F} is the forward DFT.` + :math:`\mathcal{F}` is the forward DFT. * It then computes the cross-power spectrum of each frequency domain array: - ..math: + + .. math:: R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|} * Next the cross-correlation is converted back into the time domain via the inverse DFT: - ..math: + + .. math:: r = \mathcal{F}^{-1}\{R\} * Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to achieve sub-pixel accuracy. - ..math: - (\Delta x, \Delta y) = \textrm{weighted_centroid}\{\arg \max_{(x, y)}\{r\}\} + + .. math:: + (\Delta x, \Delta y) = \texttt{weighted_centroid}\{\arg \max_{(x, y)}\{r\}\} .. seealso:: :ocv:func:`dft`, @@ -196,7 +200,8 @@ This function computes a Hanning window coefficients in two dimensions. See http :param winSize: The window size specifications :param type: Created array type -:: +An example is shown below: :: + // create hanning window of size 100x100 and type CV_32F Mat hann; createHanningWindow(hann, Size(100, 100), CV_32F);