I will work in future with a YUV Camera and my aim is to display the pictures in a fast way and use opencv functions.
I already used the Capture function of jetson-inference for decode mp4-videos. My question is now concerning this link jetson-inference/aux-image.md at master · dusty-nv/jetson-inference · GitHub under “IMAGE FORMAT”. There it is said that a “variety of other format are defined for image acquisition” including YUV fomats.
But also the Capture function of jetson-utils just accepts RGB formats.
That is my question. Can the Capture function can be fixed that it accepts YUV formats?
If NOT: What would be another approach to reach my aim? If anyone is experienced with that, I am very glad to get more information of how fixing this.
Hi @user152011, jetson-utils should handle cameras that transmit video in YUV formats, and typically it converts these to an RGB/RGBA format in the Capture() function. Are you saying that you want the YUV data returned from Capture() ?
Seeing as cudaConvertColor() doesn’t support converting YUV formats to other YUV formats (only YUV->RGB/RGBA), I would request the original YUV format the pipeline uses such that no colorspace conversion is required.
Thank you for your answer! First of all it seems to be good news! But I have to try! I will reply here if the topic will be still open (It could take more than 14 days).
Yes. So the input is YUV 4:2:2 and in the end I would like to have to have a YUV format that can be split in 3 channels by OpenCV. But if I understand your last sentence correctly, it is not possible to convert YUV 4:2:2 into such a more handy YUV format, right?
Does it mean that I have to comment the marked line 435 and instead I return the latestYUV which has then the YUV 4:2:2 format? But then I don’t receive YUV in 3 channels, do I?
It appears in the source of cudaConvertColor(), there is RGB/RGBA → I420 and RGB/RGBA → YV12 implemented. There is no cross-YUV conversion, but you could request RGB8 for example from Capture(), then use cudaConvertColor() to convert it to I420/YV12 if those are friendlier formats for you.
The CSI and hw decoder elements use NV12 so it skips the temporary format conversion by reading it directly.