Convert a Blackmagic Intensity Shuttle USB 3.0 Frame (10bppYUV format) into an OpenCV Mat object
I have to work with a Blackmagic Intensity Shuttle USB 3.0 device. I am, therefore, using the DeckLink SDK in order to set up the device and grab frames. I do this with success, establishing the option that allows the device to set himself to its "preferred output mode", that happens to be 1080i59.94 (I don't really care so much about the framerate yet). I obtain properly the IDeckLinkVideoInputFrame object, but I haven't been able to find a proper way to convert it to a Mat object. There seem to be nice ways to create the Mat object from raw frame data when it is 8bpp YUV or RGBA data, but I haven't been able to do it when the frame comes in 10bpp. Any idea or hint?
I need to create a Mat object to incorporate the data grabbed from this device into a pipeline that was developed some time ago, so, unfortunately, stop using OpenCV is not an option. Also, I use OpenCV 3.4.0 on C++11.
Thanks.
show us, how you grab your frame (code)
also, more information, what exactly is in your 10bit data, please !
I think you need to create a Mat with your raw data and convert mat object using cvtColor with one of this codes. You have to search YUV2 in last link.
The code is around 400 lines of C++, would it be useful? most of it deals with COM and the DeckLink SDK. I can access the raw data no problem, tried what LBerger said, but I can't find any suitable method for 10bpp YUV data. The format is what is given here:
https://imgur.com/6EXpABV
This packed stuff seems to be common in Television/Cinema formats. I don't know if I am confused, but I don't know which one in the list may seem suitable...
Does this one seem the correct one? COLOR_YUV2RGB_UYVY
ok, not your whole codebase, ofc. just the lines retrieving the data, and the w/h/c information.
Relevant piece of code (that does not work)
As I said, it does not work out for two reasons, because it is 10BitYUV and also the conversion I dunno...
do you know, how many bytes you get ?
i can only guess, but maybe: use
(also, next time, rather put your code / images into your question, not into comments ...)