diff --git a/components/vision/include/maix_image.hpp b/components/vision/include/maix_image.hpp index 8a779a07..9080a552 100644 --- a/components/vision/include/maix_image.hpp +++ b/components/vision/include/maix_image.hpp @@ -629,11 +629,11 @@ namespace maix::image * @param mask Mask is another image to use as a pixel level mask for the operation. The mask should be an image with just black or white pixels and should be the same size as the image being operated on. * Only pixels set in the mask are modified. default is None. * @param to_bitmap If true, the image will be converted to a bitmap image before thresholding. default is false. TODO: support in the feature - * @param copy Select whether to return a new image or modify the original image. default is true. + * @param copy Select whether to return a new image or modify the original image. default is false. * @return Returns the image after the operation is completed. * @maixpy maix.image.Image.binary */ - image::Image *binary(std::vector> thresholds = std::vector>(), bool invert = false, bool zero = false, image::Image *mask = nullptr, bool to_bitmap = false, bool copy = true); + image::Image *binary(std::vector> thresholds = std::vector>(), bool invert = false, bool zero = false, image::Image *mask = nullptr, bool to_bitmap = false, bool copy = false); /** * @brief Inverts the image in place. diff --git a/components/vision/port/maixcam/maix_camera_mmf.cpp b/components/vision/port/maixcam/maix_camera_mmf.cpp index c93cc101..5260627e 100644 --- a/components/vision/port/maixcam/maix_camera_mmf.cpp +++ b/components/vision/port/maixcam/maix_camera_mmf.cpp @@ -229,22 +229,20 @@ namespace maix::camera _config_sensor_env(_fps); // mmf init - if (!mmf_is_init()) { - mmf_sys_cfg_t sys_cfg = {0}; - if (_width <= 1280 && _height <= 720 && _fps > 30) { - sys_cfg.vb_pool[0].size = 1280 * 720 * 3 / 2; - sys_cfg.vb_pool[0].count = 3; - sys_cfg.vb_pool[0].map = 2; - sys_cfg.max_pool_cnt = 1; - } else { - sys_cfg.vb_pool[0].size = 2560 * 1440 * 3 / 2; - sys_cfg.vb_pool[0].count = 2; - sys_cfg.vb_pool[0].map = 3; - sys_cfg.max_pool_cnt = 1; - } - mmf_pre_config_sys(&sys_cfg); - err::check_bool_raise(!mmf_init(), "mmf init failed"); + mmf_sys_cfg_t sys_cfg = {0}; + if (_width <= 1280 && _height <= 720 && _fps > 30) { + sys_cfg.vb_pool[0].size = 1280 * 720 * 3 / 2; + sys_cfg.vb_pool[0].count = 3; + sys_cfg.vb_pool[0].map = 2; + sys_cfg.max_pool_cnt = 1; + } else { + sys_cfg.vb_pool[0].size = 2560 * 1440 * 3 / 2; + sys_cfg.vb_pool[0].count = 2; + sys_cfg.vb_pool[0].map = 3; + sys_cfg.max_pool_cnt = 1; } + mmf_pre_config_sys(&sys_cfg); + err::check_bool_raise(!mmf_init(), "mmf init failed"); mmf_vi_cfg_t cfg = {0}; cfg.w = _width;