SLIP
1.4
|
Provides some auto and cross correlation algorithms. More...
#include <algorithm>
#include <numeric>
#include <cassert>
#include <cmath>
#include <complex>
#include "statistics.hpp"
#include "FFT.hpp"
#include "Array.hpp"
#include "error.hpp"
#include "Array3d.hpp"
#include "convolution.hpp"
#include "linear_algebra.hpp"
#include "linear_algebra_traits.hpp"
#include "arithmetic_op.hpp"
#include "complex_cast.hpp"
Go to the source code of this file.
Namespaces | |
slip | |
This namespace corresponds to the kernel of the Simple Library on Image Processing (SLIP). That is to say that it contains the data structures and the algorithms needed by these data strucutres. | |
Enumerations | |
enum | slip::CROSSCORRELATION_TYPE { slip::CC, slip::CCC, slip::PNCC, slip::NCC } |
Choose between different types of crosscorrelation. More... | |
Functions | |
crosscorrelations between two ranges | |
template<typename T , typename InputIterator1 , typename InputIterator2 > | |
T | slip::std_crosscorrelation (InputIterator1 first, InputIterator1 last, InputIterator2 first2) |
Computes the standard crosscorrelation between two sequences: ![]() | |
template<typename T , typename InputIterator1 , typename InputIterator2 , typename MaskIterator > | |
T | slip::std_crosscorrelation_mask (InputIterator1 first1, InputIterator1 last1, MaskIterator mask_first, InputIterator2 first2, typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the standard crosscorrelation between two sequences according to a mask sequence ![]() | |
template<typename T , typename InputIterator1 , typename InputIterator2 , typename Predicate > | |
T | slip::std_crosscorrelation_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Predicate pred) |
Computes the standard crosscorrelation between two sequences according to a Predicate. ![]() | |
template<typename T , typename InputIterator1 , typename InputIterator2 > | |
T | slip::cc (InputIterator1 first, InputIterator1 last, InputIterator2 first2) |
Computes the standard crosscorrelation between two sequences: ![]() | |
template<typename T , typename InputIterator1 , typename InputIterator2 , typename MaskIterator > | |
T | slip::cc_mask (InputIterator1 first1, InputIterator1 last1, MaskIterator mask_first, InputIterator2 first2, typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the standard crosscorrelation between two sequences according to a mask sequence ![]() | |
template<typename T , typename InputIterator1 , typename InputIterator2 , typename Predicate > | |
T | slip::cc_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Predicate pred) |
Computes the standard crosscorrelation between two sequences according to a Predicate. ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 > | |
Real | slip::centered_crosscorrelation (InputIterator1 first, InputIterator1 last, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the centered crosscorrelation between two sequences: ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename MaskIterator > | |
Real | slip::centered_crosscorrelation_mask (InputIterator1 first1, InputIterator1 last1, MaskIterator mask_first, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type(), typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the centered crosscorrelation between two sequences according to a mask sequence ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename Predicate > | |
Real | slip::centered_crosscorrelation_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Predicate pred, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the standard crosscorrelation between two sequences according to a Predicate: ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 > | |
Real | slip::ccc (InputIterator1 first, InputIterator1 last, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the centered crosscorrelation between two sequences: ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename MaskIterator > | |
Real | slip::ccc_mask (InputIterator1 first1, InputIterator1 last1, MaskIterator mask_first, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type(), typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the centered crosscorrelation between two sequences according to a mask sequence ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename Predicate > | |
Real | slip::ccc_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Predicate pred, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the standard crosscorrelation between two sequences according to a Predicate: ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 > | |
Real | slip::pseudo_normalized_crosscorrelation (InputIterator1 first, InputIterator1 last, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the pseudo normalized crosscorrelation between two sequences: ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename MaskIterator > | |
Real | slip::pseudo_normalized_crosscorrelation_mask (InputIterator1 first1, InputIterator1 last1, MaskIterator mask_first, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type(), typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the pseudo normalized crosscorrelation between two sequences according to a mask sequence : ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename Predicate > | |
Real | slip::pseudo_normalized_crosscorrelation_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Predicate pred, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the standard pseudo normalized crosscorrelation between two sequences according to a Predicate. ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 > | |
Real | slip::pncc (InputIterator1 first, InputIterator1 last, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the pseudo normalized crosscorrelation between two sequences: ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename MaskIterator > | |
Real | slip::pncc_mask (InputIterator1 first1, InputIterator1 last1, MaskIterator mask_first, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type(), typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the pseudo normalized crosscorrelation between two sequences according to a mask sequence : ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename Predicate > | |
Real | slip::pncc_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Predicate pred, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the standard pseudo normalized crosscorrelation between two sequences according to a Predicate. ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 > | |
Real | slip::normalized_crosscorrelation (InputIterator1 first, InputIterator1 last, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the standard normalized crosscorrelation between two sequences: ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename MaskIterator > | |
Real | slip::normalized_crosscorrelation_mask (InputIterator1 first1, InputIterator1 last1, MaskIterator mask_first, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type(), typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the standard normalized crosscorrelation between two sequences according to a mask sequence ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename Predicate > | |
Real | slip::normalized_crosscorrelation_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Predicate pred, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the standard normalized crosscorrelation between two sequences according to a Predicate: ** ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 > | |
Real | slip::ncc (InputIterator1 first, InputIterator1 last, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the standard normalized crosscorrelation between two sequences: ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename MaskIterator > | |
Real | slip::ncc_mask (InputIterator1 first1, InputIterator1 last1, MaskIterator mask_first, InputIterator2 first2, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type(), typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the standard normalized crosscorrelation between two sequences according to a mask sequence ![]() | |
template<typename Real , typename InputIterator1 , typename InputIterator2 , typename Predicate > | |
Real | slip::ncc_if (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Predicate pred, typename std::iterator_traits< InputIterator1 >::value_type mean1=typename std::iterator_traits< InputIterator1 >::value_type(), typename std::iterator_traits< InputIterator1 >::value_type mean2=typename std::iterator_traits< InputIterator2 >::value_type()) |
Computes the standard normalized crosscorrelation between two sequences according to a Predicate: ![]() | |
autocorrelations and autocovariance algorithms | |
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > | |
void | slip::autocorrelation_full (RandomAccessIterator1 first, RandomAccessIterator1 last, RandomAccessIterator2 auto_first, RandomAccessIterator2 auto_last) |
Computes the autocorrelations from lag -(last-first) to (last-first) of a range [first,last). More... | |
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > | |
void | slip::autocorrelation (RandomAccessIterator1 first, RandomAccessIterator1 last, RandomAccessIterator2 auto_first, RandomAccessIterator2 auto_last) |
Computes the autocorrelations from lag -(last-first) to (last-first) of a range [first,last). More... | |
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > | |
void | slip::biased_autocorrelation (RandomAccessIterator1 first, RandomAccessIterator1 last, RandomAccessIterator2 auto_first, RandomAccessIterator2 auto_last) |
Computes the biased autocorrelations from lag -(last-first) to (last-first) of a range [first,last). More... | |
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > | |
void | slip::unbiased_autocorrelation (RandomAccessIterator1 first, RandomAccessIterator1 last, RandomAccessIterator2 auto_first, RandomAccessIterator2 auto_last) |
Computes the unbiased autocorrelations from lag -(last-first) to (last-first) of a range [first,last). More... | |
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > | |
void | slip::autocovariance (RandomAccessIterator1 first, RandomAccessIterator1 last, RandomAccessIterator2 auto_first, RandomAccessIterator2 auto_last) |
Computes the autocovariance from lag -(last-first) to 0 of a range [first,last). More... | |
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > | |
void | slip::biased_autocovariance (RandomAccessIterator1 first, RandomAccessIterator1 last, RandomAccessIterator2 auto_first, RandomAccessIterator2 auto_last) |
Computes the biased autocovariance from lag -(last-first) to 0 of a range [first,last). More... | |
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 > | |
void | slip::unbiased_autocovariance (RandomAccessIterator1 first, RandomAccessIterator1 last, RandomAccessIterator2 auto_first, RandomAccessIterator2 auto_last) |
Computes the unbiased autocovariance from lag -(last-first) to 0 of a range [first,last). More... | |
template<typename RandomAccessIterator , typename Matrix > | |
void | slip::biased_autocorrelation_matrix (RandomAccessIterator first, RandomAccessIterator last, Matrix &A) |
Constructs the biased autocorrelation matrix from given a range. More... | |
template<typename RandomAccessIterator , typename Matrix > | |
void | slip::biased_autocovariance_matrix (RandomAccessIterator first, RandomAccessIterator last, Matrix &A) |
Constructs the biased autocorrelation matrix from given a range. More... | |
crosscorrelation map algorithms | |
template<typename Real , typename InputIterator2d1 , typename InputIterator2d2 , typename OutputIterator2d > | |
void | slip::crosscorrelation2d (InputIterator2d1 in1_upper_left, InputIterator2d1 in1_bottom_right, InputIterator2d2 in2_upper_left, InputIterator2d2 in2_bottom_right, OutputIterator2d out_upper_left, OutputIterator2d out_bottom_right, CROSSCORRELATION_TYPE t) |
Computes the crosscorrelation between two Images. More... | |
template<typename Real , typename InputIterator2d1 , typename InputIterator2d2 , typename OutputIterator2d > | |
void | slip::std_crosscorrelation2d (InputIterator2d1 in1_upper_left, InputIterator2d1 in1_bottom_right, InputIterator2d2 in2_upper_left, InputIterator2d2 in2_bottom_right, OutputIterator2d out_upper_left, OutputIterator2d out_bottom_right) |
Computes the standard crosscorrelation between two Images. More... | |
template<typename Real , typename InputIterator2d1 , typename InputIterator2d2 , typename OutputIterator2d > | |
void | slip::centered_crosscorrelation2d (InputIterator2d1 in1_upper_left, InputIterator2d1 in1_bottom_right, InputIterator2d2 in2_upper_left, InputIterator2d2 in2_bottom_right, OutputIterator2d out_upper_left, OutputIterator2d out_bottom_right) |
Computes the centered crosscorrelation between two Images. More... | |
template<typename Real , typename InputIterator2d1 , typename InputIterator2d2 , typename OutputIterator2d > | |
void | slip::pseudo_normalized_crosscorrelation2d (InputIterator2d1 in1_upper_left, InputIterator2d1 in1_bottom_right, InputIterator2d2 in2_upper_left, InputIterator2d2 in2_bottom_right, OutputIterator2d out_upper_left, OutputIterator2d out_bottom_right) |
Computes the pseudo normalized crosscorrelation between two Images. More... | |
template<typename Real , typename InputIterator2d1 , typename InputIterator2d2 , typename OutputIterator2d > | |
void | slip::normalized_crosscorrelation2d (InputIterator2d1 in1_upper_left, InputIterator2d1 in1_bottom_right, InputIterator2d2 in2_upper_left, InputIterator2d2 in2_bottom_right, OutputIterator2d out_upper_left, OutputIterator2d out_bottom_right) |
Computes the normalized crosscorrelation between two Images. More... | |
fft crosscorrelation algorithms | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::fft_crosscorrelation (InputIterator1 first, InputIterator1 last, InputIterator2 first2, InputIterator2 last2, OutputIterator result_first, OutputIterator result_last) |
Computes the standard crosscorrelation between two sequences using fft. More... | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::fft_crosscorrelation_same (InputIterator1 first, InputIterator1 last, InputIterator2 first2, InputIterator2 last2, OutputIterator result_first, OutputIterator result_last) |
Computes the FFT central part of the crosscorrelation. More... | |
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename RandomAccessIterator3 > | |
void | slip::fft_circular_crosscorrelation (RandomAccessIterator1 first, RandomAccessIterator1 last, RandomAccessIterator2 first2, RandomAccessIterator2 last2, RandomAccessIterator3 result_first, RandomAccessIterator3 result_last) |
Computes the FFT circular crosscorrelation. More... | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::complex_fft_crosscorrelation (InputIterator1 first, InputIterator1 last, InputIterator2 first2, InputIterator2 last2, OutputIterator result_first, OutputIterator result_last) |
Computes the standard complex crosscorrelation between two sequences using fft. More... | |
template<typename InputIterator2d1 , typename InputIterator2d2 , typename OutputIterator2d > | |
void | slip::fft_circular_crosscorrelation2d (InputIterator2d1 in1_upper_left, InputIterator2d1 in1_bottom_right, InputIterator2d2 in2_upper_left, InputIterator2d2 in2_bottom_right, OutputIterator2d out_upper_left, OutputIterator2d out_bottom_right) |
Computes the circular crosscorrelation between two 2D sequences using fft2d. More... | |
template<typename InputIterator2d1 , typename InputIterator2d2 , typename OutputIterator2d > | |
void | slip::fft_crosscorrelation2d (InputIterator2d1 in1_upper_left, InputIterator2d1 in1_bottom_right, InputIterator2d2 in2_upper_left, InputIterator2d2 in2_bottom_right, OutputIterator2d out_upper_left, OutputIterator2d out_bottom_right) |
Computes the standard crosscorrelation between two 2D sequences using fft2d. More... | |
template<typename InputIterator2d1 , typename InputIterator2d2 , typename OutputIterator2d > | |
void | slip::fft_crosscorrelation2d_same (InputIterator2d1 in1_upper_left, InputIterator2d1 in1_bottom_right, InputIterator2d2 in2_upper_left, InputIterator2d2 in2_bottom_right, OutputIterator2d out_upper_left, OutputIterator2d out_bottom_right) |
Computes the standard crosscorrelation between two 2D sequences using fft2d. More... | |
template<typename InputIterator3d1 , typename InputIterator3d2 , typename OutputIterator3d > | |
void | slip::fft_circular_crosscorrelation3d (InputIterator3d1 in1_front_upper_left, InputIterator3d1 in1_back_bottom_right, InputIterator3d2 in2_front_upper_left, InputIterator3d2 in2_back_bottom_right, OutputIterator3d out_front_upper_left, OutputIterator3d out_back_bottom_right) |
Computes the standard crosscorrelation between two 3D sequences using fft3d. More... | |
template<typename InputIterator3d1 , typename InputIterator3d2 , typename OutputIterator3d > | |
void | slip::fft_crosscorrelation3d (InputIterator3d1 in1_front_upper_left, InputIterator3d1 in1_back_bottom_right, InputIterator3d2 in2_front_upper_left, InputIterator3d2 in2_back_bottom_right, OutputIterator3d out_front_upper_left, OutputIterator3d out_back_bottom_right) |
Computes the standard crosscorrelation between two 3D sequences using fft3d. More... | |
template<typename InputIterator3d1 , typename InputIterator3d2 , typename OutputIterator3d > | |
void | slip::fft_crosscorrelation3d_same (InputIterator3d1 in1_front_upper_left, InputIterator3d1 in1_back_bottom_right, InputIterator3d2 in2_front_upper_left, InputIterator3d2 in2_back_bottom_right, OutputIterator3d out_front_upper_left, OutputIterator3d out_back_bottom_right) |
Computes the standard crosscorrelation between two 3D sequences using fft3d. More... | |