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 :o:
Upd: Just looked up the Sprite Class in Java. Might be able to do something with it.
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. :(think):
I don't think it's advanced java though, or were you waiting for an more advanced solution? :(blush):
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.
Re: Question about Finding Moving Images.
Quote:
Originally Posted by
JeffThomas
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.
Re: Question about Finding Moving Images.
Quote:
Originally Posted by
JeffThomas
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.:D: But I have a general guideline... If I have heard of it or know how to do it then its probably not advanced:D:
What is advanced for some might not be for others. I was thinking about my answer ;)
Re: Question about Finding Moving Images.
Quote:
Originally Posted by
JeffThomas
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.
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.
Re: Question about Finding Moving Images.
Np man. I'll probably be banned for helping you though :(think):. Luckily I didn't provide any example of how to do it because then the mods would have been pissed of:(whew):
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
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: http://www.java-forums.org/new-java/...-formulas.html
Anyway good luck with your project :D:
Re: Question about Finding Moving Images.
Quote:
Originally Posted by
JeffThomas
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?
Re: Question about Finding Moving Images.
Quote:
Originally Posted by
santa
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.
Re: Question about Finding Moving Images.
Quote:
Originally Posted by
KevinWorkman
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 :(emo):
Re: Question about Finding Moving Images.
Quote:
Originally Posted by
santa
I'm done discussing about it. I will just continue to help people until i get banned :(emo):
Do you want some help with that?
db