LoginSignup
6
6

More than 5 years have passed since last update.

Python,OpenCVのカメラキャプチャ

Last updated at Posted at 2015-11-24

基礎的なことであるが忘備録として

使用環境

Mac OSX El Capitan
OpenCV3.0.0
Python2.7.10

変更予定

capture.py

import numpy as np
import cv2

# カメラ指定
cap = cv2.VideoCapture(0)

while(True):

# Capture frame-by-frame
ret, frame = cap.read()

# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

# Display the resulting frame
cv2.imshow('frame',rad)
if cv2.waitKey(1) & 0xFF == ord('q'):
    break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
6
6
2

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
6
6