重写视频后像素值发生了变化(pixel value changed after rewrite the video)

编程入门 行业动态 更新时间:2024-10-23 12:37:00
重写视频后像素值发生了变化(pixel value changed after rewrite the video)

我有灰度(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

更多推荐

本文发布于:2023-08-04 08:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1412482.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重写   像素   发生了   视频   video

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!