本文整理汇总了Python中ycbcr.YCbCr.convert方法的典型用法代码示例。如果您正苦于以下问题:Python YCbCr.convert方法的具体用法?Python YCbCr.convert怎么用?Python YCbCr.convert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ycbcr.YCbCr
的用法示例。
在下文中一共展示了YCbCr.convert方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_5
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_5(self):
"""
YV12 -> 422
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='422', filename_out=OUT)
a.convert()
ret = get_sha1(OUT, SIZE_422)
self.assertEqual(ret, 'c700a31a209df30b72c1097898740d4c42d63a42')
示例2: test_3
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_3(self):
"""
YV12 -> YVYU
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='YVYU', filename_out=OUT)
a.convert()
ret = get_sha1(OUT, SIZE_422)
self.assertEqual(ret, '68ac533290a89625b910731c93fbecba89b61870')
示例3: test_1
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_1(self):
"""
convert YV12 into itself
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='YV12', filename_out=OUT)
a.convert()
ret = get_sha1(OUT, SIZE_420)
self.assertEqual(ret, 'c9120ccf583b410b75379c48325dd50ec8d16ce8')
示例4: test_2
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_2(self):
"""
YV12 -> UYVY
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='UYVY', filename_out=OUT)
a.convert()
ret = get_sha1(OUT, SIZE_422)
self.assertEqual(ret, 'f50fc0500b217256a87c7cd1e867da0c49c51ace')
示例5: test_21
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_21(self):
"""
convert YV12 into NV12
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='NV12', filename_out=OUT)
a.convert()
ret = get_sha1(OUT, SIZE_420)
self.assertEqual(ret, 'e24ac66dc32cff5dff16297dfaab761ab962143c')
示例6: test_13
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_13(self):
"""
YV12 -> YUY2
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='YUY2', filename_out=OUT)
a.convert()
ret = get_sha1(OUT, SIZE_420)
self.assertEqual(ret, '410b438c1aedc7e2ee6d68405f411bbfa8131b7a')
示例7: test_12
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_12(self):
"""
YV12 -> IYUV
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='IYUV', filename_out=OUT)
a.convert()
ret = get_sha1(OUT, SIZE_420)
self.assertEqual(ret, '385c87ed96b9298be9a410ff041fe4232b27a9aa')
示例8: test_4
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_4(self):
"""
YV12 -> UVYU -> YV12
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='UYVY', filename_out=OUT)
a.convert()
b = YCbCr(width=352, height=288, filename=OUT,
yuv_format_in='UYVY',
yuv_format_out='YV12', filename_out=OUT1)
b.convert()
ret = get_sha1(OUT1, SIZE_422)
self.assertEqual(ret, 'b8934d77e0d71e77e90b4ba777a0cb978679d8ec')
示例9: test_17
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_17(self):
"""
YV12 -> YVYU -> flip left-right
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='YVYU', filename_out=OUT)
a.convert()
a = YCbCr(width=352, height=288, filename=OUT,
yuv_format_in='YVYU',
filename_out=OUT1)
a.fliplr()
ret = get_sha1(OUT1, SIZE_422)
self.assertEqual(ret, 'a5bdbfdeb0259f6d0bd85ddd97d58f6fc7965ca9')
示例10: test_20
# 需要导入模块: from ycbcr import YCbCr [as 别名]
# 或者: from ycbcr.YCbCr import convert [as 别名]
def test_20(self):
"""
YV12 -> YVYU -> crop
"""
a = YCbCr(width=352, height=288, filename='foreman_cif_frame_0.yuv',
yuv_format_in='YV12',
yuv_format_out='YVYU', filename_out=OUT)
a.convert()
a = YCbCr(width=352, height=288, filename=OUT,
yuv_format_in='YVYU',
crop_rect=(0, 0, 15, 15),
filename_out=OUT1)
a.crop()
ret = get_sha1(OUT1, 512)
self.assertEqual(ret, '4bf3179e43e7ca6d490bf1d996dff84ef64be664')