Created
October 27, 2017 16:47
-
-
Save lubosz/900b224bf3b6d3ec1b4fd95d1f9ce2be to your computer and use it in GitHub Desktop.
How to decode MS Mixed Reality headset IR camera signal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# v4l2-ctl --device /dev/video1 --stream-mmap --stream-to=frame.raw --stream-count=1 | |
import numpy as np | |
import os | |
import cv2 | |
fd = open('frame.raw', 'rb') | |
cols = int(1280) | |
rows = int(481) | |
f = np.fromfile(fd, dtype=np.int8,count=rows*cols) | |
im = f.reshape((rows, cols)) | |
fd.close() | |
cv2.imshow('Yo', im) | |
cv2.waitKey() | |
cv2.destroyAllWindows() | |
cv2.imwrite("frame.png", im) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment