#include <Ricom.h>
Definition at line 52 of file Ricom.h.
◆ Ricom_kernel()
Ricom_kernel::Ricom_kernel |
( |
| ) |
|
|
inline |
Definition at line 74 of file Ricom.h.
std::vector< float > kernel_x
std::vector< float > kernel_y
std::vector< float > f_approx
std::array< int, 2 > kernel_filter_frequency
std::vector< float > kernel_filter
◆ ~Ricom_kernel()
Ricom_kernel::~Ricom_kernel |
( |
| ) |
|
|
inline |
◆ approximate_frequencies()
void Ricom_kernel::approximate_frequencies |
( |
size_t |
n_im | ) |
|
Definition at line 111 of file Ricom.cpp.
116 for (
size_t i = 0; i < nx_im; i++)
118 float x = 2 * i * M_PI;
119 f_approx[i] = (nx_im / x) * (1 - cos(k / 2 * (x / nx_im)));
125 std::for_each(
f_approx.begin(),
f_approx.end(), [f_max](
float &x) { x/=f_max; });
◆ compute_filter()
void Ricom_kernel::compute_filter |
( |
| ) |
|
Definition at line 66 of file Ricom.cpp.
78 if (dist <= ub && dist > lb)
◆ compute_kernel()
void Ricom_kernel::compute_kernel |
( |
| ) |
|
Definition at line 21 of file Ricom.cpp.
23 float rot_rad = M_PI *
rotation / 180;
24 float cos_rot = cos(rot_rad);
25 float sin_rot = sin(rot_rad);
39 float d = ix_s * ix_s + iy_s * iy_s;
40 int ix_e =
k_area - iy_e + ix - 1;
44 float ix_sd = (ix_s / d);
45 float iy_sd = (iy_s / d);
46 kernel_x[ix_e] = cos_rot * ix_sd - sin_rot * iy_sd;
47 kernel_y[ix_e] = sin_rot * ix_sd + cos_rot * iy_sd;
◆ draw_surfaces()
void Ricom_kernel::draw_surfaces |
( |
| ) |
|
Definition at line 128 of file Ricom.cpp.
134 std::cout <<
"Surface could not be created! SDL Error: " << SDL_GetError() << std::endl;
139 std::cout <<
"Surface could not be created! SDL Error: " << SDL_GetError() << std::endl;
142 std::pair kx_min_max = std::minmax_element(
kernel_x.begin(),
kernel_x.end());
143 std::pair ky_min_max = std::minmax_element(
kernel_y.begin(),
kernel_y.end());
151 float valx = (
kernel_x[ic + x] - kx_min_max.first[0]) / (kx_min_max.second[0] - kx_min_max.first[0]);
153 float valy = (
kernel_y[ic + x] - ky_min_max.first[0]) / (ky_min_max.second[0] - ky_min_max.first[0]);
void draw_pixel(SDL_Surface *surface, int x, int y, float val, int col_map)
◆ fftshift_map()
std::vector<int> Ricom_kernel::fftshift_map |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
◆ include_filter()
void Ricom_kernel::include_filter |
( |
| ) |
|
Definition at line 87 of file Ricom.cpp.
90 std::vector<std::complex<float>> x2c = FFT2D::r2c(
kernel_x);
91 std::vector<std::complex<float>> y2c = FFT2D::r2c(
kernel_y);
94 for (
int id = 0;
id <
k_area;
id++)
102 fft2d.ifft(x2c, x2c);
103 fft2d.ifft(y2c, y2c);
104 for (
int id = 0;
id <
k_area;
id++)
◆ b_filter
bool Ricom_kernel::b_filter |
◆ f_approx
std::vector<float> Ricom_kernel::f_approx |
◆ k_area
◆ k_width_sym
int Ricom_kernel::k_width_sym |
◆ kernel_filter
std::vector<float> Ricom_kernel::kernel_filter |
◆ kernel_filter_frequency
std::array<int, 2> Ricom_kernel::kernel_filter_frequency |
◆ kernel_size
int Ricom_kernel::kernel_size |
◆ kernel_x
std::vector<float> Ricom_kernel::kernel_x |
◆ kernel_y
std::vector<float> Ricom_kernel::kernel_y |
◆ rotation
float Ricom_kernel::rotation |
◆ srf_kx
SDL_Surface* Ricom_kernel::srf_kx |
◆ srf_ky
SDL_Surface* Ricom_kernel::srf_ky |
The documentation for this class was generated from the following files: