convert YUY2 to openCV's BGR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

convert YUY2 to openCV's BGR

2,211 Views
weideding
Contributor II

I am using MX8MQ, never met these kind of troubles since from mx51,mx6 before, so discouraged.

My project has to convert camera's data YUY2 to BGR, which openCV needs for computer vision. gstreamer 'videoconvert' plugin SW way, it is too slowly, 400ms/frame for 1080P. 

Unfortunately, MX8MQ does not support 2D, it means we cannot use gstreamer plugin imxvideoconvert_g2d to convert by GPU hardware. Tried to use openCL over GPU, it was working, but reading data from GPU takes 70ms as I descibed in blew link:

use GPU openCL to convert YUY2 to RGB 

 

I tried to third way,  use VPU to get RGB from output, but VPU output format only supports YUV format(typical format NV12). If it is working, then i will do: camera YUY2->encode h264-> vpudec->BGR.  Is it possible to make VPU to output BGR instead of NV12?

I know MX8MQ does not support encode h264 by VPU, only has to use SW.  It will also take much cpu.

0 Kudos
2 Replies

1,888 Views
weideding
Contributor II

I already had this docs and source code, thanks. But not found useful information from those. 

why does execute clEnqueueReadBuffer need so long time? > 70ms

0 Kudos

1,890 Views
igorpadykov
NXP Employee
NXP Employee

Hi Weide

one can look at SoftISP application note

https://www.nxp.com/docs/en/application-note/AN12060.pdf 

and OpenCL examples

gtec-demo-framework/DemoApps/OpenCL/SoftISP at master · NXPmicro/gtec-demo-framework · GitHub 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos