IMP  2.2.0
The Integrative Modeling Platform
FFToperations.h
Go to the documentation of this file.
1 /*!
2  * \file IMP/em2d/FFToperations.h
3  * \brief Operations involving FFT
4  * Copyright 2007-2014 IMP Inventors. All rights reserved.
5 */
6 
7 #ifndef IMPEM2D_FF_TOPERATIONS_H
8 #define IMPEM2D_FF_TOPERATIONS_H
9 
10 #include "IMP/em2d/em2d_config.h"
12 
13 IMPEM2D_BEGIN_NAMESPACE
14 
15 /**
16  * Transforms a matrix as is given by FFT functions, into a image
17  * interpretation. Works the opposite way too.
18  * @param m The matrix to flip. The it is changed in situ
19  */
20 IMPEM2DEXPORT void do_matrix_to_image_flip(cv::Mat &m);
21 
22 //! Autocorrelation without preprocessing
23 /*!
24  \param[in] M matrix containing the dft
25  \param[out] corr the matrix to store the autocorrelation. Must have the
26  proper dimensions when passed
27 */
28 /**
29  * Autocorrelation without preprocessing.
30  * @param M matrix containing the dft
31  * @param corr The matrix to store the autocorrelation. Must have the
32  * proper dimensions when passed.
33  */
34 IMPEM2DEXPORT void get_autocorrelation2d_no_preprocessing(const cv::Mat &M,
35  cv::Mat &corr);
36 
37 /**
38  * Computes the autocorrelation matrix
39  * @param m The input matrix
40  * @param corr The result matrix containing the autocorrelation
41  */
42 IMPEM2DEXPORT void get_autocorrelation2d(const cv::Mat &m, cv::Mat &corr);
43 
44 //! Correlation matrix between two 2D matrices using FFT
45 /*!
46  \param[in] A first matrix
47  \param[in] B second matrix
48  \param[out] corr matrix of results
49 */
50 IMPEM2DEXPORT void get_correlation2d(const cv::Mat &A, const cv::Mat &B,
51  cv::Mat &corr);
52 
53 //! Correlation without preprocessing
54 //! Returns the correlation matrix between two 2D matrices using FFT
55 /*!
56  \param[in] M1 matrix containing the dft of the first matrix
57  \param[in] M2 matrix containing the dft of the second matrix
58  \param[out] corr matrix of results (It MUST have the right size in advance)
59 */
60 IMPEM2DEXPORT void get_correlation2d_no_preprocessing(const cv::Mat &M1,
61  const cv::Mat &M2,
62  cv::Mat &corr);
63 
64 /**
65  * Get the FFT of a matrix using padding with other matrix that can be
66  * computed with FFT in an optimal way. i.e. with a size that makes the
67  * FFT algorithm work faster
68  * @param m The input matrix
69  * @param M The output matrix with the FFT
70  * @note The output matrix can have (and frequently will have) different
71  * dimensions than the input matrix
72  */
73 IMPEM2DEXPORT void get_fft_using_optimal_size(const cv::Mat &m, cv::Mat &M);
74 
75 /**
76  * Computes the fft of a matrix and returns the real and imaginary matrices
77  * @param m The input matrix
78  * @param real The matrix with the real part of the FFT matrix
79  * @param imag The imaginary part of the FFT matrix
80  */
81 IMPEM2DEXPORT void get_spectrum(const cv::Mat &m, cv::Mat &real, cv::Mat &imag);
82 
83 IMPEM2D_END_NAMESPACE
84 
85 #endif /* IMPEM2D_FF_TOPERATIONS_H */
void get_autocorrelation2d_no_preprocessing(const cv::Mat &M, cv::Mat &corr)
Autocorrelation without preprocessing.
void get_correlation2d(const cv::Mat &A, const cv::Mat &B, cv::Mat &corr)
Correlation matrix between two 2D matrices using FFT.
void get_autocorrelation2d(const cv::Mat &m, cv::Mat &corr)
inteface with OpenCV Copyright 2007-2014 IMP Inventors. All rights reserved.
void get_fft_using_optimal_size(const cv::Mat &m, cv::Mat &M)
void do_matrix_to_image_flip(cv::Mat &m)
void get_correlation2d_no_preprocessing(const cv::Mat &M1, const cv::Mat &M2, cv::Mat &corr)
void get_spectrum(const cv::Mat &m, cv::Mat &real, cv::Mat &imag)