Disable Mean on OMV2

This commit is contained in:
Kwabena W. Agyeman 2018-08-10 02:07:36 -04:00 committed by iabdalkader
parent 4c25cffa7f
commit abe97a73ba
5 changed files with 17 additions and 0 deletions

View File

@ -12,6 +12,9 @@
// Enable flood_fill()
//#define IMLIB_ENABLE_FLOOD_FILL
// Enable mean()
//#define IMLIB_ENABLE_MEAN
// Enable median()
//#define IMLIB_ENABLE_MEDIAN

View File

@ -15,6 +15,9 @@
// Enable flood_fill()
#define IMLIB_ENABLE_FLOOD_FILL
// Enable mean()
#define IMLIB_ENABLE_MEAN
// Enable median()
#define IMLIB_ENABLE_MEDIAN

View File

@ -15,6 +15,9 @@
// Enable flood_fill()
#define IMLIB_ENABLE_FLOOD_FILL
// Enable mean()
#define IMLIB_ENABLE_MEAN
// Enable median()
#define IMLIB_ENABLE_MEDIAN

View File

@ -112,6 +112,7 @@ void imlib_histeq(image_t *img, image_t *mask)
// ...
// ksize == n -> ((n*2)+1)x((n*2)+1) kernel
#ifdef IMLIB_ENABLE_MEAN
void imlib_mean_filter(image_t *img, const int ksize, bool threshold, int offset, bool invert, image_t *mask)
{
int brows = ksize + 1;
@ -298,6 +299,7 @@ void imlib_mean_filter(image_t *img, const int ksize, bool threshold, int offset
}
}
}
#endif // IMLIB_ENABLE_MEAN
#ifdef IMLIB_ENABLE_MEDIAN
void imlib_median_filter(image_t *img, const int ksize, float percentile, bool threshold, int offset, bool invert, image_t *mask)

View File

@ -2066,6 +2066,7 @@ static mp_obj_t py_image_histeq(uint n_args, const mp_obj_t *args, mp_map_t *kw_
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_histeq_obj, 1, py_image_histeq);
#ifdef IMLIB_ENABLE_MEAN
STATIC mp_obj_t py_image_mean(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{
image_t *arg_img =
@ -2087,6 +2088,7 @@ STATIC mp_obj_t py_image_mean(uint n_args, const mp_obj_t *args, mp_map_t *kw_ar
return args[0];
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mean_obj, 2, py_image_mean);
#endif // IMLIB_ENABLE_MEAN
#ifdef IMLIB_ENABLE_MEDIAN
STATIC mp_obj_t py_image_median(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
@ -5322,7 +5324,11 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
#endif
/* Filtering Methods */
{MP_ROM_QSTR(MP_QSTR_histeq), MP_ROM_PTR(&py_image_histeq_obj)},
#ifdef IMLIB_ENABLE_MEAN
{MP_ROM_QSTR(MP_QSTR_mean), MP_ROM_PTR(&py_image_mean_obj)},
#else
{MP_ROM_QSTR(MP_QSTR_mean), MP_ROM_PTR(&py_func_unavailable_obj)},
#endif
#ifdef IMLIB_ENABLE_MEDIAN
{MP_ROM_QSTR(MP_QSTR_median), MP_ROM_PTR(&py_image_median_obj)},
#else