Web-cam motion detection Java program

Hi every one
I’ve download COMPLETED MOTION DETECTOR CODE AND JAR FILE.zip
and already installed JMF and JRE and JDK but when i try to run the jar file
or
Try to build this using JDK it gave an error
like this can You help me i need this.
Exception in thread “main” java.lang.NoClassDefFoundError: javax/media/ControllerListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Caused by: java.lang.ClassNotFoundException: javax.media.ControllerListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
… 12 more
Could not find the main class: TestMotionDetection. Program will exit.

@iovva You’ve gotta look at the source code and modify it a bit. The class you need to make the modification in is the ‘MotionDetectionEffect’ class. The process method of this class is where the actual modification should be made. I know, there is a lot of code in this method(I didn’t understand much of it either), but the part you have to bother with is the part with the following ‘if’ control structure:

        if (detectionCounter > 10 && serverActive) {

When the expression of this ‘if’ statement evaluates to true, it means motion has been detected and the body of the ‘if’ statement proceeds to take a snapshot of the camera’s viewing area.
From there on my code was pretty well commented. You should be able to take over from there to answer your question. If you have anymore problems you can always ask.

@Abrarazeem Firstly, did you try running the executable jar file by double clicking the file or by using java -jar (NameOfExcutableJarFile) command in a DOS command prompt?

When you said ‘you tried building with the JDK’ I didn’t understand, because I’m not aware you can build a Java program, from the source files, using the JDK. I know about ‘compiling’ source files and ‘running’ .class files. You ‘build’ Java applications using Ant, with a build.xml file usually in the same directory as you source files.

Among the source code files that make up the motion detection program is a file called TestMotionDetection.java. This file has the main method, which I’m sure you know is where any Java program’s execution would start. Try ‘compiling’ this java file. Please let me know what happens. I really want to know.

thanks man i did that Now running everything fine i disabled “JSlider”
You did a nice job.
Just one question if i don’t want threshold(orange and yellow color at the motion areas)
The actual Motion effect how to disable that I just want Motion time that is saved on the Image(Nice).
Thanks again you really help me I Really need this one.

No problem. I didn’t write most of the code, myself. I got a lot of help which makes me want to give help also.
If I understood you correctly, you want a situation where there is motion detection but without the orange and yellow colors. You want just motion detection.
If this is what you then it is pretty simple to implement.

Open up the MotionDetectionEffect.java file. Within this file is the ‘process’ method where actual motion detection occurs. Within this method is an ‘if’ control structure that looks like this:

if(visualize){

If you comment out this if statement and its body you’ll get what you want. Please let me know your progress.

hi friends, i want to start work on JMF motion and i want to learn how to make application on this, pls guide me how can i start work on this should i start reading any book if yes than which book should i preferr… ??

Hi sanjay,
To do motion detection with JMF, you must first learn how to use JMF. To download some JMF books, follow this link http://www.ziddu.com/download/13564376/JMF.zip.html. Let me know if the link is not working

Cheers

i need coding of motion detection using web cam and saving of motion pictures in folder please send me the coding in java i need it urgently

Look through some of the comments above. One of them has a link to the code and executable jar file.

hi
thanks
link works in this coding motion is shown only i want to capure images and save it also for this i want that coding in which motion is detected and captured please send me the link for this coding in which motion is capured.see the attached link also

The above mentioned jar file all codes are working well but i need to capture images through web cam which are detected as motion detection please send me the modified code of web cam motion detection which detect motion and capture motion also.

thanks i got all the codes that i want i need jmf book in above mentioned link it is not available please mail me the book

please send me the data flow diagram of web cam motion detection on the basis of above mentioned jar file as soon as possible

please send me the data flow diagram of web cam motion detection on the basis of above mentioned jar file as soon as possible

@NPMD - Yes, JMF can work with netbeans

can anyone please give me the jmf tutorial that scooby mentioned in above link if you have the copy. i really need to learn how to program using jmf thanks.

http://www.ziddu.com/download/17882933/jmf_tutorial.pdf.html

i need data flow diagram of webcam motion detection project pls send me the diagram

Sorry, guys. I didn’t draw a flow diagram for the program. I can’t work up the courage to do it now. Again, I’m sorry.

thanks scooby it will give me a boost in creating programs…