LoginSignup
5
6

More than 5 years have passed since last update.

OpenCVでHoloLensの映像を共有する

Posted at

HoloLens Advent Calender 2018の10日目の記事です。

OpenCVでHoloLensの映像(Mixed Reality Capture)を共有してみましょう。
やり方は超簡単、OpenCVのVideoCaptureにネットワークURLを入れるだけ。
ユーザ名とパスワード、HoloLensのIPアドレスを挿入してください。

import numpy as np
import cv2

cap = cv2.VideoCapture("https://<UserName>:<Password>@<IP>:443/api/holographic/stream/live_low.mp4")

while(True):
    ret, frame = cap.read()
    cv2.imshow('frame',frame)
    key = cv2.waitKey(1) & 0xFF
    if key == ord('s'):
        cv2.imwrite("out.jpg", frame)
    if key == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

こんな感じ。
out.jpg

安定してるし、結構いいかも。

参考まで
- Microsoft HoloLens
- HoloLens デバイスポータルへ接続し、映像を確認する3つの方法

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6