首页 新闻 会员 周边

OpenCVSharp YUV的宽为啥是rgb宽的1.5倍?

0
悬赏园豆:5 [已关闭问题] 关闭于 2021-01-13 15:34

遇到这么一段代码

Mat rgbMat = new Mat(height,width,MatType.CV_8UC3);
Mat yuvMat = new Mat(height + height /2 ,width,MatType.CV_8UC1,YUV_IntPtr);
Cv2.CvtColor(yuvMat,rgbMat,ColorConversionCodes.YUV420pBGR);

我试着修改成这样的

Mat rgbMat = new Mat(height,width,MatType.CV_8UC3);
Mat yuvMat = new Mat(height ,width,MatType.CV_8UC1,YUV_IntPtr);
Cv2.CvtColor(yuvMat,rgbMat,ColorConversionCodes.YUV420pBGR);

发现转换之后的rgbMat的高度小了,但是为啥要height1.5,不能width1.5?

echo_lovely的主页 echo_lovely | 小虾三级 | 园豆:1433
提问于:2021-01-12 09:09
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册