视频序列出现闪烁

发布于 2024-10-24 04:10:43 字数 186 浏览 1 评论 0原文

我正在实现一个用于从视频中消除闪烁的工具。要测试该工具, 我希望获得一些视频序列(任何视频格式 - MPEG4、H263、MPEG2、H264、原始 YUV),其中存在明显的闪烁量。我搜索过,但找不到任何此类视频。

顺便说一句,是否有已知的视频后期处理工具可以消除闪烁?

任何指示都会有所帮助。

谢谢。 -广告

I am implementing a tool for flicker removal from Video. To test the tool,
I am looking to get some Video Sequences(Any video format - MPEG4,H263,MPEG2,H264,Raw YUV) which have noticable amount of flickering present in them. I searched, but could not find any such videos.

BTW are there known Video post processing tools which allow flicker removal?

Any pointers would help.

thank you.
-AD

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北凤男飞 2024-10-31 04:10:43

如果您有 YUV 序列,则可以非常简单地在特定周期(50 Hz、60 Hz 或其他)添加人工闪烁,方法是在相关周期插入白帧,或者您可以摆弄色度平面使相关框架更轻。

测试序列可以在这里找到。 yuv 测试序列

顺便说一句。通常,移动电话内置了闪烁消除功能,其工作效果非常好,可以在网络频率的倍数下运行。以不是 25 或 30 Hz 倍数的帧速率录制慢动作视频是某些相机模块在以 VGA 100 fps 录制时无法补偿的。

下面是一个可帮助您入门的 Python 函数,它将 YUV 4:2:0 拆分为帧并将每个帧存储为单独的文件。

def split(fname):
    src_yuv = open(fname, 'rb')

    cif = 352*288*1.5   # YUV 4:2:0 change to reflect your input!

    # Get file size in bytes
    src_yuv_size = os.stat(fname)[6]

    nr_files = src_yuv_size / cif

    filecnt = 0
    while True:
        buf = src_yuv.read(cif)          # read qcif number of bytes
        if buf:
            s = "frame" + "%s" % filecnt + ".yuv"
            dst_yuv = open(s, 'wb')
            dst_yuv.write(buf)           # write read data into new file
            print "writing frame", filecnt
            dst_yuv.close()
            filecnt = filecnt + 1
        else:
            break
    src_yuv.close()

If you have a YUV-sequence, it would be quite simple to add artificial flickering at a certain period (50 Hz, 60 Hz or whatever) by either insert a white frame at the period in question or you can fiddle with the chroma-plane making the frame in question lighter.

Test sequences can be found here. yuv test-sequences

BTW. Normally mobile phones have built in flicker removal that works quite well that operates at a multiple of the net frequency. Slow motion video record at a frame rate not an multiple of say 25 or 30 Hz is something that some camera modules fails to compensate for when recording @ say VGA 100 fps.

Here is a python function to get you started that splits a YUV 4:2:0 into frames and stores each frame as a separate file.

def split(fname):
    src_yuv = open(fname, 'rb')

    cif = 352*288*1.5   # YUV 4:2:0 change to reflect your input!

    # Get file size in bytes
    src_yuv_size = os.stat(fname)[6]

    nr_files = src_yuv_size / cif

    filecnt = 0
    while True:
        buf = src_yuv.read(cif)          # read qcif number of bytes
        if buf:
            s = "frame" + "%s" % filecnt + ".yuv"
            dst_yuv = open(s, 'wb')
            dst_yuv.write(buf)           # write read data into new file
            print "writing frame", filecnt
            dst_yuv.close()
            filecnt = filecnt + 1
        else:
            break
    src_yuv.close()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文