我有灰度(X射线)的视频......问题是当我读取和写入视频时像素值发生变化! 我将像素值打印为灰色和BGR,我在所有这些中都得到了值......我读了视频,然后用openCV写了它,然后我重新打印像素值,我看到像素值不同!
我在MAC 10.6.8上使用openCV 2.4.3和FFMPEG 0.11
像素值变化的原因是什么? ...如何在不改变像素值的情况下读取和写入视频? BTW:原始视频已经使用FFMPEG和YUV240像素格式在Windows中编写!
先谢谢了
I have videos which are grayscale (x-ray) ... the problem is when I read and write the videos the pixel value change !!! I print the pixel values as a gray and as BGR and I got values in all of them ... I read the video then I write it using openCV then I re print the pixel value and I see different in the pixel values !!!
I am using openCV 2.4.3 with FFMPEG 0.11 on MAC 10.6.8
why the pixel value changed ? ... how can I read and write the video without changing the pixel value? BTW: the original videos has been written in windows using FFMPEG with YUV240 pixel format !
Thanks in Advance :D
最满意答案
像素值会发生变化,因为openCV默认将帧转换为BGR! 我猜,读取操作会进行转换过程,为什么像素会发生变化
我希望这可以帮助谁面对这个问题,获得确切的价值,你可以使用FFMPEG读取和写入视频,提供大量的像素格式
The pixels values change because openCV convert the frames to BGR by default ! the reading operation do the conversion process , I guess , that why the pixels change
I hope this can help who face this problem , to get the exact value , you can read and write the videos using FFMPEG which provide a lot of pixel format
更多推荐
发布评论