We are developing a scientific camera to get ultrasonic images. To connect the camera sensor to a PC (Windows 10) we use a Cypress FX3 processor which implements the USB3.0 connection, and currently we have implemented the USB Video Class (UVC) FX3 firmware to stream the data to the PC. So UVC over USB3.0. The camera is recognized by Window 10 and is seen as an UVC webcam. This all works using NI-IMAQdx but the image is translated from YUY2 to RGB32. Probably by DirectShow or Media Foundation. But we need the raw image.
So basically very much like the following issue https://forums.ni.com/t5/Machine-Vision/get-UVC-truly-raw-data/m-p/3614443
According to the answer to this question the DirectShow implementation on Windows prevents the access to the raw YUY2 data. However this seems to be available using Linux, which we will not be using.
According to https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019MEqSAM NI-IMAQdx supports USB 2.0 Cameras Supporting Microsoft DirectShow but also USB 3.0 Cameras Supporting USB3 Vision.
Instead of developing the UVC camera interface for the FX3, we could also implement USB3 Vision as an alternative. But this development has to be licensed for about $1750 USD per year, which is way too expensive for the extremely small series of products we might produce.
When using a small Labview program based on NI-IMAQdx we can read the bus type. Since the camera is currently using DirectShow is reports the bus type 0x64736877. According to https://forums.ni.com/t5/LabVIEW/IMAQdx-Enumerate-Cameras-bus-type-codes/m-p/3099126#M887102 the bus type for USB3 Vision equals 0x55534233. This list however also show the bus type IMAQdxBusTypeUVC = 0x55564320.
Does NI provide an alternative method or driver to connect an UVC device to IMAQdx without DirectShow converting YUY2 to RGB32?
Something like the NI-VISA USB driver but with full UVC support?
Or does there exists an alternative UVC Windows 10 driver which does not use DirectShow so the raw YUY2 data can be accessed? Or a different solution to get UVC raw data into Labview, even maybe without IMAQdx?
Solved! Go to Solution.
On Windows, the DirectShow implementation always converts to RGB32 format; sorry. In DirecShow terminology, the pin IMAQdx exposes is of that type, so Windows converts it before it hits IMAQdx.
The UVC reference you see is for Linux Real-Time systems (compact Rio, myRIO, etc). There the data does come into IMAQdx as YUY2, and it should be possible to get the raw data via the GetImageData VI.
if you want raw sensor data, even YUY2 is not what you want, since the sensors themselves capture color images in Bayer format generally. The YUY2 conversion is already a lossy conversion, and you’re not really losing anything more by going to RGB32. That said, I assume your ultrasonic data is not really color data, and your real goal is to just get raw depth information per pixel? In that case, it seems you really want a monochrome format.
USB3 Vision is definitely a better fit for this type of application, since there are a number of image formats supported, including higher bit depths for sensors. I understand the concerns about license cost though; though those exist to cover the costs of developing and maintaining the standard.