In [1]:
import sys
print(sys.version)
#this needs to be python2!!
#if it is not 'sudo gedit /usr/local/share/jupyter/kernels/python2/kernel.json' and explicitly change argv to python2
In [2]:
#perhaps enforce using the plain ubuntu install, instead of the ros install of opencv
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
In [3]:
import cv2
import numpy as np
In [5]:
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',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
In [ ]:
import ../../rai/rai/libry as ry
In [5]:
import sys
sys.path.append('../../rai/rai/ry')
import libry as ry
In [ ]: