mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add frame size check to keypoints
This commit is contained in:
parent
ed69e4b15a
commit
74d084ee6b
@ -683,7 +683,6 @@ static mp_obj_t py_image_find_features(uint n_args, const mp_obj_t *args, mp_map
|
|||||||
PY_ASSERT_TRUE_MSG(sensor.framesize <= OMV_MAX_INT_FRAME,
|
PY_ASSERT_TRUE_MSG(sensor.framesize <= OMV_MAX_INT_FRAME,
|
||||||
"This function is only supported on "OMV_MAX_INT_FRAME_STR" and smaller frames");
|
"This function is only supported on "OMV_MAX_INT_FRAME_STR" and smaller frames");
|
||||||
|
|
||||||
|
|
||||||
/* read arguments */
|
/* read arguments */
|
||||||
image = py_image_cobj(args[0]);
|
image = py_image_cobj(args[0]);
|
||||||
cascade = py_cascade_cobj(args[1]);
|
cascade = py_cascade_cobj(args[1]);
|
||||||
@ -775,9 +774,12 @@ static mp_obj_t py_image_find_keypoints(uint n_args, const mp_obj_t *args, mp_ma
|
|||||||
rectangle_t roi={0, 0, image->w, image->h};
|
rectangle_t roi={0, 0, image->w, image->h};
|
||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
PY_ASSERT_TRUE_MSG(image->bpp == 1,
|
PY_ASSERT_TRUE_MSG(sensor.pixformat == PIXFORMAT_GRAYSCALE,
|
||||||
"This function is only supported on GRAYSCALE images");
|
"This function is only supported on GRAYSCALE images");
|
||||||
|
|
||||||
|
PY_ASSERT_TRUE_MSG(sensor.framesize <= OMV_MAX_INT_FRAME,
|
||||||
|
"This function is only supported on "OMV_MAX_INT_FRAME_STR" and smaller frames");
|
||||||
|
|
||||||
/* read var args */
|
/* read var args */
|
||||||
mp_map_elem_t *kw_thresh = mp_map_lookup(kw_args, MP_OBJ_NEW_QSTR(qstr_from_str("threshold")), MP_MAP_LOOKUP);
|
mp_map_elem_t *kw_thresh = mp_map_lookup(kw_args, MP_OBJ_NEW_QSTR(qstr_from_str("threshold")), MP_MAP_LOOKUP);
|
||||||
if (kw_thresh != NULL) {
|
if (kw_thresh != NULL) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user