Results 1 to 14 of 14
- 01-30-2012, 09:30 PM #1
Member
- Join Date
- Dec 2011
- Posts
- 31
- Rep Power
- 0
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.
- 01-30-2012, 10:05 PM #2
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..gif)
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.
- 01-30-2012, 10:23 PM #3
Member
- Join Date
- Dec 2011
- Posts
- 31
- Rep Power
- 0
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.
- 01-30-2012, 10:25 PM #4
Re: Question about Finding Moving Images.
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!
- 01-30-2012, 10:30 PM #5
Re: Question about Finding Moving Images.
Last edited by santa; 01-30-2012 at 10:32 PM.
- 01-30-2012, 10:37 PM #6
Re: Question about Finding Moving Images.
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.
- 01-30-2012, 10:48 PM #7
Member
- Join Date
- Dec 2011
- Posts
- 31
- Rep Power
- 0
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.
- 01-30-2012, 11:21 PM #8
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
- 01-30-2012, 11:30 PM #9
Member
- Join Date
- Dec 2011
- Posts
- 31
- Rep Power
- 0
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
- 01-30-2012, 11:36 PM #10
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
- 01-31-2012, 12:44 AM #11
Re: Question about Finding Moving Images.
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!
- 01-31-2012, 12:45 AM #12
Re: Question about Finding Moving Images.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 01-31-2012, 01:30 AM #13
- 01-31-2012, 08:52 AM #14
Similar Threads
-
Displaying moving images
By Maulik in forum AWT / SwingReplies: 3Last Post: 04-02-2011, 12:00 AM -
Images not moving Please help!!!
By reborn567 in forum New To JavaReplies: 11Last Post: 11-09-2010, 05:25 PM -
ordering moving images in swing
By IAnkit in forum AWT / SwingReplies: 2Last Post: 09-21-2010, 03:56 PM -
[Applet] Clicking images & moving them.
By Perfectworld in forum Java AppletsReplies: 17Last Post: 01-16-2010, 08:09 AM -
Moving Images in JPanel
By killpoppop in forum AWT / SwingReplies: 7Last Post: 03-08-2009, 02:54 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks