mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix unintialized error.
If the rect was not intersecting these functions would have returned bad values.
This commit is contained in:
parent
744329f8f6
commit
6ed08213b5
@ -537,7 +537,7 @@ static mp_obj_t py_image_centroid(uint n_args, const mp_obj_t *args, mp_map_t *k
|
||||
|
||||
rectangle_t arg_r;
|
||||
py_helper_lookup_rectangle(kw_args, arg_img, &arg_r);
|
||||
int x, y;
|
||||
int x = 0, y = 0;
|
||||
int sum = imlib_centroid(arg_img, &x, &y, &arg_r);
|
||||
|
||||
return mp_obj_new_tuple(3, (mp_obj_t[3])
|
||||
@ -552,7 +552,7 @@ static mp_obj_t py_image_orientation_radians(uint n_args, const mp_obj_t *args,
|
||||
|
||||
rectangle_t arg_r;
|
||||
py_helper_lookup_rectangle(kw_args, arg_img, &arg_r);
|
||||
int sum, x, y;
|
||||
int sum = 0, x = 0, y = 0;
|
||||
float o = imlib_orientation_radians(arg_img, &sum, &x, &y, &arg_r);
|
||||
|
||||
return mp_obj_new_tuple(4, (mp_obj_t[4])
|
||||
@ -567,7 +567,7 @@ static mp_obj_t py_image_orientation_degrees(uint n_args, const mp_obj_t *args,
|
||||
|
||||
rectangle_t arg_r;
|
||||
py_helper_lookup_rectangle(kw_args, arg_img, &arg_r);
|
||||
int sum, x, y;
|
||||
int sum = 0, x = 0, y = 0;
|
||||
float o = imlib_orientation_degrees(arg_img, &sum, &x, &y, &arg_r);
|
||||
|
||||
return mp_obj_new_tuple(4, (mp_obj_t[4])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user