Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6e80c5b

Browse files
committed
Description added
1 parent 89a4fb3 commit 6e80c5b

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

‎CppSource/Source.cpp‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
//Vladimir Gudkov, Ilia Moiseev
22
//South Ural State University, Chelyabinsk, Russia, 2020
33
//Image smoothing Algorithm Based on Gradient Analysis
4+
/*
5+
Functions and classes in this file use the template system.
6+
The names of template arguments are the tips that were made to help user
7+
in choosing the data types that are recommended to use (in parenthesis):
8+
Tf - floating point number (float or double)
9+
Ts - signed integer (int32_t)
10+
Tu - unsigned integer (uint8_t)
11+
*/
412

513
#include "stdint.h"
614
#include <cmath>
@@ -75,18 +83,30 @@ void computeModules(Tu*** src, Tf*** dst, Ts**** grads, uint32_t height, uint32_
7583
dst[i][j][c] = module<Tf, Ts>(grads[i][j][c]);
7684
}
7785

86+
//The class that implements filtering. To use it create an instance of Filter class
87+
//and then call operator ()
7888
template<typename Tf, typename Tu>
7989
class Filter
8090
{
8191
public:
92+
/*
93+
Operator () filters src with kernel of size ksize, then leaves result in dst image.
94+
95+
Recieves:
96+
Tu*** src - source image, array with the shape (height x width x colors)
97+
Tf*** dst - destination image with the same shape as src
98+
Tf*** modules - the array of gradient modules with the same shape as src
99+
Tf*** modules - the array of gradient modules with the same shape as src
100+
uint32_t ksize - size of filtering kernel (odd values expected)
101+
uint32_t height, width, colors - dimensions of the src image
102+
*/
82103
void operator()(Tu*** src, Tf*** dst, Tf*** modules, Tf*** angles,
83104
uint32_t ksize, uint32_t height, uint32_t width, uint32_t colors)
84105
{
85106
for (uint32_t c = 0; c < colors; c++)
86107
for (uint32_t i = 0; i < height; i++)
87108
for (uint32_t j = 0; j < width; j++)
88109
{
89-
90110
int up = i - ksize / 2;
91111
int left = j - ksize / 2;
92112
int down = i + ksize / 2 + 1;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /