图像二进制解释:未知图像格式 [英] Image binary interpretation: unknown image format

查看:140
本文介绍了图像二进制解释:未知图像格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有某种格式的图像(它的二进制表示形式,例如OpenCV的cv :: Mat或Android的YuvImage,未压缩),并将其数据解释为YUV NV21(嗯,这是示例由DJI SDK提供).这就是我所拥有的:

Let's say I've got an image of some format (its binary representation, say, cv::Mat from OpenCV or YuvImage from Android, not compressed), and interpreted its data as YUV NV21 (well, this was in example provided by DJI SDK, pretty much it). Here's what I've got:

据此,我认为原始格式不是NV21. YUV2? RGB888? RGB32?还有其他东西吗?

From this, I assume that original format is NOT NV21. YUV2? RGB888? RGB32? Some other stuff?

人们怎么会猜出二进制数据的原始格式是什么?

How would one guess what's the original format of the binary data?

如果有帮助,则从DJI无人机流中获取帧.

If that'll help, frame is taken from DJI drone stream.

推荐答案

好吧,最后,我们发现了图像处理方面的一些不一致之处.

Well, at the end, we've found some inconsistencies in image handling.

Android的YuvImage希望您将其与NV21配合使用,因此我有一种有效的从I420到NV21的转换方法.当我更改视频源(相同厂商,不同型号)时,我希望它具有相同的格式,但实际上,它是NV12.

YuvImage of Android expects you to feed it with NV21, so I had a working conversion method from I420 to NV21. When I changed a video source (same vendor, different model), I expected it to come with the same format, but, in fact, it was NV12 instead.

重新解释广播 NV12为I420,然后将其转换为NV21.

Reinterpret-casting NV12 as I420 and then converting it to NV21 is what happened here.

这篇关于图像二进制解释:未知图像格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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