Класс для визуального увеличения вибрации на видео
Подробнее...
#include <eulerian_enlargement.h>
|
| void | LaplaceEnlarge (Mat &motion_pyramid_level, int current_level) |
| | Осуществляет увеличение движения на конкретном уровне пирамиды Подробнее...
|
| |
| void | Attenuate (Mat &motion_frame) |
| | "Приглушает" усиленные цвета на кадре Подробнее...
|
| |
| void | BuildLaplacePyramid (const Mat &input_frame, std::vector< Mat > &input_pyramid, const int levels) |
| | Создает пирамиду изображений Подробнее...
|
| |
| void | IirFilter (Mat &input_pyramid_level, Mat &motion_pyramid_level, Mat &low_pass_high_level, Mat &low_pass_low_level, double cutoff_low, double cutoff_high) |
| | Фильтр для отсекания низких и высоких "пространственных" частот ("фильтр с бесконечной импульсной характеристикой" - infinite impulse response) Подробнее...
|
| |
| void | BuildFromLaplacePyramid (std::vector< Mat > &motion_pyramid, Mat &motion_frame, int levels) |
| | Извлекаем выходное изображение из пирамиды Лапласа Подробнее...
|
| |
Класс для визуального увеличения вибрации на видео
См. определение в файле eulerian_enlargement.h строка 12
◆ EulerEnlarger()
| EulerEnlarger::EulerEnlarger |
( |
| ) |
|
|
protected |
См. определение в файле eulerian_enlargement.cpp строка 3
3 :
4 cutoff_low_{ 0.1 },
5 cutoff_high_{ 1.0 },
8 lambda_cutoff_{ 16.0 },
11 alpha_{ 10.0 },
13{
14 std::cout << "Euler Enlarger constructor" << std::endl;
15}
double lambda_
Показательная длина волны
double exaggeraiton_coefficient_
Коэффициент увеличения. Чем выше - тем больше шума, тем сильнее увеличиваются небольшие движения.
int levels_amount_
Количество уровней (слоев) пирамиды
double delta_
Коэффициент, использующийся при увеличении
double color_attenuation_coefficient_
Коэффициент приглушеняи цвета
◆ ~EulerEnlarger()
| EulerEnlarger::~EulerEnlarger |
( |
| ) |
|
|
protected |
◆ Attenuate()
| void EulerEnlarger::Attenuate |
( |
Mat & |
motion_frame | ) |
|
|
protected |
"Приглушает" усиленные цвета на кадре
См. определение в файле eulerian_enlargement.cpp строка 38
39{
40
41 if (motion_frame.channels() > 2)
42 {
43
44 Mat planes[3];
45 split(motion_frame, planes);
46
49 merge(planes, 3, motion_frame);
50 }
51}
◆ BuildFromLaplacePyramid()
| void EulerEnlarger::BuildFromLaplacePyramid |
( |
std::vector< Mat > & |
motion_pyramid, |
|
|
Mat & |
motion_frame, |
|
|
int |
levels |
|
) |
| |
|
protected |
Извлекаем выходное изображение из пирамиды Лапласа
См. определение в файле eulerian_enlargement.cpp строка 82
83{
84
85 Mat current_level = motion_pyramid[levels];
86
87 for (int level = levels - 1; level >= 0; --level)
88 {
89 Mat up;
90 pyrUp(current_level, up, motion_pyramid[level].size());
91
92 current_level = up + motion_pyramid[level];
93 }
94 motion_frame = current_level.clone();
95}
◆ BuildLaplacePyramid()
| void EulerEnlarger::BuildLaplacePyramid |
( |
const Mat & |
input_frame, |
|
|
std::vector< Mat > & |
input_pyramid, |
|
|
const int |
levels |
|
) |
| |
|
protected |
Создает пирамиду изображений
См. определение в файле eulerian_enlargement.cpp строка 53
54{
55 input_pyramid.clear();
56 std::vector<Mat> pyramid;
57 Mat current_level = input_frame.clone();
58
59 for (int level = 0; level < levels; level++)
60 {
61 Mat down, up;
62
63 pyrDown(current_level, down);
64
65 pyrUp(down, up, current_level.size());
66 Mat laplace = current_level - up;
67 pyramid.push_back(laplace);
68 current_level = down;
69 }
70 pyramid.push_back(current_level);
71 input_pyramid = pyramid;
72}
◆ IirFilter()
| void EulerEnlarger::IirFilter |
( |
Mat & |
input_pyramid_level, |
|
|
Mat & |
motion_pyramid_level, |
|
|
Mat & |
low_pass_high_level, |
|
|
Mat & |
low_pass_low_level, |
|
|
double |
cutoff_low, |
|
|
double |
cutoff_high |
|
) |
| |
|
protected |
Фильтр для отсекания низких и высоких "пространственных" частот ("фильтр с бесконечной импульсной характеристикой" - infinite impulse response)
Чем больше cutoff (пороговое значение), тем быстрее исчезает "низкочастотные" области изображения из "низкочастотной" пирамиды => длительные (соответственно большие) движения быстрее исчезают
См. определение в файле eulerian_enlargement.cpp строка 74
75{
76 low_pass_high_level = (1 - cutoff_high) * low_pass_high_level + cutoff_high * input_pyramid_level;
77 low_pass_low_level = (1 - cutoff_low) * low_pass_low_level + cutoff_low * input_pyramid_level;
78
79 motion_pyramid_level = low_pass_high_level - low_pass_low_level;
80}
◆ LaplaceEnlarge()
| void EulerEnlarger::LaplaceEnlarge |
( |
Mat & |
motion_pyramid_level, |
|
|
int |
current_level |
|
) |
| |
|
protected |
Осуществляет увеличение движения на конкретном уровне пирамиды
См. определение в файле eulerian_enlargement.cpp строка 22
23{
25
27 {
28
29 motion_pyramid_level = motion_pyramid_level * 0;
30 }
31 else
32 {
33
34 motion_pyramid_level = motion_pyramid_level * std::min(current_alpha, alpha_);
35 }
36}
◆ alpha_
| double EulerEnlarger::alpha_ |
|
protected |
◆ color_attenuation_coefficient_
| double EulerEnlarger::color_attenuation_coefficient_ |
|
protected |
◆ cutoff_high_
| double EulerEnlarger::cutoff_high_ |
|
protected |
◆ cutoff_low_
| double EulerEnlarger::cutoff_low_ |
|
protected |
◆ delta_
| double EulerEnlarger::delta_ |
|
protected |
◆ exaggeraiton_coefficient_
| double EulerEnlarger::exaggeraiton_coefficient_ |
|
protected |
Коэффициент увеличения. Чем выше - тем больше шума, тем сильнее увеличиваются небольшие движения.
См. определение в файле eulerian_enlargement.h строка 60
◆ lambda_
| double EulerEnlarger::lambda_ |
|
protected |
◆ lambda_cutoff_
| double EulerEnlarger::lambda_cutoff_ |
|
protected |
◆ levels_amount_
| int EulerEnlarger::levels_amount_ |
|
protected |
◆ low_pass_high_pyramid_
| std::vector<Mat> EulerEnlarger::low_pass_high_pyramid_ |
|
protected |
◆ low_pass_low_pyramid_
| std::vector<Mat> EulerEnlarger::low_pass_low_pyramid_ |
|
protected |
Объявления и описания членов классов находятся в файлах: