#include <stdio.h>
#include <stdlib.h>
#include "tools.h"
Go to the source code of this file.
◆ gaussian_noise_reduce()
void gaussian_noise_reduce |
( |
int |
w, |
|
|
int |
h, |
|
|
float |
img_in[w *h], |
|
|
float |
img_out[w *h] |
|
) |
| |
Definition at line 12 of file gaussian_noise_reduce.c.
14 int x, y, max_x, max_y;
17 for (y = w * 2; y < max_y; y += w) {
18 for (
x = 2;
x < max_x;
x++) {
19 img_out[
x + y] = (2 * img_in[
x + y - 2 - w - w] +
20 4 * img_in[
x + y - 1 - w - w] +
21 5 * img_in[
x + y - w - w] +
22 4 * img_in[
x + y + 1 - w - w] +
23 2 * img_in[
x + y + 2 - w - w] +
24 4 * img_in[
x + y - 2 - w] +
25 9 * img_in[
x + y - 1 - w] +
26 12 * img_in[
x + y - w] +
27 9 * img_in[
x + y + 1 - w] +
28 4 * img_in[
x + y + 2 - w] +
29 5 * img_in[
x + y - 2] +
30 12 * img_in[
x + y - 1] +
32 12 * img_in[
x + y + 1] +
33 5 * img_in[
x + y + 2] +
34 4 * img_in[
x + y - 2 + w] +
35 9 * img_in[
x + y - 1 + w] +
36 12 * img_in[
x + y + w] +
37 9 * img_in[
x + y + 1 + w] +
38 4 * img_in[
x + y + 2 + w] +
39 2 * img_in[
x + y - 2 + w + w] +
40 4 * img_in[
x + y - 1 + w + w] +
41 5 * img_in[
x + y + w + w] +
42 4 * img_in[
x + y + 1 + w + w] +
43 2 * img_in[
x + y + 2 + w + w]) / 159;
References x.
Referenced by main().
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 48 of file gaussian_noise_reduce.c.
50 float (*in)[n*n], (*out)[n*n];
54 fprintf(stderr,
"Usage: %s size data_file\n", argv[0]);
void gaussian_noise_reduce(int w, int h, float img_in[w *h], float img_out[w *h])
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
References close_data_file(), fprintf(), free(), gaussian_noise_reduce(), init_data_file(), init_data_float(), malloc(), out, and print_array_float().