Merge pull request #993 from openmv/fix_imlib_deps

Fix imlib deps
This commit is contained in:
Ibrahim Abd Elkader 2020-11-23 01:59:56 +02:00 committed by GitHub
commit 1072df19df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 115 deletions

View File

@ -30,12 +30,8 @@
//#define IMLIB_ENABLE_ROTATION_CORR
// Enable phasecorrelate()
#if defined(IMLIB_ENABLE_ROTATION_CORR)
//#define IMLIB_ENABLE_FIND_DISPLACEMENT
// rotation_corr() is required by phasecorrelate()
#if defined(IMLIB_ENABLE_FIND_DISPLACEMENT)\
&& !defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_ROTATION_CORR
#endif
// Enable get_similarity()
@ -47,12 +43,6 @@
// Enable find_line_segments()
//#define IMLIB_ENABLE_FIND_LINE_SEGMENTS
// find_lines() is required by the old find_line_segments()
//#if defined(IMLIB_ENABLE_FIND_LINE_SEGMENTS)\
// && !defined(IMLIB_ENABLE_FIND_LINES)
// #define IMLIB_ENABLE_FIND_LINES
//#endif
// Enable find_circles()
//#define IMLIB_ENABLE_FIND_CIRCLES

View File

@ -69,12 +69,8 @@
//#define IMLIB_ENABLE_ROTATION_CORR
// Enable phasecorrelate()
#if defined(IMLIB_ENABLE_ROTATION_CORR)
//#define IMLIB_ENABLE_FIND_DISPLACEMENT
// rotation_corr() is required by phasecorrelate()
#if defined(IMLIB_ENABLE_FIND_DISPLACEMENT)\
&& !defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_ROTATION_CORR
#endif
// Enable get_similarity()
@ -86,12 +82,6 @@
// Enable find_line_segments()
//#define IMLIB_ENABLE_FIND_LINE_SEGMENTS
// find_lines() is required by the old find_line_segments()
#if defined(IMLIB_ENABLE_FIND_LINE_SEGMENTS)\
&& !defined(IMLIB_ENABLE_FIND_LINES)
#define IMLIB_ENABLE_FIND_LINES
#endif
// Enable find_circles()
//#define IMLIB_ENABLE_FIND_CIRCLES

View File

@ -72,12 +72,8 @@
#define IMLIB_ENABLE_ROTATION_CORR
// Enable phasecorrelate()
#if defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_FIND_DISPLACEMENT
// rotation_corr() is required by phasecorrelate()
#if defined(IMLIB_ENABLE_FIND_DISPLACEMENT)\
&& !defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_ROTATION_CORR
#endif
// Enable get_similarity()
@ -89,12 +85,6 @@
// Enable find_line_segments()
#define IMLIB_ENABLE_FIND_LINE_SEGMENTS
// find_lines() is required by the old find_line_segments()
#if defined(IMLIB_ENABLE_FIND_LINE_SEGMENTS)\
&& !defined(IMLIB_ENABLE_FIND_LINES)
#define IMLIB_ENABLE_FIND_LINES
#endif
// Enable find_circles()
#define IMLIB_ENABLE_FIND_CIRCLES

View File

@ -72,12 +72,8 @@
#define IMLIB_ENABLE_ROTATION_CORR
// Enable phasecorrelate()
#if defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_FIND_DISPLACEMENT
// rotation_corr() is required by phasecorrelate()
#if defined(IMLIB_ENABLE_FIND_DISPLACEMENT)\
&& !defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_ROTATION_CORR
#endif
// Enable get_similarity()
@ -89,12 +85,6 @@
// Enable find_line_segments()
#define IMLIB_ENABLE_FIND_LINE_SEGMENTS
// find_lines() is required by the old find_line_segments()
#if defined(IMLIB_ENABLE_FIND_LINE_SEGMENTS)\
&& !defined(IMLIB_ENABLE_FIND_LINES)
#define IMLIB_ENABLE_FIND_LINES
#endif
// Enable find_circles()
#define IMLIB_ENABLE_FIND_CIRCLES

View File

@ -72,12 +72,8 @@
#define IMLIB_ENABLE_ROTATION_CORR
// Enable phasecorrelate()
#if defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_FIND_DISPLACEMENT
// rotation_corr() is required by phasecorrelate()
#if defined(IMLIB_ENABLE_FIND_DISPLACEMENT)\
&& !defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_ROTATION_CORR
#endif
// Enable get_similarity()
@ -89,12 +85,6 @@
// Enable find_line_segments()
#define IMLIB_ENABLE_FIND_LINE_SEGMENTS
// find_lines() is required by the old find_line_segments()
#if defined(IMLIB_ENABLE_FIND_LINE_SEGMENTS)\
&& !defined(IMLIB_ENABLE_FIND_LINES)
#define IMLIB_ENABLE_FIND_LINES
#endif
// Enable find_circles()
#define IMLIB_ENABLE_FIND_CIRCLES

View File

@ -72,12 +72,8 @@
#define IMLIB_ENABLE_ROTATION_CORR
// Enable phasecorrelate()
#if defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_FIND_DISPLACEMENT
// rotation_corr() is required by phasecorrelate()
#if defined(IMLIB_ENABLE_FIND_DISPLACEMENT)\
&& !defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_ROTATION_CORR
#endif
// Enable get_similarity()
@ -89,12 +85,6 @@
// Enable find_line_segments()
#define IMLIB_ENABLE_FIND_LINE_SEGMENTS
// find_lines() is required by the old find_line_segments()
#if defined(IMLIB_ENABLE_FIND_LINE_SEGMENTS)\
&& !defined(IMLIB_ENABLE_FIND_LINES)
#define IMLIB_ENABLE_FIND_LINES
#endif
// Enable find_circles()
#define IMLIB_ENABLE_FIND_CIRCLES

View File

@ -72,12 +72,8 @@
#define IMLIB_ENABLE_ROTATION_CORR
// Enable phasecorrelate()
#if defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_FIND_DISPLACEMENT
// rotation_corr() is required by phasecorrelate()
#if defined(IMLIB_ENABLE_FIND_DISPLACEMENT)\
&& !defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_ROTATION_CORR
#endif
// Enable get_similarity()
@ -89,12 +85,6 @@
// Enable find_line_segments()
#define IMLIB_ENABLE_FIND_LINE_SEGMENTS
// find_lines() is required by the old find_line_segments()
#if defined(IMLIB_ENABLE_FIND_LINE_SEGMENTS)\
&& !defined(IMLIB_ENABLE_FIND_LINES)
#define IMLIB_ENABLE_FIND_LINES
#endif
// Enable find_circles()
#define IMLIB_ENABLE_FIND_CIRCLES

View File

@ -16,7 +16,6 @@
// Enable new code optimizations
#define OPTIMIZED
#ifdef IMLIB_ENABLE_APRILTAGS
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
@ -12561,4 +12560,3 @@ void imlib_rotation_corr(image_t *img, float x_rotation, float y_rotation, float
}
#endif //IMLIB_ENABLE_ROTATION_CORR
#pragma GCC diagnostic pop
#endif //IMLIB_ENABLE_APRILTAGS

View File

@ -2422,38 +2422,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_close_obj, 2, py_image_close);
// Math Methods
///////////////
STATIC mp_obj_t py_image_top_hat(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{
int arg_ksize =
py_helper_arg_to_ksize(args[1]);
int arg_threshold =
py_helper_keyword_int(n_args, args, 2, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_threshold), 0);
image_t *arg_msk =
py_helper_keyword_to_image_mutable_mask(n_args, args, 3, kw_args);
fb_alloc_mark();
imlib_top_hat(py_helper_arg_to_image_mutable(args[0]), arg_ksize, arg_threshold, arg_msk);
fb_alloc_free_till_mark();
return args[0];
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_top_hat_obj, 2, py_image_top_hat);
STATIC mp_obj_t py_image_black_hat(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{
int arg_ksize =
py_helper_arg_to_ksize(args[1]);
int arg_threshold =
py_helper_keyword_int(n_args, args, 2, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_threshold), 0);
image_t *arg_msk =
py_helper_keyword_to_image_mutable_mask(n_args, args, 3, kw_args);
fb_alloc_mark();
imlib_black_hat(py_helper_arg_to_image_mutable(args[0]), arg_ksize, arg_threshold, arg_msk);
fb_alloc_free_till_mark();
return args[0];
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_black_hat_obj, 2, py_image_black_hat);
STATIC mp_obj_t py_image_gamma_corr(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{
image_t *arg_img =
@ -2741,6 +2709,40 @@ STATIC mp_obj_t py_image_blend(uint n_args, const mp_obj_t *args, mp_map_t *kw_a
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_blend_obj, 2, py_image_blend);
#endif//IMLIB_ENABLE_MATH_OPS
#if defined(IMLIB_ENABLE_MATH_OPS) && defined (IMLIB_ENABLE_BINARY_OPS)
STATIC mp_obj_t py_image_top_hat(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{
int arg_ksize =
py_helper_arg_to_ksize(args[1]);
int arg_threshold =
py_helper_keyword_int(n_args, args, 2, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_threshold), 0);
image_t *arg_msk =
py_helper_keyword_to_image_mutable_mask(n_args, args, 3, kw_args);
fb_alloc_mark();
imlib_top_hat(py_helper_arg_to_image_mutable(args[0]), arg_ksize, arg_threshold, arg_msk);
fb_alloc_free_till_mark();
return args[0];
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_top_hat_obj, 2, py_image_top_hat);
STATIC mp_obj_t py_image_black_hat(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{
int arg_ksize =
py_helper_arg_to_ksize(args[1]);
int arg_threshold =
py_helper_keyword_int(n_args, args, 2, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_threshold), 0);
image_t *arg_msk =
py_helper_keyword_to_image_mutable_mask(n_args, args, 3, kw_args);
fb_alloc_mark();
imlib_black_hat(py_helper_arg_to_image_mutable(args[0]), arg_ksize, arg_threshold, arg_msk);
fb_alloc_free_till_mark();
return args[0];
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_black_hat_obj, 2, py_image_black_hat);
#endif // defined(IMLIB_ENABLE_MATH_OPS) && defined (IMLIB_ENABLE_BINARY_OPS)
////////////////////
// Filtering Methods
////////////////////
@ -6416,8 +6418,6 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
{MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&py_func_unavailable_obj)},
#endif
#ifdef IMLIB_ENABLE_MATH_OPS
{MP_ROM_QSTR(MP_QSTR_top_hat), MP_ROM_PTR(&py_image_top_hat_obj)},
{MP_ROM_QSTR(MP_QSTR_black_hat), MP_ROM_PTR(&py_image_black_hat_obj)},
/* Math Methods */
{MP_ROM_QSTR(MP_QSTR_gamma_corr), MP_ROM_PTR(&py_image_gamma_corr_obj)},
{MP_ROM_QSTR(MP_QSTR_negate), MP_ROM_PTR(&py_image_negate_obj)},
@ -6433,8 +6433,6 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
{MP_ROM_QSTR(MP_QSTR_difference), MP_ROM_PTR(&py_image_difference_obj)},
{MP_ROM_QSTR(MP_QSTR_blend), MP_ROM_PTR(&py_image_blend_obj)},
#else
{MP_ROM_QSTR(MP_QSTR_top_hat), MP_ROM_PTR(&py_func_unavailable_obj)},
{MP_ROM_QSTR(MP_QSTR_black_hat), MP_ROM_PTR(&py_func_unavailable_obj)},
{MP_ROM_QSTR(MP_QSTR_negate), MP_ROM_PTR(&py_func_unavailable_obj)},
{MP_ROM_QSTR(MP_QSTR_assign), MP_ROM_PTR(&py_func_unavailable_obj)},
{MP_ROM_QSTR(MP_QSTR_replace), MP_ROM_PTR(&py_func_unavailable_obj)},
@ -6448,6 +6446,13 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
{MP_ROM_QSTR(MP_QSTR_difference), MP_ROM_PTR(&py_func_unavailable_obj)},
{MP_ROM_QSTR(MP_QSTR_blend), MP_ROM_PTR(&py_func_unavailable_obj)},
#endif
#if defined(IMLIB_ENABLE_MATH_OPS) && defined (IMLIB_ENABLE_BINARY_OPS)
{MP_ROM_QSTR(MP_QSTR_top_hat), MP_ROM_PTR(&py_image_top_hat_obj)},
{MP_ROM_QSTR(MP_QSTR_black_hat), MP_ROM_PTR(&py_image_black_hat_obj)},
#else
{MP_ROM_QSTR(MP_QSTR_top_hat), MP_ROM_PTR(&py_func_unavailable_obj)},
{MP_ROM_QSTR(MP_QSTR_black_hat), MP_ROM_PTR(&py_func_unavailable_obj)},
#endif //defined(IMLIB_ENABLE_MATH_OPS) && defined (IMLIB_ENABLE_BINARY_OPS)
/* Filtering Methods */
{MP_ROM_QSTR(MP_QSTR_histeq), MP_ROM_PTR(&py_image_histeq_obj)},
#ifdef IMLIB_ENABLE_MEAN