I have been asked to make a simple application that uses a motion detection algorithm.
I was able to successfully think of one, but i had a hard time getting the tools for it to work.
My simple understanding is as follows.
To detect motion you need to compare two frames for a change.
Each stream of frames (Video in my case) contains of several frames that are displayed with a certain timer.
Each frame has two dimensional array of pixels.
Each pixel holds the data of red, green and blue color levels and of course its position.
Color (Red, Green or Blue) data is mostly represented in an 8-bit representation ranging from 0 to 255 color level , giving a total of 256*256*256 with total possible display colors of 16777216.
The Basic application idea is to.
Get a video file (no camera available) (done using xuggle)
Convert video to array of images (do not care about timing as i am not going to play it again) (problem)
In a loop of total frames count/2 a frame [t] will be compared with a frame [t+1] for change. (not yet done)
Get the pixels  data of a frame to compare. (not yet done)
Incase of change more than 5% a new line will be wrote saying that in the frame number t+1 there was a XX% of change (This is the motion detection).
As i am fairly new using java , right now i am stuck in the second step, I would really appreciate any help as i want to finish this tonight.
This is my fail trial
This is xuggler's xuggle library.