mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix compile issues with the M4 firmware.
Also added a method that will give an error to the user versus not found.
This commit is contained in:
parent
93b81fcffc
commit
76e9d9fd50
@ -9,6 +9,30 @@
|
|||||||
#ifndef __IMLIB_CONFIG_H__
|
#ifndef __IMLIB_CONFIG_H__
|
||||||
#define __IMLIB_CONFIG_H__
|
#define __IMLIB_CONFIG_H__
|
||||||
|
|
||||||
|
// Enable flood_fill()
|
||||||
|
//#define IMLIB_ENABLE_FLOOD_FILL
|
||||||
|
|
||||||
|
// Enable median()
|
||||||
|
//#define IMLIB_ENABLE_MEDIAN
|
||||||
|
|
||||||
|
// Enable mode()
|
||||||
|
//#define IMLIB_ENABLE_MODE
|
||||||
|
|
||||||
|
// Enable midpoint()
|
||||||
|
//#define IMLIB_ENABLE_MIDPOINT
|
||||||
|
|
||||||
|
// Enable Gaussian
|
||||||
|
//#define IMLIB_ENABLE_GAUSSIAN
|
||||||
|
|
||||||
|
// Enable Laplacian
|
||||||
|
//#define IMLIB_ENABLE_LAPLACIAN
|
||||||
|
|
||||||
|
// Enable bilateral()
|
||||||
|
//#define IMLIB_ENABLE_BILATERAL
|
||||||
|
|
||||||
|
// Enable cartoon()
|
||||||
|
//#define IMLIB_ENABLE_CARTOON
|
||||||
|
|
||||||
// Enable remove_shadows()
|
// Enable remove_shadows()
|
||||||
//#define IMLIB_ENABLE_REMOVE_SHADOWS
|
//#define IMLIB_ENABLE_REMOVE_SHADOWS
|
||||||
|
|
||||||
@ -78,4 +102,7 @@
|
|||||||
// Enable FAST (20+ KBs).
|
// Enable FAST (20+ KBs).
|
||||||
//#define IMLIB_ENABLE_FAST
|
//#define IMLIB_ENABLE_FAST
|
||||||
|
|
||||||
|
// Enable find_hog()
|
||||||
|
//#define IMLIB_ENABLE_HOG
|
||||||
|
|
||||||
#endif //__IMLIB_CONFIG_H__
|
#endif //__IMLIB_CONFIG_H__
|
||||||
|
|||||||
@ -9,6 +9,30 @@
|
|||||||
#ifndef __IMLIB_CONFIG_H__
|
#ifndef __IMLIB_CONFIG_H__
|
||||||
#define __IMLIB_CONFIG_H__
|
#define __IMLIB_CONFIG_H__
|
||||||
|
|
||||||
|
// Enable flood_fill()
|
||||||
|
#define IMLIB_ENABLE_FLOOD_FILL
|
||||||
|
|
||||||
|
// Enable median()
|
||||||
|
#define IMLIB_ENABLE_MEDIAN
|
||||||
|
|
||||||
|
// Enable mode()
|
||||||
|
#define IMLIB_ENABLE_MODE
|
||||||
|
|
||||||
|
// Enable midpoint()
|
||||||
|
#define IMLIB_ENABLE_MIDPOINT
|
||||||
|
|
||||||
|
// Enable Gaussian
|
||||||
|
#define IMLIB_ENABLE_GAUSSIAN
|
||||||
|
|
||||||
|
// Enable Laplacian
|
||||||
|
#define IMLIB_ENABLE_LAPLACIAN
|
||||||
|
|
||||||
|
// Enable bilateral()
|
||||||
|
#define IMLIB_ENABLE_BILATERAL
|
||||||
|
|
||||||
|
// Enable cartoon()
|
||||||
|
#define IMLIB_ENABLE_CARTOON
|
||||||
|
|
||||||
// Enable remove_shadows()
|
// Enable remove_shadows()
|
||||||
#define IMLIB_ENABLE_REMOVE_SHADOWS
|
#define IMLIB_ENABLE_REMOVE_SHADOWS
|
||||||
|
|
||||||
@ -81,4 +105,7 @@
|
|||||||
// Enable FAST (20+ KBs).
|
// Enable FAST (20+ KBs).
|
||||||
#define IMLIB_ENABLE_FAST
|
#define IMLIB_ENABLE_FAST
|
||||||
|
|
||||||
|
// Enable find_hog()
|
||||||
|
#define IMLIB_ENABLE_HOG
|
||||||
|
|
||||||
#endif //__IMLIB_CONFIG_H__
|
#endif //__IMLIB_CONFIG_H__
|
||||||
|
|||||||
@ -9,6 +9,30 @@
|
|||||||
#ifndef __IMLIB_CONFIG_H__
|
#ifndef __IMLIB_CONFIG_H__
|
||||||
#define __IMLIB_CONFIG_H__
|
#define __IMLIB_CONFIG_H__
|
||||||
|
|
||||||
|
// Enable flood_fill()
|
||||||
|
#define IMLIB_ENABLE_FLOOD_FILL
|
||||||
|
|
||||||
|
// Enable median()
|
||||||
|
#define IMLIB_ENABLE_MEDIAN
|
||||||
|
|
||||||
|
// Enable mode()
|
||||||
|
#define IMLIB_ENABLE_MODE
|
||||||
|
|
||||||
|
// Enable midpoint()
|
||||||
|
#define IMLIB_ENABLE_MIDPOINT
|
||||||
|
|
||||||
|
// Enable Gaussian
|
||||||
|
#define IMLIB_ENABLE_GAUSSIAN
|
||||||
|
|
||||||
|
// Enable Laplacian
|
||||||
|
#define IMLIB_ENABLE_LAPLACIAN
|
||||||
|
|
||||||
|
// Enable bilateral()
|
||||||
|
#define IMLIB_ENABLE_BILATERAL
|
||||||
|
|
||||||
|
// Enable cartoon()
|
||||||
|
#define IMLIB_ENABLE_CARTOON
|
||||||
|
|
||||||
// Enable remove_shadows()
|
// Enable remove_shadows()
|
||||||
#define IMLIB_ENABLE_REMOVE_SHADOWS
|
#define IMLIB_ENABLE_REMOVE_SHADOWS
|
||||||
|
|
||||||
@ -81,4 +105,7 @@
|
|||||||
// Enable FAST (20+ KBs).
|
// Enable FAST (20+ KBs).
|
||||||
#define IMLIB_ENABLE_FAST
|
#define IMLIB_ENABLE_FAST
|
||||||
|
|
||||||
|
// Enable find_hog()
|
||||||
|
#define IMLIB_ENABLE_HOG
|
||||||
|
|
||||||
#endif //__IMLIB_CONFIG_H__
|
#endif //__IMLIB_CONFIG_H__
|
||||||
|
|||||||
@ -262,6 +262,7 @@ void imlib_draw_image(image_t *img, image_t *other, int x_off, int y_off, float
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_FLOOD_FILL
|
||||||
void imlib_flood_fill(image_t *img, int x, int y,
|
void imlib_flood_fill(image_t *img, int x, int y,
|
||||||
float seed_threshold, float floating_threshold,
|
float seed_threshold, float floating_threshold,
|
||||||
int c, bool invert, bool clear_background, image_t *mask)
|
int c, bool invert, bool clear_background, image_t *mask)
|
||||||
@ -363,3 +364,4 @@ void imlib_flood_fill(image_t *img, int x, int y,
|
|||||||
fb_free();
|
fb_free();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // IMLIB_ENABLE_FLOOD_FILL
|
||||||
|
|||||||
@ -299,6 +299,7 @@ void imlib_mean_filter(image_t *img, const int ksize, bool threshold, int offset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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)
|
void imlib_median_filter(image_t *img, const int ksize, float percentile, bool threshold, int offset, bool invert, image_t *mask)
|
||||||
{
|
{
|
||||||
int brows = ksize + 1;
|
int brows = ksize + 1;
|
||||||
@ -503,7 +504,9 @@ void imlib_median_filter(image_t *img, const int ksize, float percentile, bool t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // IMLIB_ENABLE_MEDIAN
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_MODE
|
||||||
void imlib_mode_filter(image_t *img, const int ksize, bool threshold, int offset, bool invert, image_t *mask)
|
void imlib_mode_filter(image_t *img, const int ksize, bool threshold, int offset, bool invert, image_t *mask)
|
||||||
{
|
{
|
||||||
int brows = ksize + 1;
|
int brows = ksize + 1;
|
||||||
@ -736,7 +739,9 @@ void imlib_mode_filter(image_t *img, const int ksize, bool threshold, int offset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // IMLIB_ENABLE_MODE
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_MIDPOINT
|
||||||
void imlib_midpoint_filter(image_t *img, const int ksize, float bias, bool threshold, int offset, bool invert, image_t *mask)
|
void imlib_midpoint_filter(image_t *img, const int ksize, float bias, bool threshold, int offset, bool invert, image_t *mask)
|
||||||
{
|
{
|
||||||
int brows = ksize + 1;
|
int brows = ksize + 1;
|
||||||
@ -935,6 +940,7 @@ void imlib_midpoint_filter(image_t *img, const int ksize, float bias, bool thres
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // IMLIB_ENABLE_MIDPOINT
|
||||||
|
|
||||||
// http://www.fmwconcepts.com/imagemagick/digital_image_filtering.pdf
|
// http://www.fmwconcepts.com/imagemagick/digital_image_filtering.pdf
|
||||||
|
|
||||||
@ -1123,6 +1129,7 @@ void imlib_morph(image_t *img, const int ksize, const int *krn, const float m, c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_BILATERAL
|
||||||
static float gaussian(float x, float sigma)
|
static float gaussian(float x, float sigma)
|
||||||
{
|
{
|
||||||
return fast_expf((x * x) / (-2.0f * sigma * sigma)) / (fabsf(sigma) * 2.506628f); // sqrt(2 * PI)
|
return fast_expf((x * x) / (-2.0f * sigma * sigma)) / (fabsf(sigma) * 2.506628f); // sqrt(2 * PI)
|
||||||
@ -1409,7 +1416,9 @@ void imlib_bilateral_filter(image_t *img, const int ksize, float color_sigma, fl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // IMLIB_ENABLE_BILATERAL
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_CARTOON
|
||||||
typedef struct imlib_cartoon_filter_mean_state {
|
typedef struct imlib_cartoon_filter_mean_state {
|
||||||
int r_acc, g_acc, b_acc, pixels;
|
int r_acc, g_acc, b_acc, pixels;
|
||||||
} imlib_cartoon_filter_mean_state_t;
|
} imlib_cartoon_filter_mean_state_t;
|
||||||
@ -1581,3 +1590,4 @@ void imlib_cartoon_filter(image_t *img, float seed_threshold, float floating_thr
|
|||||||
fb_free();
|
fb_free();
|
||||||
fb_free();
|
fb_free();
|
||||||
}
|
}
|
||||||
|
#endif // IMLIB_ENABLE_CARTOON
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
#include "fb_alloc.h"
|
#include "fb_alloc.h"
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_HOG
|
||||||
#define N_BINS (9)
|
#define N_BINS (9)
|
||||||
typedef struct bin {
|
typedef struct bin {
|
||||||
int d;
|
int d;
|
||||||
@ -129,3 +130,4 @@ void imlib_find_hog(image_t *src, rectangle_t *roi, int cell_size)
|
|||||||
xfree(gds);
|
xfree(gds);
|
||||||
fb_free();
|
fb_free();
|
||||||
}
|
}
|
||||||
|
#endif // IMLIB_ENABLE_HOG
|
||||||
|
|||||||
@ -1452,6 +1452,7 @@ STATIC mp_obj_t py_image_draw_keypoints(uint n_args, const mp_obj_t *args, mp_ma
|
|||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_keypoints_obj, 2, py_image_draw_keypoints);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_keypoints_obj, 2, py_image_draw_keypoints);
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_FLOOD_FILL
|
||||||
STATIC mp_obj_t py_image_flood_fill(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
STATIC mp_obj_t py_image_flood_fill(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img = py_helper_arg_to_image_mutable(args[0]);
|
image_t *arg_img = py_helper_arg_to_image_mutable(args[0]);
|
||||||
@ -1486,6 +1487,7 @@ STATIC mp_obj_t py_image_flood_fill(uint n_args, const mp_obj_t *args, mp_map_t
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_flood_fill_obj, 2, py_image_flood_fill);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_flood_fill_obj, 2, py_image_flood_fill);
|
||||||
|
#endif // IMLIB_ENABLE_FLOOD_FILL
|
||||||
|
|
||||||
/////////////////
|
/////////////////
|
||||||
// Binary Methods
|
// Binary Methods
|
||||||
@ -2064,6 +2066,7 @@ STATIC mp_obj_t py_image_mean(uint n_args, const mp_obj_t *args, mp_map_t *kw_ar
|
|||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mean_obj, 2, py_image_mean);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mean_obj, 2, py_image_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)
|
STATIC mp_obj_t py_image_median(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img =
|
image_t *arg_img =
|
||||||
@ -2088,7 +2091,9 @@ STATIC mp_obj_t py_image_median(uint n_args, const mp_obj_t *args, mp_map_t *kw_
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_median_obj, 2, py_image_median);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_median_obj, 2, py_image_median);
|
||||||
|
#endif // IMLIB_ENABLE_MEDIAN
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_MODE
|
||||||
STATIC mp_obj_t py_image_mode(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
STATIC mp_obj_t py_image_mode(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img =
|
image_t *arg_img =
|
||||||
@ -2110,7 +2115,9 @@ STATIC mp_obj_t py_image_mode(uint n_args, const mp_obj_t *args, mp_map_t *kw_ar
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mode_obj, 2, py_image_mode);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mode_obj, 2, py_image_mode);
|
||||||
|
#endif // IMLIB_ENABLE_MODE
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_MIDPOINT
|
||||||
STATIC mp_obj_t py_image_midpoint(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
STATIC mp_obj_t py_image_midpoint(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img =
|
image_t *arg_img =
|
||||||
@ -2135,6 +2142,7 @@ STATIC mp_obj_t py_image_midpoint(uint n_args, const mp_obj_t *args, mp_map_t *k
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_midpoint_obj, 2, py_image_midpoint);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_midpoint_obj, 2, py_image_midpoint);
|
||||||
|
#endif // IMLIB_ENABLE_MIDPOINT
|
||||||
|
|
||||||
STATIC mp_obj_t py_image_morph(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
STATIC mp_obj_t py_image_morph(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
@ -2182,6 +2190,7 @@ STATIC mp_obj_t py_image_morph(uint n_args, const mp_obj_t *args, mp_map_t *kw_a
|
|||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_morph_obj, 3, py_image_morph);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_morph_obj, 3, py_image_morph);
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_GAUSSIAN
|
||||||
STATIC mp_obj_t py_image_gaussian(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
STATIC mp_obj_t py_image_gaussian(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img =
|
image_t *arg_img =
|
||||||
@ -2237,7 +2246,9 @@ STATIC mp_obj_t py_image_gaussian(uint n_args, const mp_obj_t *args, mp_map_t *k
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_gaussian_obj, 2, py_image_gaussian);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_gaussian_obj, 2, py_image_gaussian);
|
||||||
|
#endif // IMLIB_ENABLE_GAUSSIAN
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_LAPLACIAN
|
||||||
STATIC mp_obj_t py_image_laplacian(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
STATIC mp_obj_t py_image_laplacian(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img =
|
image_t *arg_img =
|
||||||
@ -2295,7 +2306,9 @@ STATIC mp_obj_t py_image_laplacian(uint n_args, const mp_obj_t *args, mp_map_t *
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_laplacian_obj, 2, py_image_laplacian);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_laplacian_obj, 2, py_image_laplacian);
|
||||||
|
#endif // IMLIB_ENABLE_LAPLACIAN
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_BILATERAL
|
||||||
STATIC mp_obj_t py_image_bilateral(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
STATIC mp_obj_t py_image_bilateral(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img =
|
image_t *arg_img =
|
||||||
@ -2321,7 +2334,9 @@ STATIC mp_obj_t py_image_bilateral(uint n_args, const mp_obj_t *args, mp_map_t *
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_bilateral_obj, 2, py_image_bilateral);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_bilateral_obj, 2, py_image_bilateral);
|
||||||
|
#endif // IMLIB_ENABLE_BILATERAL
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_CARTOON
|
||||||
STATIC mp_obj_t py_image_cartoon(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
STATIC mp_obj_t py_image_cartoon(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img =
|
image_t *arg_img =
|
||||||
@ -2343,6 +2358,7 @@ STATIC mp_obj_t py_image_cartoon(uint n_args, const mp_obj_t *args, mp_map_t *kw
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_cartoon_obj, 1, py_image_cartoon);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_cartoon_obj, 1, py_image_cartoon);
|
||||||
|
#endif // IMLIB_ENABLE_CARTOON
|
||||||
|
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
// Shadow Removal Methods
|
// Shadow Removal Methods
|
||||||
@ -5187,6 +5203,7 @@ static mp_obj_t py_image_find_edges(uint n_args, const mp_obj_t *args, mp_map_t
|
|||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_edges_obj, 2, py_image_find_edges);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_edges_obj, 2, py_image_find_edges);
|
||||||
|
|
||||||
|
#ifdef IMLIB_ENABLE_HOG
|
||||||
static mp_obj_t py_image_find_hog(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
static mp_obj_t py_image_find_hog(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
{
|
{
|
||||||
image_t *arg_img = py_helper_arg_to_image_grayscale(args[0]);
|
image_t *arg_img = py_helper_arg_to_image_grayscale(args[0]);
|
||||||
@ -5201,6 +5218,14 @@ static mp_obj_t py_image_find_hog(uint n_args, const mp_obj_t *args, mp_map_t *k
|
|||||||
return args[0];
|
return args[0];
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_hog_obj, 1, py_image_find_hog);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_hog_obj, 1, py_image_find_hog);
|
||||||
|
#endif // IMLIB_ENABLE_HOG
|
||||||
|
|
||||||
|
mp_obj_t py_image_unavailable(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||||
|
{
|
||||||
|
PY_ASSERT_TRUE_MSG(false, "This method is unavailable on your OpenMV Cam version.");
|
||||||
|
return args[0];
|
||||||
|
}
|
||||||
|
MP_DEFINE_CONST_FUN_OBJ_KW(py_image_unavailable_obj, 1, py_image_unavailable);
|
||||||
|
|
||||||
static const mp_rom_map_elem_t locals_dict_table[] = {
|
static const mp_rom_map_elem_t locals_dict_table[] = {
|
||||||
/* Basic Methods */
|
/* Basic Methods */
|
||||||
@ -5233,7 +5258,11 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
|
|||||||
{MP_ROM_QSTR(MP_QSTR_draw_cross), MP_ROM_PTR(&py_image_draw_cross_obj)},
|
{MP_ROM_QSTR(MP_QSTR_draw_cross), MP_ROM_PTR(&py_image_draw_cross_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_draw_arrow), MP_ROM_PTR(&py_image_draw_arrow_obj)},
|
{MP_ROM_QSTR(MP_QSTR_draw_arrow), MP_ROM_PTR(&py_image_draw_arrow_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_draw_image), MP_ROM_PTR(&py_image_draw_image_obj)},
|
{MP_ROM_QSTR(MP_QSTR_draw_image), MP_ROM_PTR(&py_image_draw_image_obj)},
|
||||||
|
#ifdef IMLIB_ENABLE_FLOOD_FILL
|
||||||
{MP_ROM_QSTR(MP_QSTR_flood_fill), MP_ROM_PTR(&py_image_flood_fill_obj)},
|
{MP_ROM_QSTR(MP_QSTR_flood_fill), MP_ROM_PTR(&py_image_flood_fill_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_flood_fill), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
#endif
|
||||||
{MP_ROM_QSTR(MP_QSTR_draw_keypoints), MP_ROM_PTR(&py_image_draw_keypoints_obj)},
|
{MP_ROM_QSTR(MP_QSTR_draw_keypoints), MP_ROM_PTR(&py_image_draw_keypoints_obj)},
|
||||||
/* Binary Methods */
|
/* Binary Methods */
|
||||||
{MP_ROM_QSTR(MP_QSTR_binary), MP_ROM_PTR(&py_image_binary_obj)},
|
{MP_ROM_QSTR(MP_QSTR_binary), MP_ROM_PTR(&py_image_binary_obj)},
|
||||||
@ -5270,40 +5299,84 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
|
|||||||
/* Filtering Methods */
|
/* Filtering Methods */
|
||||||
{MP_ROM_QSTR(MP_QSTR_histeq), MP_ROM_PTR(&py_image_histeq_obj)},
|
{MP_ROM_QSTR(MP_QSTR_histeq), MP_ROM_PTR(&py_image_histeq_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_mean), MP_ROM_PTR(&py_image_mean_obj)},
|
{MP_ROM_QSTR(MP_QSTR_mean), MP_ROM_PTR(&py_image_mean_obj)},
|
||||||
|
#ifdef IMLIB_ENABLE_MEDIAN
|
||||||
{MP_ROM_QSTR(MP_QSTR_median), MP_ROM_PTR(&py_image_median_obj)},
|
{MP_ROM_QSTR(MP_QSTR_median), MP_ROM_PTR(&py_image_median_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_median), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
#endif
|
||||||
|
#ifdef IMLIB_ENABLE_MODE
|
||||||
{MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&py_image_mode_obj)},
|
{MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&py_image_mode_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
#endif
|
||||||
|
#ifdef IMLIB_ENABLE_MIDPOINT
|
||||||
{MP_ROM_QSTR(MP_QSTR_midpoint), MP_ROM_PTR(&py_image_midpoint_obj)},
|
{MP_ROM_QSTR(MP_QSTR_midpoint), MP_ROM_PTR(&py_image_midpoint_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_midpoint), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
#endif
|
||||||
{MP_ROM_QSTR(MP_QSTR_morph), MP_ROM_PTR(&py_image_morph_obj)},
|
{MP_ROM_QSTR(MP_QSTR_morph), MP_ROM_PTR(&py_image_morph_obj)},
|
||||||
|
#ifdef IMLIB_ENABLE_GAUSSIAN
|
||||||
{MP_ROM_QSTR(MP_QSTR_blur), MP_ROM_PTR(&py_image_gaussian_obj)},
|
{MP_ROM_QSTR(MP_QSTR_blur), MP_ROM_PTR(&py_image_gaussian_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_gaussian), MP_ROM_PTR(&py_image_gaussian_obj)},
|
{MP_ROM_QSTR(MP_QSTR_gaussian), MP_ROM_PTR(&py_image_gaussian_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_gaussian_blur), MP_ROM_PTR(&py_image_gaussian_obj)},
|
{MP_ROM_QSTR(MP_QSTR_gaussian_blur), MP_ROM_PTR(&py_image_gaussian_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_blur), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_gaussian), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_gaussian_blur), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
#endif
|
||||||
|
#ifdef IMLIB_ENABLE_LAPLACIAN
|
||||||
{MP_ROM_QSTR(MP_QSTR_laplacian), MP_ROM_PTR(&py_image_laplacian_obj)},
|
{MP_ROM_QSTR(MP_QSTR_laplacian), MP_ROM_PTR(&py_image_laplacian_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_laplacian), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
#endif
|
||||||
|
#ifdef IMLIB_ENABLE_BILATERAL
|
||||||
{MP_ROM_QSTR(MP_QSTR_bilateral), MP_ROM_PTR(&py_image_bilateral_obj)},
|
{MP_ROM_QSTR(MP_QSTR_bilateral), MP_ROM_PTR(&py_image_bilateral_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_bilateral), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
#endif
|
||||||
|
#ifdef IMLIB_ENABLE_CARTOON
|
||||||
{MP_ROM_QSTR(MP_QSTR_cartoon), MP_ROM_PTR(&py_image_cartoon_obj)},
|
{MP_ROM_QSTR(MP_QSTR_cartoon), MP_ROM_PTR(&py_image_cartoon_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_cartoon), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
|
#endif
|
||||||
/* Shadow Removal Methods */
|
/* Shadow Removal Methods */
|
||||||
#ifdef IMLIB_ENABLE_REMOVE_SHADOWS
|
#ifdef IMLIB_ENABLE_REMOVE_SHADOWS
|
||||||
{MP_ROM_QSTR(MP_QSTR_remove_shadows), MP_ROM_PTR(&py_image_remove_shadows_obj)},
|
{MP_ROM_QSTR(MP_QSTR_remove_shadows), MP_ROM_PTR(&py_image_remove_shadows_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_remove_shadows), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_CHROMINVAR
|
#ifdef IMLIB_ENABLE_CHROMINVAR
|
||||||
{MP_ROM_QSTR(MP_QSTR_chrominvar), MP_ROM_PTR(&py_image_chrominvar_obj)},
|
{MP_ROM_QSTR(MP_QSTR_chrominvar), MP_ROM_PTR(&py_image_chrominvar_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_chrominvar), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_ILLUMINVAR
|
#ifdef IMLIB_ENABLE_ILLUMINVAR
|
||||||
{MP_ROM_QSTR(MP_QSTR_illuminvar), MP_ROM_PTR(&py_image_illuminvar_obj)},
|
{MP_ROM_QSTR(MP_QSTR_illuminvar), MP_ROM_PTR(&py_image_illuminvar_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_illuminvar), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
/* Geometric Methods */
|
/* Geometric Methods */
|
||||||
#ifdef IMLIB_ENABLE_LINPOLAR
|
#ifdef IMLIB_ENABLE_LINPOLAR
|
||||||
{MP_ROM_QSTR(MP_QSTR_linpolar), MP_ROM_PTR(&py_image_linpolar_obj)},
|
{MP_ROM_QSTR(MP_QSTR_linpolar), MP_ROM_PTR(&py_image_linpolar_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_linpolar), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_LOGPOLAR
|
#ifdef IMLIB_ENABLE_LOGPOLAR
|
||||||
{MP_ROM_QSTR(MP_QSTR_logpolar), MP_ROM_PTR(&py_image_logpolar_obj)},
|
{MP_ROM_QSTR(MP_QSTR_logpolar), MP_ROM_PTR(&py_image_logpolar_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_logpolar), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
{MP_ROM_QSTR(MP_QSTR_lens_corr), MP_ROM_PTR(&py_image_lens_corr_obj)},
|
{MP_ROM_QSTR(MP_QSTR_lens_corr), MP_ROM_PTR(&py_image_lens_corr_obj)},
|
||||||
#ifdef IMLIB_ENABLE_ROTATION_CORR
|
#ifdef IMLIB_ENABLE_ROTATION_CORR
|
||||||
{MP_ROM_QSTR(MP_QSTR_rotation_corr), MP_ROM_PTR(&py_image_rotation_corr_obj)},
|
{MP_ROM_QSTR(MP_QSTR_rotation_corr), MP_ROM_PTR(&py_image_rotation_corr_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_rotation_corr), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
/* Get Methods */
|
/* Get Methods */
|
||||||
#ifdef IMLIB_ENABLE_GET_SIMILARITY
|
#ifdef IMLIB_ENABLE_GET_SIMILARITY
|
||||||
{MP_ROM_QSTR(MP_QSTR_get_similarity), MP_ROM_PTR(&py_image_get_similarity_obj)},
|
{MP_ROM_QSTR(MP_QSTR_get_similarity), MP_ROM_PTR(&py_image_get_similarity_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_get_similarity), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
{MP_ROM_QSTR(MP_QSTR_get_hist), MP_ROM_PTR(&py_image_get_histogram_obj)},
|
{MP_ROM_QSTR(MP_QSTR_get_hist), MP_ROM_PTR(&py_image_get_histogram_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_get_histogram), MP_ROM_PTR(&py_image_get_histogram_obj)},
|
{MP_ROM_QSTR(MP_QSTR_get_histogram), MP_ROM_PTR(&py_image_get_histogram_obj)},
|
||||||
@ -5316,36 +5389,58 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
|
|||||||
{MP_ROM_QSTR(MP_QSTR_find_blobs), MP_ROM_PTR(&py_image_find_blobs_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_blobs), MP_ROM_PTR(&py_image_find_blobs_obj)},
|
||||||
#ifdef IMLIB_ENABLE_FIND_LINES
|
#ifdef IMLIB_ENABLE_FIND_LINES
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_lines), MP_ROM_PTR(&py_image_find_lines_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_lines), MP_ROM_PTR(&py_image_find_lines_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_lines), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_FIND_LINE_SEGMENTS
|
#ifdef IMLIB_ENABLE_FIND_LINE_SEGMENTS
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_line_segments), MP_ROM_PTR(&py_image_find_line_segments_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_line_segments), MP_ROM_PTR(&py_image_find_line_segments_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_line_segments), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_FIND_CIRCLES
|
#ifdef IMLIB_ENABLE_FIND_CIRCLES
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_circles), MP_ROM_PTR(&py_image_find_circles_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_circles), MP_ROM_PTR(&py_image_find_circles_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_circles), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_FIND_RECTS
|
#ifdef IMLIB_ENABLE_FIND_RECTS
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_rects), MP_ROM_PTR(&py_image_find_rects_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_rects), MP_ROM_PTR(&py_image_find_rects_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_rects), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_QRCODES
|
#ifdef IMLIB_ENABLE_QRCODES
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_qrcodes), MP_ROM_PTR(&py_image_find_qrcodes_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_qrcodes), MP_ROM_PTR(&py_image_find_qrcodes_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_qrcodes), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_APRILTAGS
|
#ifdef IMLIB_ENABLE_APRILTAGS
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_apriltags), MP_ROM_PTR(&py_image_find_apriltags_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_apriltags), MP_ROM_PTR(&py_image_find_apriltags_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_apriltags), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_DATAMATRICES
|
#ifdef IMLIB_ENABLE_DATAMATRICES
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_datamatrices), MP_ROM_PTR(&py_image_find_datamatrices_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_datamatrices), MP_ROM_PTR(&py_image_find_datamatrices_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_datamatrices), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_BARCODES
|
#ifdef IMLIB_ENABLE_BARCODES
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_barcodes), MP_ROM_PTR(&py_image_find_barcodes_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_barcodes), MP_ROM_PTR(&py_image_find_barcodes_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_barcodes), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_FIND_DISPLACEMENT
|
#ifdef IMLIB_ENABLE_FIND_DISPLACEMENT
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_displacement), MP_ROM_PTR(&py_image_find_displacement_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_displacement), MP_ROM_PTR(&py_image_find_displacement_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_displacement), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_LENET
|
#ifdef IMLIB_ENABLE_LENET
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_number), MP_ROM_PTR(&py_image_find_number_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_number), MP_ROM_PTR(&py_image_find_number_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_number), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
#ifdef IMLIB_ENABLE_CNN
|
#ifdef IMLIB_ENABLE_CNN
|
||||||
{MP_ROM_QSTR(MP_QSTR_classify_object), MP_ROM_PTR(&py_image_classify_object_obj)},
|
{MP_ROM_QSTR(MP_QSTR_classify_object), MP_ROM_PTR(&py_image_classify_object_obj)},
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_classify_object), MP_ROM_PTR(&py_image_unavailable_obj)},
|
||||||
#endif
|
#endif
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_template), MP_ROM_PTR(&py_image_find_template_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_template), MP_ROM_PTR(&py_image_find_template_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_features), MP_ROM_PTR(&py_image_find_features_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_features), MP_ROM_PTR(&py_image_find_features_obj)},
|
||||||
@ -5353,7 +5448,11 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
|
|||||||
{MP_ROM_QSTR(MP_QSTR_find_lbp), MP_ROM_PTR(&py_image_find_lbp_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_lbp), MP_ROM_PTR(&py_image_find_lbp_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_keypoints), MP_ROM_PTR(&py_image_find_keypoints_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_keypoints), MP_ROM_PTR(&py_image_find_keypoints_obj)},
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_edges), MP_ROM_PTR(&py_image_find_edges_obj)},
|
{MP_ROM_QSTR(MP_QSTR_find_edges), MP_ROM_PTR(&py_image_find_edges_obj)},
|
||||||
|
#ifdef IMLIB_ENABLE_HOG
|
||||||
{MP_ROM_QSTR(MP_QSTR_find_hog), MP_ROM_PTR(&py_image_find_hog_obj)}
|
{MP_ROM_QSTR(MP_QSTR_find_hog), MP_ROM_PTR(&py_image_find_hog_obj)}
|
||||||
|
#else
|
||||||
|
{MP_ROM_QSTR(MP_QSTR_find_hog), MP_ROM_PTR(&py_image_unavailable_obj)}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
STATIC MP_DEFINE_CONST_DICT(locals_dict, locals_dict_table);
|
STATIC MP_DEFINE_CONST_DICT(locals_dict, locals_dict_table);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user