OpenCV中视频的无损压缩 [英] Lossless compression for video in opencv

查看:1187
本文介绍了OpenCV中视频的无损压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个视频处理项目中,该项目涉及对摄像机使用给定帧与关键图像进行简单XOR操作的某种加密,并最终存储视频文件. 对于解密阶段,使用相同图像的XOR操作将获得原始帧.但是问题是,当我解密帧时,它看起来非常嘈杂,并发现这是由于我在存储时使用了有损图像压缩孔而造成的.还有其他针对opencv的无损图像压缩格式吗?

I am working on a video processing project that involves some sort of encryption using simple XOR operation of a given frame from camera with a key image and finally store the video file. And for decryption phase the XOR operation with the same image will get the original frames. But the problem is while I decrypt the frame appears to be very noisy and found out that its because of the lossy image compression foramt I used while storing. Is there any other lossless image compression foramts for opencv??

推荐答案

如果在Windows上工作,则可以将CV_FOURCC_PROMPT用作VideoWriter构造函数的第二个参数-它将允许您从列表中选择编解码器并进行设置各种选择.仅出于测试目的,您可以使用uncompressed avi (aka full frames [not compressed]).它将产生巨大的文件,但应该可以正常工作.

If you are working on windows you can use CV_FOURCC_PROMPT as the second parameter of VideoWriter constructor - it will allow you to choose codec from list and set various options. Just for test you can use uncompressed avi (aka full frames [not compressed]). It will produce huge files, but should work fine.

否则,只需检查列表中的所有可能性

Otherwise just check all of possibilities from the list

http://www.fourcc.org/codecs.php

请注意,HighGui is meant as a simple tool for experimentation.( http://opencv.willowgarage.com/wiki/VideoCodecs),因此它可能无法提供您正在寻找的功能.如果是这样,您将不得不使用其他一些库,并为它提供由opencv处理的每一帧.

Note that HighGui is meant as a simple tool for experimentation.(http://opencv.willowgarage.com/wiki/VideoCodecs) so it may not provide the functionality you are looking for. If so you will have to use some other library and give it each frame processed by opencv.

这篇关于OpenCV中视频的无损压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆