0

Im currently looking to building a simple application.

I've had a look at other application and stack overflow questions which dont seem to help.

I want to make the application use the build i web camera to take a image and show in in a swing gui.. Then take a another picture say 2 seconds later.. Check if its the same as the first and discard it if its else show it?

I have the following questions:

  • What libairys to i need to use to grab pictures from my webcam?
  • How do i dertimine when the picture has changed i.e. take a picture compare it to last save if its any differnt?

Is there away to do this easily and not use lots and lots of libarys?

Is there any example/simple code out there?

Lemex
  • 3,772
  • 14
  • 53
  • 87

2 Answers2

5

To grab the picture take a look at How to capture video from webcam(in java)?

Have a lot of examples about hoe to find differences between two images, google it:

Java Image Comparison / Motion Detection

You can use Java Media Framework, OpenCv...

I think that this gitHub project can help you a lot sarxos/webcam-capture

Community
  • 1
  • 1
Rangel Preis
  • 394
  • 1
  • 7
  • Cant seemt o get it working using sarxos/webcam-capture – Lemex Apr 19 '13 at 14:11
  • The sarxos/webcam-capture does have motion detector feature which will tell you that there was a change in the scene. Please check this link for details (there are 3 examples for motion detection) and/or create the ticket in project on Github if you have problems with that: https://github.com/sarxos/webcam-capture/tree/master/webcam-capture/src/example/java – Bartosz Firyn Nov 15 '13 at 19:40
1

you can use lti-civil library,completely written in java for capturing images from webcam.For comparing two images you should write some image matching algorithms. Another alternative is javacv (java wrapper for openCV) which can be usefull for grabbing images from webcam as well as compairing two images.

Imrank
  • 1,009
  • 5
  • 15