美文网首页
ncnn中的from_pixels函数

ncnn中的from_pixels函数

作者: Epimenides | 来源:发表于2020-08-10 21:23 被阅读0次

参考项目,发现这个项目中多次使用到了ncnn::Mat::from_pixels这个函数

于是对这个函数的两个参数ncnn::Mat::PIXEL_BGR,ncnn::Mat::PIXEL_BGR2RGB产生了疑惑

Mat img=cv::imread("");
ncnn::Mat in = ncnn::Mat::from_pixels(img.data, ncnn::Mat::PIXEL_BGR, normalImage.cols, normalImage.rows);
Mat img=cv::imread("");
ncnn::Mat in = ncnn::Mat::from_pixels(img.data, ncnn::Mat::PIXEL_BGR2RGB, normalImage.cols, normalImage.rows);

看到github上有人已经提出这个issues

使用ncnn::Mat::PIXEL_BGR2RGB这个参数我们模型输入的图像的色彩通道需要是rgb的。

使用ncnn::Mat::PIXEL_BGR这个参数我们模型输入的图像的色彩通道需要是bgr的。

相关文章

网友评论

      本文标题:ncnn中的from_pixels函数

      本文链接:https://www.haomeiwen.com/subject/djrsdktx.html