Go to the source code of this file.
|
#define | min(a, b) ((a)>(b) ? (b) : (a)) |
|
#define | max(a, b) ((a)>(b) ? (a) : (b)) |
|
|
void | dilate_1d_h (int width, int height, type_t img[width][height], type_t img_out[width][height]) |
|
void | dilate_1d_v (struct image *img, struct image *img_out) |
|
void | erode_1d_h (int width, int height, type_t img[width][height], type_t img_out[width][height]) |
|
void | erode_1d_v (struct image *img, struct image *img_out) |
|
void | erode (int width, int height, type_t img_in[width][height], type_t img_scratch[width][height], type_t img_out[width][height]) |
|
void | dilate (int width, int height, type_t img_in[width][height], type_t img_scratch[width][height], type_t img_out[width][height]) |
|
◆ max
#define max |
( |
|
a, |
|
|
|
b |
|
) |
| ((a)>(b) ? (a) : (b)) |
◆ min
#define min |
( |
|
a, |
|
|
|
b |
|
) |
| ((a)>(b) ? (b) : (a)) |
◆ type_t
◆ dilate()
void dilate |
( |
int |
width, |
|
|
int |
height, |
|
|
type_t |
img_in[width][height], |
|
|
type_t |
img_scratch[width][height], |
|
|
type_t |
img_out[width][height] |
|
) |
| |
Definition at line 85 of file erode_dilate.c.
void dilate_1d_h(int width, int height, type_t img[width][height], type_t img_out[width][height])
void dilate_1d_v(struct image *img, struct image *img_out)
References dilate_1d_h(), and dilate_1d_v().
◆ dilate_1d_h()
void dilate_1d_h |
( |
int |
width, |
|
|
int |
height, |
|
|
type_t |
img[width][height], |
|
|
type_t |
img_out[width][height] |
|
) |
| |
Definition at line 44 of file erode_dilate.c.
46 for (y = 2 ; y < height -2 ; ++y) {
47 for (
x = 2;
x < width - 2;
x++) {
48 img_out[y][
x] =
max(
max(
max(
max(img[y][
x-2], img[y][
x-1]), img[y][
x]), img[y][
x+1]), img[y][
x+2]);
References max, and x.
Referenced by dilate().
◆ dilate_1d_v()
void dilate_1d_v |
( |
struct image * |
img, |
|
|
struct image * |
img_out |
|
) |
| |
Definition at line 53 of file erode_dilate.c.
55 for (y = 2 ; y < height -2 ; ++y) {
56 for (
x = 2;
x < width - 2;
x++) {
57 img_out[y][
x] =
max(
max(
max(
max(img[y-2][
x], img[y-1][
x]), img[y][
x]), img[y+1][
x]), img[y+2][
x]);
References max, and x.
Referenced by dilate().
◆ erode()
void erode |
( |
int |
width, |
|
|
int |
height, |
|
|
type_t |
img_in[width][height], |
|
|
type_t |
img_scratch[width][height], |
|
|
type_t |
img_out[width][height] |
|
) |
| |
Definition at line 80 of file erode_dilate.c.
void erode_1d_v(struct image *img, struct image *img_out)
void erode_1d_h(int width, int height, type_t img[width][height], type_t img_out[width][height])
References erode_1d_h(), and erode_1d_v().
◆ erode_1d_h()
void erode_1d_h |
( |
int |
width, |
|
|
int |
height, |
|
|
type_t |
img[width][height], |
|
|
type_t |
img_out[width][height] |
|
) |
| |
Definition at line 62 of file erode_dilate.c.
64 for (y = 2 ; y < height -2 ; ++y) {
65 for (
x = 2;
x < width - 2;
x++) {
66 img_out[y][
x] =
min(
min(
min(
min(img[y][
x-2], img[y][
x-1]), img[y][
x]), img[y][
x+1]), img[y][
x+2]);
References min, and x.
Referenced by erode().
◆ erode_1d_v()
void erode_1d_v |
( |
struct image * |
img, |
|
|
struct image * |
img_out |
|
) |
| |
Definition at line 71 of file erode_dilate.c.
73 for (y = 2 ; y < height -2 ; ++y) {
74 for (
x = 2;
x < width - 2;
x++) {
75 img_out[y][
x] =
min(
min(
min(
min(img[y-2][
x], img[y-1][
x]), img[y][
x]), img[y+1][
x]), img[y+2][
x]);
References min, and x.
Referenced by erode().