Cameras & sensorsExplainer

Why a RAW sensor cannot be a UVC camera

UVC delivers host-ready YUV and MJPEG frames and defines no RAW Bayer format. See the compatibility limits, the acquisition paths to use and a USB3 link budget.

LumaSpec Vision9 min read Share on LinkedIn

On this page 8 sections
  1. 01What UVC promises: frames the host can already decode
  2. 02What RAW output is: the sensor before anyone touches it
  3. 03Why a RAW sensor cannot be a UVC device
  4. 04What a 3.1 MP sensor at 120 fps costs on a USB3 link
  5. 05The acquisition paths that work
  6. 06What to check before you order
  7. 07When a UVC camera is the right answer
  8. 08Questions

Plug a raw-output board camera into a PC, start OpenCV, and no device appears. The sensor streams happily over its cable, but the computer was waiting for a UVC webcam, and this camera has nothing UVC can decode. This guide explains the mismatch: what the USB Video Class promises, what a RAW Bayer sensor delivers, and why no bridge can turn one into the other on the fly. You will leave with the acquisition path to plan around — vendor SDK, V4L2 driver, or GenICam over USB3 Vision or GigE Vision — plus a link budget that tells you whether your resolution and frame rate fit the bus.

What UVC promises: frames the host can already decode

UVC is the USB device class behind every plug-and-play webcam, maintained by the USB-IF. At start-up the camera declares the payload formats it can stream, and the class defines that list: uncompressed YUV such as YUY2, MJPEG, and compressed frame-based formats added in later revisions. Every mainstream operating system ships a UVC driver, so cv2.VideoCapture(0) opens the device with no vendor software, and each frame arrives display-ready.

That contract is also the limit. A UVC payload has already been processed: pixels demosaiced, white balance and exposure settled, often sharpened and compressed. The host never sees the sensor, only the finished image. Every format carries an identifier the host already knows how to render, and the defined list contains no Bayer pattern, so a raw stream has no legal name in this class.

What RAW output is: the sensor before anyone touches it

A raw stream is the sensor readout with one colour sample per pixel in a Bayer mosaic, packed at 8, 10 or 12 bits. It is not an image yet. Converting it takes demosaicing plus black-level subtraction and per-channel gains, on the host. Darkness is not even zero DN: sensors carry a black-level offset you remove first, which the raw 12-bit black-level guide works through.

Machine vision buys raw on purpose. An in-camera ISP adjusts white balance and sharpening frame by frame, which a calibrated measurement cannot tolerate; raw pixels plus a fixed host pipeline stay identical across cameras and across months. A CSI camera with no ISP delivers exactly that, and even a UVC camera's raw sensor data stays hidden behind its processed output.

Why a RAW sensor cannot be a UVC device

To appear as UVC, a device must declare a payload format the host can render. A raw sensor has four ways out, and each fails:

  1. Demosaic in the device. This needs an ISP on the bridge, and the moment one is added the product ships processed pixels — the buyer who chose raw did so to avoid exactly that.
  2. Compress to MJPEG. Encoding a debayered frame still requires the ISP first, and compression artefacts land on calibrated pixels.
  3. Label the raw bytes as YUY2 or mono. Standard software sees a device and renders noise; only your own demosaicing code makes an image, and the arrangement stops being interchangeable.
  4. Extend the class with a private format. That needs a custom driver on every host it touches, which removes the one thing UVC exists to provide: driver-free operation.

RAW and UVC are different products by design, not an oversight in anyone's firmware. If a listing says the camera outputs raw sensor data, it will not enumerate as a UVC camera, however ordinary the USB connector looks.

The example uses this class of part:

Board-level cameras3.1 MP USB3 board-level camera, IMX252, 1/1.8" global shutter, 120 fps (LS-BCM-0003)LS-BCM-0003
Sensor format
1/1.8"
Lens mount
C-mount
Interface
USB3
Resolution
5 MP
$690.00View partBuild a system with it

Inputs, each with a source: 3.1 MP and 120 fps are the part's printed specification; RAW8 carries 1 byte per pixel and YUY2 carries 2 by format definition; MJPEG lands near 10:1 in practice, typically 8:1-15:1 with quality settings; and USB3 signals at 5 Gbps, leaving about 3.2 Gbps (roughly 400 MB/s) for payload after 8b/10b line coding and packet overhead.

The rule: payload bandwidth equals pixels × bytes per pixel × 8 bits × frames per second.

payload [Mbps] = Mpx × bytes per pixel × 8 × fps

Arithmetic:

  • RAW8: 3.1 Mpx × 1 B × 8 × 120 fps = 2,976 Mbps ≈ 2.98 Gbps (372 MB/s)
  • YUY2: 3.1 Mpx × 2 B × 8 × 120 fps = 5,952 Mbps ≈ 5.95 Gbps
  • MJPEG at 10:1: 5.95 Gbps ÷ 10 ≈ 0.60 Gbps

The raw stream fits the bus with about 7% headroom, 2.98 of 3.2 Gbps. At 10 bits the payload grows 25% to 3.72 Gbps and no longer fits; the same sensor would run near 100 fps. A YUY2 version would demand 5.95 Gbps, about 1.9× the bus, capping the camera near 64 fps even if an ISP existed to feed it. MJPEG fits but abandons calibrated pixels. The raw-first design is what makes 120 fps possible at all, and it is why the device cannot also be a UVC camera without giving up its headline number.

The same arithmetic on GigE: a 1 Gbps link carries about 950 Mbps of payload after Ethernet and protocol overhead, so this sensor tops out at 950 ÷ (3.1 Mpx × 8) ≈ 38 fps. USB3 buys the frame rate; GigE buys cable length and multi-camera networking.

The acquisition paths that work

Four routes deliver raw frames to your code:

  1. Vendor SDK over USB3 Vision or GigE Vision. Industrial area scan cameras and raw board modules speak GenICam; the SDK hands you full-resolution raw buffers plus control over exposure, gain and black level. This is the default route for measurement work.
  2. V4L2 with a kernel driver. On Linux, the vendor driver or the platform CSI driver exposes the sensor with raw pixel formats such as RG10. Capture with v4l2-ctl or your own code: the v4l2-ctl raw Bayer RG10 capture guide shows the commands, and the V4L2 raw capture hang diagnosis covers the timeout that follows a mismatched format. Not every USB3 device has a V4L2 driver; the acquisition-path chooser decides when the SDK route wins.
  3. MIPI CSI into a hardware ISP. On embedded boards the ISP demosaics in silicon and hands the application YUV or RGB. You save CPU and lose raw control; the MIPI platform compatibility guide explains what decides support.
  4. Debayer in OpenCV. Whichever route delivers the buffer, one documented call converts it:
import cv2
import numpy as np

raw = np.empty((1536, 2048), dtype=np.uint8)      # example buffer: 2048 x 1536 = 3.1 MP frame
color = cv2.cvtColor(raw, cv2.COLOR_BayerBG2BGR)  # documented OpenCV Bayer conversion
assert color.shape == (1536, 2048, 3) and color.dtype == np.uint8

raw and color are this example's own variables, declared with shape and type; cv2.cvtColor and COLOR_BayerBG2BGR are documented OpenCV names, and the assert is the test. Four Bayer codes exist, so when neutrals render green or magenta, the chosen order is wrong. OpenCV reads UVC webcams directly through its V4L2 backend; these extra steps exist because a raw module never registers as one.

What to check before you order

Run this list before the order goes in:

  • Interface promise. Does the listing say UVC, meaning a YUV or MJPEG device, or raw, meaning an SDK or driver? If vendor software is named, the device is not UVC; the board camera host compatibility guide walks that match.
  • Bit depth. 8-bit raw debayers anywhere; 10- or 12-bit needs SDK or driver support end to end, plus black-level handling.
  • Bandwidth. Run the payload formula at your frame rate and keep margin on a shared bus; the board camera evaluation checklist carries the same test.
  • Optics. Sensor format and mount decide the lens; the M12 and M6 mount guide covers the thread sizes.

Two GigE raw modules sit at different points of the resolution-speed trade:

Board-level cameras6.3 MP board-level camera, IMX178, 1/1.8" rolling shutter, 18 fps (LS-BCM-0020)LS-BCM-0020
Sensor format
1/1.8"
Lens mount
CS-mount
$290.00View part
Board-level camerasHikrobot MV-CB016-10GM-M-W 1.6 MP GigE board-level camera, IMX296, Mono, M12 lens mount, WTB GigE portMV-CB016-10GM-M-W
Sensor format
1/2.9"
Lens mount
M12
$559.00View part

When a UVC camera is the right answer

Raw is the default for measurement, calibration-heavy pipelines and multi-camera rigs. For display, recording and prototypes, a UVC camera gets you running sooner: it enumerates driver-free on every major OS — the driver-free UVC board setup shows how far that alone carries a project — and the module's ISP handles demosaicing, white balance and exposure. The cost is control: auto exposure and white balance can move pixel values between frames, while the raw data stays locked inside the pipeline.

The decision is one question: do you need calibrated pixels? If yes, buy the raw camera and plan the SDK or V4L2 route from day one. If no, a UVC device removes the integration step entirely. Compare the board-level cameras in the camera finder, start the configurator at the camera step, or browse the cameras topic page for the rest of the camera-side guides.

Questions

How do I open a RAW board camera in OpenCV?

Capture the buffer with the vendor SDK or the V4L2 driver first, then debayer it with a documented cv2.cvtColor call. If neutrals render green or magenta, step through the four Bayer conversion codes until colours look natural; the pattern order differs per sensor. A plain UVC-style VideoCapture will never list the device, because the class defines no payload format for the stream.

Do any UVC cameras output raw Bayer?

Not as a defined class feature. A few industrial USB modules register the raw stream under a YUY2 or mono label, so standard software sees a device and opens it. The bytes are still Bayer, and only your own demosaicing makes them an image. Treat it as a vendor-specific arrangement: swap modules and the acquisition code changes with them.

Can a GigE camera be a UVC device?

No. UVC is a USB device class, so it exists only on USB connections. A GigE camera speaks GigE Vision over Ethernet and needs a GenICam-based SDK or filter driver. The reward is a different set of strengths: longer cable runs, standard switches and clean multi-camera networking that a shared USB host controller cannot match.

What bit depth can UVC carry?

The standard uncompressed UVC payloads are 8-bit-per-sample YUV formats, and MJPEG compresses 8-bit frames. A sensor outputting 10- or 12-bit Bayer therefore has a second reason to live outside the class: those depths only travel intact over an SDK, V4L2 or GenICam link, where you also handle black level and channel gains yourself.

Does an ISP chip turn a raw sensor into a UVC camera?

Yes, if the module converts its stream to YUV or MJPEG before the USB side, it enumerates as an ordinary webcam and every standard tool opens it. The trade is control: demosaicing, white balance and exposure are fixed inside the module, so calibrated pixel values and manual per-channel gains are gone. Choose it when display matters more than measurement.