fork download
  1. import numpy as np
  2. import cv2
  3.  
  4. cap = cv2.VideoCapture(0)
  5.  
  6. while(True):
  7. # Capture frame-by-frame
  8. ret, frame = cap.read()
  9.  
  10. # Our operations on the frame come here
  11. gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  12.  
  13. # Display the resulting frame
  14. cv2.imshow('frame',gray)
  15. if cv2.waitKey(1) & 0xFF == ord('q'):
  16. break
  17.  
  18. # When everything done, release the capture
  19. cap.release()
  20. cv2.destroyAllWindows()
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: '.' expected
import numpy as np
            ^
Main.java:1: error: ';' expected
import numpy as np
               ^
Main.java:2: error: '.' expected
import cv2
          ^
Main.java:4: error: ';' expected
cap = cv2.VideoCapture(0)
   ^
Main.java:7: error: illegal character: '#'
    # Capture frame-by-frame
    ^
Main.java:10: error: illegal character: '#'
    # Our operations on the frame come here
    ^
Main.java:13: error: illegal character: '#'
    # Display the resulting frame
    ^
Main.java:14: error: unclosed character literal
    cv2.imshow('frame',gray)
               ^
Main.java:14: error: unclosed character literal
    cv2.imshow('frame',gray)
                     ^
Main.java:18: error: illegal character: '#'
# When everything done, release the capture
^
10 errors
stdout
Standard output is empty