From 7dff089e6f0290cb1c2c0197998532973a2a7e7b Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Sun, 3 Sep 2017 14:39:14 -0400 Subject: [PATCH] Removed QRCodes from the OpenMV Cam M4. They don't really work that well on it anyway due to having to use a low res. This makes room for more basic CV features on the M4 which it can run. --- src/omv/boards/OPENMV3/omv_boardconfig.h | 3 +++ src/omv/py/py_image.c | 6 ++++++ usr/examples/16-Codes/qrcodes_with_lens_corr.py | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/omv/boards/OPENMV3/omv_boardconfig.h b/src/omv/boards/OPENMV3/omv_boardconfig.h index 3720d7ee9..2cd6959be 100644 --- a/src/omv/boards/OPENMV3/omv_boardconfig.h +++ b/src/omv/boards/OPENMV3/omv_boardconfig.h @@ -32,6 +32,9 @@ // Enable Find_Rects #define OMV_ENABLE_FIND_RECTS +// Enable QRCodes (14 KB) +#define OMV_ENABLE_QRCODES + // Enable AprilTags (64 KB). #define OMV_ENABLE_APRILTAGS diff --git a/src/omv/py/py_image.c b/src/omv/py/py_image.c index 556189ddb..9b7b4b6b4 100644 --- a/src/omv/py/py_image.c +++ b/src/omv/py/py_image.c @@ -2728,6 +2728,7 @@ static mp_obj_t py_image_find_rects(uint n_args, const mp_obj_t *args, mp_map_t } #endif +#ifdef OMV_ENABLE_QRCODES // QRCode Object // #define py_qrcode_obj_size 10 typedef struct py_qrcode_obj { @@ -2894,6 +2895,7 @@ static mp_obj_t py_image_find_qrcodes(uint n_args, const mp_obj_t *args, mp_map_ return objects_list; } +#endif #ifdef OMV_ENABLE_APRILTAGS // AprilTag Object // @@ -3838,7 +3840,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_circles_obj, 1, py_image_find_ci STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_rects_obj, 1, py_image_find_rects); #endif /* Code Detection */ +#ifdef OMV_ENABLE_QRCODES STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_qrcodes_obj, 1, py_image_find_qrcodes); +#endif #ifdef OMV_ENABLE_APRILTAGS STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_apriltags_obj, 1, py_image_find_apriltags); #endif @@ -3942,7 +3946,9 @@ static const mp_map_elem_t locals_dict_table[] = { {MP_OBJ_NEW_QSTR(MP_QSTR_find_rects), (mp_obj_t)&py_image_find_rects_obj}, #endif /* Code Detection */ +#ifdef OMV_ENABLE_QRCODES {MP_OBJ_NEW_QSTR(MP_QSTR_find_qrcodes), (mp_obj_t)&py_image_find_qrcodes_obj}, +#endif #ifdef OMV_ENABLE_APRILTAGS {MP_OBJ_NEW_QSTR(MP_QSTR_find_apriltags), (mp_obj_t)&py_image_find_apriltags_obj}, #endif diff --git a/usr/examples/16-Codes/qrcodes_with_lens_corr.py b/usr/examples/16-Codes/qrcodes_with_lens_corr.py index 63275a651..06b839f49 100644 --- a/usr/examples/16-Codes/qrcodes_with_lens_corr.py +++ b/usr/examples/16-Codes/qrcodes_with_lens_corr.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() sensor.set_pixformat(sensor.RGB565) -sensor.set_framesize(sensor.QQVGA) # can be QVGA on M7... +sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... clock = time.clock()