![]() |
![]() |
Functions | |
void | IMG_erode_bin (const unsigned char *restrict in_data, unsigned char *restrict out_data, const char *restrict mask, int cols) |
void IMG_erode_bin | ( | const unsigned char *restrict | in_data, | |
unsigned char *restrict | out_data, | |||
const char *restrict | mask, | |||
int | cols | |||
) |
in_data | Input image pointer (packed binary) | |
out_data | Output image pointer (packed binary) | |
mask | Erosion filter mask | |
cols | Number of columns in the image |
result = 1; if (mask[0][0] != DONT_CARE) result &= input[y + 0][x + 0]; if (mask[0][1] != DONT_CARE) result &= input[y + 1][x + 1]; if (mask[0][2] != DONT_CARE) result &= input[y + 2][x + 2]; if (mask[1][0] != DONT_CARE) result &= input[y + 0][x + 0]; if (mask[1][1] != DONT_CARE) result &= input[y + 1][x + 1]; if (mask[1][2] != DONT_CARE) result &= input[y + 2][x + 2]; if (mask[2][0] != DONT_CARE) result &= input[y + 0][x + 0]; if (mask[2][1] != DONT_CARE) result &= input[y + 1][x + 1]; if (mask[2][2] != DONT_CARE) result &= input[y + 2][x + 2]; output[y][x] = result;