Results 1 to 14 of 14
  1. #1
    JeffThomas is offline Member
    Join Date
    Dec 2011
    Posts
    31
    Rep Power
    0

    Exclamation Question about Finding Moving Images.

    How would I go about finding a moving image on my screen?

    The position is basically unknown since it seemingly moves at random around the monitor.

    I'm using a 1600x900 monitor(1,440,000 pixels/pixel locations) and basically I have the program constantly take buffered images and attempt to 'scan' through them looking for the image.

    Really, the end result is that I want to do a robot.mouseMove(locationoftheImageX, locationoftheImageY) to have my mouse cursor follow the image around the monitor.

    I've sent out a couple PM's about it. Maybe someone else has an idea of how to easily accomplish this without exploding the CPU

    Upd: Just looked up the Sprite Class in Java. Might be able to do something with it.
    Last edited by JeffThomas; 01-30-2012 at 09:52 PM.

  2. #2
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Question about Finding Moving Images.

    Well i did something similar to cheat in a game way back.
    To not explode the cpu you need to narrow the pixels being checked. For example you check one pixel in 1 a 10x10 block. Ex if you know that your looking for the like button on facebook. You know its size and you know the color of its pixels. So first you check 1 pixel in pos 5,5 and if its not the same color you move to pos 10,5 and check it there. And when you hit the correct color you read the area around the picture and compare it to what your looking for. Hope it makes sense.

    The bigger jumps you have the less stress on the cpu, but a bigger likely hood of missing the target.

    I don't think it's advanced java though, or were you waiting for an more advanced solution?
    Last edited by santa; 01-30-2012 at 10:12 PM. Reason: text added.

  3. #3
    JeffThomas is offline Member
    Join Date
    Dec 2011
    Posts
    31
    Rep Power
    0

    Default Re: Question about Finding Moving Images.

    Yea, that looks like it might be a good way to go about doing it, depending on how many passes I have to make over the entire screen. I might implement a neural network to have it recognize differing images as well.

    Also, maybe you could give me some examples of what 'advanced java' really means too avoid any future mix-ups.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,939
    Rep Power
    8

    Default Re: Question about Finding Moving Images.

    Quote Originally Posted by JeffThomas View Post
    I've sent out a couple PM's about it.
    Why? Please don't do that. You have a better chance of getting help if you just post your question publicly, plus other people can learn from what you find. Not to mention the fact that we have no idea what help you've already received, so we have no way to determine whether you still need our help, or if we're just wasting our time repeating advice you've already heard. We have lives and homework and plenty of other things to get to as well, so please don't waste our time.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Question about Finding Moving Images.

    Quote Originally Posted by JeffThomas View Post
    Yea, that looks like it might be a good way to go about doing it, depending on how many passes I have to make over the entire screen. I might implement a neural network to have it recognize differing images as well.

    Also, maybe you could give me some examples of what 'advanced java' really means too avoid any future mix-ups.
    I would but I still trying to figure that out myself. But I have a general guideline... If I have heard of it or know how to do it then its probably not advanced

    What is advanced for some might not be for others. I was thinking about my answer ;)
    Last edited by santa; 01-30-2012 at 10:32 PM.

  6. #6
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Question about Finding Moving Images.

    Quote Originally Posted by JeffThomas View Post
    depending on how many passes I have to make over the entire screen.
    Well the point would be that you adapt the "blocks" so that they fit what your looking for and you should get a hit every time because it should recurse through one frame before starting on the next.


    Also if you know the exact area of where the image will be. ex in a web browser there is no need for scanning the whole screen.
    Might increase the performance.
    Last edited by santa; 01-30-2012 at 10:41 PM.

  7. #7
    JeffThomas is offline Member
    Join Date
    Dec 2011
    Posts
    31
    Rep Power
    0

    Default Re: Question about Finding Moving Images.

    Thanks for the help, Santa.
    Also, Workman, I would appreciate it if you didn't waste my time and repeat the same information over again that you had already sent to me in a private message. I don't even think you read the actual question or fully understood it either.

  8. #8
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Question about Finding Moving Images.

    Np man. I'll probably be banned for helping you though . Luckily I didn't provide any example of how to do it because then the mods would have been pissed of

  9. #9
    JeffThomas is offline Member
    Join Date
    Dec 2011
    Posts
    31
    Rep Power
    0

    Default Re: Question about Finding Moving Images.

    Why? I ask these kind of questions all the time and the moderators are the ones that give me the most help. However, the people that pretend to be moderators usually don't help at all. lol

  10. #10
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Question about Finding Moving Images.

    Nah I was just joking because I got lectured by the moderators for helping a guy in this thread: Incorrect formulas

    Anyway good luck with your project

  11. #11
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,939
    Rep Power
    8

    Default Re: Question about Finding Moving Images.

    Quote Originally Posted by JeffThomas View Post
    Also, Workman, I would appreciate it if you didn't waste my time and repeat the same information over again that you had already sent to me in a private message. I don't even think you read the actual question or fully understood it either.
    I'm repeating what I said in the private message for exactly the reason I explained- so other people in the future can learn from what's being discussed here.

    And I sent you a link to a full program, including the source, that accomplishes your goal exactly. This goes against my general rule of not spoonfeeding, and now you come back with ingraciousness and a bad attitude. It's okay for you to waste our time, but not for us to "waste" yours explaining how to properly ask a question?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  12. #12
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,939
    Rep Power
    8

    Default Re: Question about Finding Moving Images.

    Quote Originally Posted by santa View Post
    Nah I was just joking because I got lectured by the moderators for helping a guy in this thread: Incorrect formulas
    You were only "lectured" because you spoonfed a solution to a poster who didn't really show any real effort. That's basically equivalent to doing somebody's homework for them- it doesn't help them, and will actually hurt them in the long run. Learn from it and move on.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  13. #13
    santa's Avatar
    santa is offline Senior Member
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    208
    Rep Power
    5

    Default Re: Question about Finding Moving Images.

    Quote Originally Posted by KevinWorkman View Post
    You were only "lectured" because you spoonfed a solution to a poster who didn't really show any real effort. That's basically equivalent to doing somebody's homework for them- it doesn't help them, and will actually hurt them in the long run. Learn from it and move on.
    I'm done discussing about it. I will just continue to help people until i get banned

  14. #14
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,197
    Rep Power
    19

    Default Re: Question about Finding Moving Images.

    Quote Originally Posted by santa View Post
    I'm done discussing about it. I will just continue to help people until i get banned
    Do you want some help with that?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Displaying moving images
    By Maulik in forum AWT / Swing
    Replies: 3
    Last Post: 04-02-2011, 12:00 AM
  2. Images not moving Please help!!!
    By reborn567 in forum New To Java
    Replies: 11
    Last Post: 11-09-2010, 05:25 PM
  3. ordering moving images in swing
    By IAnkit in forum AWT / Swing
    Replies: 2
    Last Post: 09-21-2010, 03:56 PM
  4. [Applet] Clicking images & moving them.
    By Perfectworld in forum Java Applets
    Replies: 17
    Last Post: 01-16-2010, 08:09 AM
  5. Moving Images in JPanel
    By killpoppop in forum AWT / Swing
    Replies: 7
    Last Post: 03-08-2009, 02:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •