Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: Motion detection simple application

  1. #1
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Motion detection simple application

    I'd start smaller. Write a simple program that compares two images and outputs the change percentage. Then from there you can add all the other bells and whistles.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!


  2. #2
    Junior Member
    Join Date
    Jun 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Motion detection simple application

    Quote Originally Posted by KevinWorkman View Post
    I'd start smaller. Write a simple program that compares two images and outputs the change percentage. Then from there you can add all the other bells and whistles.
    I think it will not be as hard , but i do not want to write something that will not work with the output i will be able to get from converting a video to a series of images.

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Motion detection simple application

    It's really up to you, but starting with my suggested small program will make it easier to help you debug, and it's directly translatable to your actual goal. Simply saying you're stuck and then attaching a .rar file isn't really giving us a lot to help you with, which is why I'm suggesting you create an SSCCE that simply examines two hardcoded images.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    Junior Member
    Join Date
    Jun 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Motion detection simple application

    Thanks for the help.
    But what i meant to say is that the problem is not in the comparison part , it is in the Video to Image[] part.
    But i will try to continue the other parts of it.

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Motion detection simple application

    Ah, I see. Then go the other way: create a simple program that does ONLY that step. Even that can be broken down into more steps. Which step is giving you trouble? Connecting to a video source? Converting the video into a data structure of images? Something else?

    Identifying the specific, smallest piece you need will at least help you focus your google searches.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    Junior Member
    Join Date
    Jun 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Motion detection simple application

    The application has worked on a series of stored jpg images as BufferedImage [].
    Thanks for the support.

    But i kind of have some tricky questions.
    What runs first?
    In a java what i know is that the first thing runs in a class is it constructor.
    Now in the Main class which contains the public static void main (String Args[]) method.
    Does the main method run first or the constructor of this method's class, Cause i was told that the first thing to be run in a java project is the public static void main() code, so i want to be sure about that.

    Also in one project i can have more than one public static void main() method in the same main library/package but on different classes , The question is how do i know which one is supposed to run , and how do i change that manually if i want to?


    Knowing that i am using Netbeans.

    Thank you.

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Motion detection simple application

    What runs first?
    Add println statements in all the places you are interested in and look at the order they are executed.

    how do i know which one is supposed to run
    You can have main() methods in all your classes. They are only used when you use the java command to start the execution of a class: java TheClassName will use the main() method in TheClassName.
    You should know which class you want to execute.

    i am using Netbeans.
    I have no idea how to configure an IDE to execute a class.
    If you don't understand my answer, don't ignore it, ask a question.

  8. #8
    Junior Member
    Join Date
    Jun 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Motion detection simple application

    Quote Originally Posted by Norm View Post
    Add println statements in all the places you are interested in and look at the order they are executed.
    Oh , ok

    Quote Originally Posted by Norm View Post
    You can have main() methods in all your classes. They are only used when you use the java command to start the execution of a class: java TheClassName will use the main() method in TheClassName.
    You should know which class you want to execute.

    I have no idea how to configure an IDE to execute a class.
    ok

Similar Threads

  1. Where to start for building a simple graphical application
    By IHeartProgramming in forum AWT / Java Swing
    Replies: 1
    Last Post: October 25th, 2012, 12:28 AM
  2. Replies: 2
    Last Post: June 13th, 2012, 02:57 PM
  3. How to write a simple automated reservation JAVA application
    By thekongss in forum Java Theory & Questions
    Replies: 3
    Last Post: November 30th, 2011, 12:31 AM
  4. Replies: 0
    Last Post: October 27th, 2011, 03:22 PM
  5. Replies: 2
    Last Post: March 23rd, 2011, 08:51 AM