dicfourier.hpp¶
Functions
-
template<typename Real>
void get_single_window_fftcc_peak(FFTImpl<Real> &fft, std::vector<double> &p, double &max_val, const double cx, const double cy, const int ss_size_x, const int ss_size_y, const int window_size_x, const int window_size_y, const Image &img_ref, const Image &img_def, const Interpolator &interp_def, const bool debug = false)¶
-
template<typename Real>
void get_single_window_fftcc_peak_centre(FFTImpl<Real> &fft, std::vector<double> &p, double &max_val, const double cx, const double cy, const double offset_x, const double offset_y, const int ss_size_x, const int ss_size_y, const int window_size_x, const int window_size_y, const Interpolator &interp_ref, const Interpolator &interp_def, const bool debug = false)¶
-
template<typename Real>
void fill_fft_window_with_subset_at_centre(FFTPixels<Real> &ss_ref, const Interpolator &interp_ref, const double ss_x, const double ss_y, const int px_hori, const int px_vert, const int ss_size_x, const int ss_size_y, const int window_size_x, const int window_size_y)¶
-
template<typename Real>
void fill_fft_window_with_subset_at_corner(FFTPixels<Real> &ss_ref, const Image &img_ref, const int ss_x, const int ss_y, const int px_hori, const int px_vert, const int ss_size_x, const int ss_size_y, const int window_size_x, const int window_size_y)¶
-
inline int clamp_subset(int ss_coord, int window_half, int ss_half, int img_size, int window_size)¶
Clamp a subset top-left coordinate so that the window fits inside the image.
- Parameters:
ss_coord – Subset top-left coordinate (x or y)
window_half – Half-size of the FFT window in this direction
ss_half – Half-size of the subset in this direction
img_size – Image size (width or height)
window_size – FFT window size in this direction
- Returns:
Clamped coordinate
-
inline int compute_subset_offset(int window_half, int ss_half, int ss_coord)¶
Compute offsets to center the subset within the FFT window.
- Parameters:
window_half – Half-size of the FFT window in this direction
ss_half – Half-size of the subset in this direction
ss_coord – Subset top-left coordinate (x or y)
- Returns:
Offset for placing subset in window
-
template<typename Real>
inline void reset_fft_ref_subset(std::vector<Real> &vals, int offset_x, int offset_y, int ss_size_x, int ss_size_y, int window_size_x, int window_size_y)¶ Reset a rectangular region inside the FFT reference window to zero.
- Parameters:
vals – window intensity values
offset_x – x offset of subset in FFT window
offset_y – y offset of subset in FFT window
ss_size_x – width of subset
ss_size_y – height of subset
window_size_x – total FFT window width
window_size_y – total FFT window height
-
void smooth_field(std::vector<double> &shift, const subset::Grid &ss_grid, double sigma, int radius)¶
-
double hanning(const int row, const int col, const int size_x, const int size_y)¶
Computes the Hanning window value at a given location.
w(n) = 0.5 * (1 - cos(2πn / (N - 1)))
- Parameters:
row – Row index (0 <= row < size_y)
col – Column index (0 <= col < size_x)
size_x – Total number of columns (must be > 1)
size_y – Total number of rows (must be > 1)
- Returns:
The 2D Hann window coefficient at (row, col).
-
double hamming(const int row, const int col, const int size_x, const int size_y)¶
Computes the 2D Hamming window value at a given position.
w(n) = 0.54 - 0.46 * cos(2πn / (N - 1))
- Parameters:
row – Row index (0 <= row < size_y)
col – Column index (0 <= col < size_x)
size_x – Total number of columns (must be > 1)
size_y – Total number of rows (must be > 1)
- Returns:
The 2D Hamming window coefficient at (row, col).
-
template<typename Real>
struct FFTPixels¶
-
template<typename Real>
struct FFTImpl¶ Public Functions
-
inline FFTImpl(int ss_size_x_, int ss_size_y_, bool store_coords = false)¶
-
inline void correlate()¶
-
inline void correlate_phase()¶
-
inline double safe_log(double val, double eps = 1e-7)¶
-
inline int wrap(int coord, int size)¶
-
inline void get_peak(double &peak_x, double &peak_y, double &max_val, const bool subpx, const std::string &method)¶
-
inline void get_peak_nowrap(double &peak_x, double &peak_y, double &max_val, const bool subpx, const std::string &method)¶
-
inline void get_peak_offset(double &peak_x, double &peak_y, double &max_val, const bool subpx, const std::string &method)¶
-
inline FFTImpl(int ss_size_x_, int ss_size_y_, bool store_coords = false)¶