diff --git a/components/vision/src/maix_image.cpp b/components/vision/src/maix_image.cpp index aff9e1c2..bef0fc23 100644 --- a/components/vision/src/maix_image.cpp +++ b/components/vision/src/maix_image.cpp @@ -876,6 +876,20 @@ namespace maix::image throw err::Exception(err::ERR_NOT_IMPL, "not support format"); } break; + case image::FMT_YVU420SP: + switch (format) + { + case image::FMT_GRAYSCALE: + { + auto img = new image::Image(_width, _height, image::FMT_GRAYSCALE); + memcpy(img->data(), _data, _width * _height); + return img; + } + break; + default: + throw err::Exception(err::ERR_NOT_IMPL, "not support format"); + } + break; default: throw err::Exception(err::ERR_NOT_IMPL, "not support format"); }