Image binary interpretation: unknown image format

前端 未结 2 1270
無奈伤痛
無奈伤痛 2021-01-29 01:01

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

2条回答
  •  青春惊慌失措
    2021-01-29 01:15

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

    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.

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

提交回复
热议问题