One of the options available when configuring the my ThinkPad was an
Infrared camera. The main selling point being "Windows
facial recognition based login. While I wasn't planning on keeping
Windows on the system, I was curious to see what I could do with it
under Linux. Hopefully this is of use to anyone else trying to get it to
The camera is manufactured by Chicony Electronics (probably a
or similar), and shows up as two USB devices:
04f2:b5ce Integrated Camera
04f2:b5cf Integrated IR Camera
Both devices are bound by the uvcvideo driver, showing up as separate
video4linux devices. Interestingly, the IR camera seems to be assigned
/dev/video0, so generally gets picked by apps in preference to the
colour camera. Unfortunately, the image it produces comes up garbled:
So it wasn't going to be quite so easy to get things working. Looking
at the advertised capture modes, the camera supports Motion-JPEG and
YUYV raw mode. So I tried capturing a few JPEG frames with the following
The advertised YUYV format encodes two pixels in four bytes, so you
would expect any repeating patterns to occur at a period of four bytes.
But the data in these frames seems to repeat at a period of five bytes.
Looking closer it is actually repeating at a period of 10 bits, or four
packed values for every five bytes. Furthermore, the 800 byte rows work
out to 640 pixels when interpreted as packed 10 bit values (rather than
the advertised 400 pixels), which matches the dimensions of the JPEG
The following Python code can unpack the 10-bit pixel values:
After adjusting the brightness while converting to 8-bit greyscale, I
get a usable image. Compare a fake YUYV frame with the decoded version:
I suppose this logic could be wrapped up in a GStreamer element to get
usable infrared video capture.
I'm still not clear why the camera would lie about the pixel format it
produces. My best guess is that they wanted to use the standard USB
Video Class driver on Windows, and this let them get at the raw data to
process in user space.
this is very interesting, I was wondering about this too - I am now
using Ubuntu on Thinkpad P51s!
Did you figure out how to tell apps to use the actual webcam instead of
Are you considering coding something up to make use of the IR?