Pixel Format YUV 422 Blackmagic

Hello Forum,

I have been using @fresla 's version of ofxBlackmagic with ofxImageRecorder to grab and save stills to the hard drive from a capture card. According to Blackmagic, the camera I’m using can output 10 bit YUV 4:2:2 raw , but I don’t know how to allocate that kind of pixel format. Also, after being saved the image should then be debayered, which I have no idea how to do, but I would like to grab the feed from the camera at the highest possible quality. Blackmagic documents very well all their products and I found this pdf about their raw, maybe you could give me a hand making sense of it; https://documents.blackmagicdesign.com/DeveloperManuals/BlackmagicMicroStudioCameraRawSDI/20180406-ed2af6/BlackmagicMicroStudioCameraRawSDI.pdf

Thanks a lot.

Hi,
you should be able to store the 10 bit data with an ofShortImage or ofShortPixels. The name Short might be a bit misleading but it is because it uses an unsigned short int ,which stores 16 bits, to store its data. Instead the regular ofImage or ofPixels use an unsigned char to store the data, which is 8 bits. I am not sure if ofxBlackmagic allows you to specify which type of data to use but you should take a look at its internal working.

Then, for debayering you can use openCv. The easiest ways is with ofxCv, which even comes with an example to do so.
hope this helps

I think it may be easier if you had 10bit RGB data, the colour conversion method for YUV in this addon is only for 8 bit images. The RAW SDI feed that you linked to is another format altogether and would require some more work for debayering before it is useable.

From the PDF:

TIP: Camera raw media formats are so named because they capture raw color space
data directly from the sensor. Raw image data cannot be displayed visually, and must
be debayered or demosaiced to convert the original raw data into image data that can
then be used in an image processing pipeline

Thanks a lot for your reply. I’m going to look around the addon and I’ll come back when I get something.

Thank you very much. I’ll try capturing the RGB images and keep you updated.

BTW, I was doing some tests about gamma handling that you can find here which can be useful to you since you have to convert from linear to srgb to view the images correctly.