@@ -41,61 +41,3 @@ mp_obj_t cv2_core_inRange(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_
41
41
// Return the result
42
42
return mat_to_mp_obj (dst);
43
43
}
44
-
45
- mp_obj_t cv2_core_max (size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
46
- // Define the arguments
47
- enum { ARG_src1, ARG_src2, ARG_dst };
48
- static const mp_arg_t allowed_args[] = {
49
- { MP_QSTR_src1, MP_ARG_REQUIRED | MP_ARG_OBJ, { .u_obj = MP_OBJ_NULL } },
50
- { MP_QSTR_src2, MP_ARG_REQUIRED | MP_ARG_OBJ, { .u_obj = MP_OBJ_NULL } },
51
- { MP_QSTR_dst, MP_ARG_OBJ, { .u_obj = mp_const_none } },
52
- };
53
-
54
- // Parse the arguments
55
- mp_arg_val_t args[MP_ARRAY_SIZE (allowed_args)];
56
- mp_arg_parse_all (n_args, pos_args, kw_args, MP_ARRAY_SIZE (allowed_args), allowed_args, args);
57
-
58
- // Convert arguments to required types
59
- Mat src1 = mp_obj_to_mat (args[ARG_src1].u_obj );
60
- Mat src2 = mp_obj_to_mat (args[ARG_src2].u_obj );
61
- Mat dst = mp_obj_to_mat (args[ARG_dst].u_obj );
62
-
63
- // Call the corresponding OpenCV function
64
- try {
65
- max (src1, src2, dst);
66
- } catch (Exception& e) {
67
- mp_raise_msg (&mp_type_Exception, MP_ERROR_TEXT (e.what ()));
68
- }
69
-
70
- // Return the result
71
- return mat_to_mp_obj (dst);
72
- }
73
-
74
- mp_obj_t cv2_core_min (size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
75
- // Define the arguments
76
- enum { ARG_src1, ARG_src2, ARG_dst };
77
- static const mp_arg_t allowed_args[] = {
78
- { MP_QSTR_src1, MP_ARG_REQUIRED | MP_ARG_OBJ, { .u_obj = MP_OBJ_NULL } },
79
- { MP_QSTR_src2, MP_ARG_REQUIRED | MP_ARG_OBJ, { .u_obj = MP_OBJ_NULL } },
80
- { MP_QSTR_dst, MP_ARG_OBJ, { .u_obj = mp_const_none } },
81
- };
82
-
83
- // Parse the arguments
84
- mp_arg_val_t args[MP_ARRAY_SIZE (allowed_args)];
85
- mp_arg_parse_all (n_args, pos_args, kw_args, MP_ARRAY_SIZE (allowed_args), allowed_args, args);
86
-
87
- // Convert arguments to required types
88
- Mat src1 = mp_obj_to_mat (args[ARG_src1].u_obj );
89
- Mat src2 = mp_obj_to_mat (args[ARG_src2].u_obj );
90
- Mat dst = mp_obj_to_mat (args[ARG_dst].u_obj );
91
-
92
- // Call the corresponding OpenCV function
93
- try {
94
- min (src1, src2, dst);
95
- } catch (Exception& e) {
96
- mp_raise_msg (&mp_type_Exception, MP_ERROR_TEXT (e.what ()));
97
- }
98
-
99
- // Return the result
100
- return mat_to_mp_obj (dst);
101
- }
0 commit comments