Last active
December 17, 2015 16:19
-
-
Save b-oern/5637673 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
System.out.println("Welcome to OpenCV " + Core.VERSION); | |
System.loadLibrary("libs/x64-" + Core.NATIVE_LIBRARY_NAME); | |
VideoCapture vc = new VideoCapture(0); // Funktioniert auch wenn man die NUmmer einer nicht vorhanden Webcam eingibt! | |
if (!vc.isOpened()) { | |
System.out.println("Auf Webcam konnte nicht zugeriffen werden"); | |
System.exit(1); | |
} | |
Mat mat = new Mat(); | |
if (!vc.retrieve(mat)) { | |
System.out.println("Keinen Frame bekommen"); | |
System.exit(1); | |
} | |
System.out.println("Frame erhalten"); | |
Highgui.imwrite("frame.jpg", mat); | |
System.out.println("Bye"); | |
System.exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment