Math operations for IP algorithms. More...
Functions | |
double | lanczos (double x, std::ptrdiff_t a) |
Lanczos response at point x. More... | |
template<typename T = float, typename Allocator = std::allocator<T>> | |
auto | generate_normalized_mean (std::size_t side_length) -> detail::kernel_2d< T, Allocator > |
Generate mean kernel. More... | |
template<typename T = float, typename Allocator = std::allocator<T>> | |
auto | generate_unnormalized_mean (std::size_t side_length) -> detail::kernel_2d< T, Allocator > |
Generate kernel with all 1s. More... | |
template<typename T = float, typename Allocator = std::allocator<T>> | |
auto | generate_gaussian_kernel (std::size_t side_length, double sigma) -> detail::kernel_2d< T, Allocator > |
Generate Gaussian kernel. More... | |
template<typename T = float, typename Allocator = std::allocator<T>> | |
auto | generate_dx_sobel (unsigned int degree=1) -> detail::kernel_2d< T, Allocator > |
Generates Sobel operator in horizontal direction. More... | |
template<typename T = float, typename Allocator = std::allocator<T>> | |
auto | generate_dx_scharr (unsigned int degree=1) -> detail::kernel_2d< T, Allocator > |
Generate Scharr operator in horizontal direction. More... | |
template<typename T = float, typename Allocator = std::allocator<T>> | |
auto | generate_dy_sobel (unsigned int degree=1) -> detail::kernel_2d< T, Allocator > |
Generates Sobel operator in vertical direction. More... | |
template<typename T = float, typename Allocator = std::allocator<T>> | |
auto | generate_dy_scharr (unsigned int degree=1) -> detail::kernel_2d< T, Allocator > |
Generate Scharr operator in vertical direction. More... | |
template<typename GradientView , typename OutputView > | |
void | compute_hessian_entries (GradientView dx, GradientView dy, OutputView ddxx, OutputView dxdy, OutputView ddyy) |
Compute xy gradient, and second order x and y gradients. More... | |
Math operations for IP algorithms.
This is mostly handful of mathemtical operations that are required by other image processing algorithms
Normalized cardinal sine
normalized_sinc(x) = sin(pi * x) / (pi * x)
|
inline |
Compute xy gradient, and second order x and y gradients.
Hessian matrix is defined as a matrix of partial derivates for 2d case, it is [[ddxx, dxdy], [dxdy, ddyy]. d stands for derivative, and x or y stand for direction. For example, dx stands for derivative (gradient) in horizontal direction, and ddxx means second order derivative in horizon direction https://en.wikipedia.org/wiki/Hessian_matrix
|
inline |
Generate Scharr operator in horizontal direction.
Generates a kernel which will represent Scharr operator in horizontal direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/profile/Hanno_Scharr/publication/220955743_Optimal_Filters_for_Extended_Optical_Flow/links/004635151972eda98f000000/Optimal-Filters-for-Extended-Optical-Flow.pdf
|
inline |
Generates Sobel operator in horizontal direction.
Generates a kernel which will represent Sobel operator in horizontal direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/publication/239398674_An_Isotropic_3_3_Image_Gradient_Operator
|
inline |
Generate Scharr operator in vertical direction.
Generates a kernel which will represent Scharr operator in vertical direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/profile/Hanno_Scharr/publication/220955743_Optimal_Filters_for_Extended_Optical_Flow/links/004635151972eda98f000000/Optimal-Filters-for-Extended-Optical-Flow.pdf
|
inline |
Generates Sobel operator in vertical direction.
Generates a kernel which will represent Sobel operator in vertical direction of specified degree (no need to convolve multiple times to obtain the desired degree). https://www.researchgate.net/publication/239398674_An_Isotropic_3_3_Image_Gradient_Operator
|
inline |
Generate Gaussian kernel.
Fills supplied view with values taken from Gaussian distribution. See https://en.wikipedia.org/wiki/Gaussian_blur
|
inline |
Generate mean kernel.
Fills supplied view with normalized mean in which all entries will be equal to
|
inline |
Generate kernel with all 1s.
Fills supplied view with 1s (ones)
|
inline |
Lanczos response at point x.
Lanczos response is defined as: x == 0: 1 -a < x && x < a: 0 otherwise: normalized_sinc(x) / normalized_sinc(x / a)