Skip to main content

Posts

Showing posts from November, 2015

Capture the webcam video in Java with OpenCV

I am going to capture the video from webcam of the computer/laptop in our Java program. I am using OpenCV for this. For this first obtain a fresh release of OpenCV and extract it under some location like C:\opencv\. I am using version 3.0.0. Now, we will define OpenCV as a user library in Eclipse, so we can reuse the configuration for any project. Launch Eclipse and select Window –> Preferences from the menu. Navigate under Java –> Build Path –> User Libraries and click New.... Enter a name, e.g. OPENCV-3.0.0 for new library. Now select your new user library and click Add External JARs.... Browse through C:\opencv\build\java and select opencv-300.jar. After adding the jar, extend the opencv-300.jar and select Native library location and press Edit.... Select External Folder... and browse to select the folder C:\opencv\build\java\x64. If you have a 32-bit system you need to select thex86 folder instead of x64...