mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Disable Mean on OMV2
This commit is contained in:
parent
4c25cffa7f
commit
abe97a73ba
@ -12,6 +12,9 @@
|
||||
// Enable flood_fill()
|
||||
//#define IMLIB_ENABLE_FLOOD_FILL
|
||||
|
||||
// Enable mean()
|
||||
//#define IMLIB_ENABLE_MEAN
|
||||
|
||||
// Enable median()
|
||||
//#define IMLIB_ENABLE_MEDIAN
|
||||
|
||||
|
||||
@ -15,6 +15,9 @@
|
||||
// Enable flood_fill()
|
||||
#define IMLIB_ENABLE_FLOOD_FILL
|
||||
|
||||
// Enable mean()
|
||||
#define IMLIB_ENABLE_MEAN
|
||||
|
||||
// Enable median()
|
||||
#define IMLIB_ENABLE_MEDIAN
|
||||
|
||||
|
||||
@ -15,6 +15,9 @@
|
||||
// Enable flood_fill()
|
||||
#define IMLIB_ENABLE_FLOOD_FILL
|
||||
|
||||
// Enable mean()
|
||||
#define IMLIB_ENABLE_MEAN
|
||||
|
||||
// Enable median()
|
||||
#define IMLIB_ENABLE_MEDIAN
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user