[참고]


#test_openCV.py

import cv2

capture = cv2.VideoCapture(0)

while True:
    has_frame, frame = capture.read()
    if not has_frame:
        print('Can\'t get frame')
        break
    
    cv2.imshow('frame', frame)
    key = cv2.waitKey(3)
    if key == 27:
        print('Pressed ESC')
        break

capture.release()
cv2.destroyAllWindows()


[결과]

  • 데스크탑 PC(Windows10)로 인텔 리얼센스(D435) 연결 후 USB 카메라 영상 재생 확인
  • 노트북(Ubuntu16.04)에서는 cv2.VideoCapture(0)이 노트북 카메라 인식. cv2.VideoCapture(1)은 USB 카메라 인식
  • SDK 설치 없이 가능한지 확인 필요 (FLIR 카메라는 cv2.VideoCapture(1)로 인식 안 됨, 인텔 리얼센스, 로지텍 USB 카메라는 인식 됨)





+ Recent posts