FeiGeChuanShu / ncnn-android-yolov8

Real time yolov8 Android demo by ncnn
379 stars 76 forks source link

Question: using YUV directly without converting ? #14

Open brianm-sra opened 1 year ago

brianm-sra commented 1 year ago

I am trying a version of your code. Got it to work on an Android phone. But curious if it is possible to skip the steps of converting colorspace from YUV420 to RGB and to BGR. Can the extraction be done directly from YUV image data?

I saw that extractor.input(name, input) needs a ncnn::Mat type as input and I saw that methods ncnn::Mat::from_pixels(...) and ncnn::Mat::from_pixels_resize(...) require a "type" parameter, but the available types defined in enum PixelType in ncnn/mat.h only include RGB, BGR, GRAY, RGBA, BGRA.