Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[c++]how to detect image from screen
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Mon Jun 16, 2008 4:00 pm    Post subject: [c++]how to detect image from screen Reply with quote

i was wondering if its possible to
detect a small image when it appares on the screen
using c++.

lets say i have copied a dog image(30x30 pixel). i want to detect that same image when it reappears on the screen and make a beep.

any idea?

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Jun 16, 2008 4:15 pm    Post subject: Reply with quote

Unless there's some API that I don't know about, you'd probably have to loop through the screen and compare the pixels you got from there to your image.

It'd probably be a pretty slow process.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Mon Jun 16, 2008 4:20 pm    Post subject: Reply with quote

Using Auto Hotkeys might be easier, unless it if for your trainer....

Then I would make an array and add the bytes of each pixle into it. Then I would take an array the same way of the screen, then compare them for a similar section. Then have it retreave the upper most sections position.

Or you could search for 3 or 4 distinctive pixles to improve the speed...
_____________________________________________________________

I have no experience with this, just saying how I would go about doing it...
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Jun 16, 2008 4:27 pm    Post subject: Re: [c++]how to detect image from screen Reply with quote

Bizarro wrote:
i was wondering if its possible to
detect a small image when it appares on the screen
using c++.

lets say i have copied a dog image(30x30 pixel). i want to detect that same image when it reappears on the screen and make a beep.

any idea?


Nope...unless u do what samuri25404 said....

Does this by any chance, detect the position of a monster?

If so I tried to do that already....and it is hard XD
Back to top
View user's profile Send private message Send e-mail
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Mon Jun 16, 2008 4:30 pm    Post subject: Reply with quote

same here i havent done this before.
the only method i can think of is using pixel detection

get 3-4 pixel points of that image with pre-defined x/y difference. then scan the whole screen every 2-3 sec.
but in my opinion, thats not a very efficient way of coding....

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Jun 16, 2008 5:40 pm    Post subject: Reply with quote

Set/GetPixel are SLOW.

Look into using bitmaps, it will be MUCH faster.
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Jun 16, 2008 6:50 pm    Post subject: Reply with quote

Bizarro wrote:
same here i havent done this before.
the only method i can think of is using pixel detection

get 3-4 pixel points of that image with pre-defined x/y difference. then scan the whole screen every 2-3 sec.
but in my opinion, thats not a very efficient way of coding....


I tried this with ACTools and it took like 20 seconds per scan lol...but this was like 15 versions ago.

If you are trying to detect the position of monsters, maybe I can help you in other areas of coding?
Back to top
View user's profile Send private message Send e-mail
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Mon Jun 16, 2008 7:19 pm    Post subject: Reply with quote

Start at the corner of the screen and start looking for the first pixel of the image you're searching for. If they match, check the next pixel on the screen for the next pixel in the image and so on. If they don't match, check the next pixel for the first pixel of the image.
_________________
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Jun 16, 2008 7:37 pm    Post subject: Reply with quote

I'd say look into actually hacking the game.

Find the collection of mob structures, and what not.

You'll probably earn a decent amount of respect if you don't get spoonfed that. :wink:

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Mon Jun 16, 2008 8:44 pm    Post subject: Reply with quote

why would i detect mob using pixel... thats just simply stupid...
considerinng how many monsters in a map.

im detecting something uncommon but yet important


slovach wrote:
Set/GetPixel are SLOW.

Look into using bitmaps, it will be MUCH faster.


do u have any idea any api for this?

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Jun 16, 2008 10:16 pm    Post subject: Reply with quote

Bizarro wrote:
why would i detect mob using pixel... thats just simply stupid...
considerinng how many monsters in a map.


Then get it from the memory.

Anything in the graphics can be found in the memory much more efficiently.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Tue Jun 17, 2008 11:03 am    Post subject: Reply with quote

samuri25404 wrote:
It'd probably be a pretty slow process.

Or a high one with a high cpu usage. For example, you could speed the process up by 4 times, by using 4 threads, each one scanning a quarter of the screen over and over. However, you could use multiple threads like stated above if you don't mind your program raping people's cpu.

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed Jun 18, 2008 10:45 am    Post subject: Reply with quote

--Pillboi-- wrote:
samuri25404 wrote:
It'd probably be a pretty slow process.

Or a high one with a high cpu usage. For example, you could speed the process up by 4 times, by using 4 threads, each one scanning a quarter of the screen over and over. However, you could use multiple threads like stated above if you don't mind your program raping people's cpu.


hehe thats a good idea:P
i just heard ppl actually selling this program (in a USB) for money.
you specify which image u want to detect. if it appears on screen, alarm will sound

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Wed Jun 18, 2008 11:43 am    Post subject: Reply with quote

Well, there you go then. You could let the user set the accuracy, which would be how many pixels to go right each loop, using a slider.
_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
Cx
Master Cheater
Reputation: 0

Joined: 27 Jul 2007
Posts: 367

PostPosted: Wed Jun 18, 2008 10:44 pm    Post subject: Reply with quote

Bizarro wrote:
--Pillboi-- wrote:
samuri25404 wrote:
It'd probably be a pretty slow process.

Or a high one with a high cpu usage. For example, you could speed the process up by 4 times, by using 4 threads, each one scanning a quarter of the screen over and over. However, you could use multiple threads like stated above if you don't mind your program raping people's cpu.

hehe thats a good idea:P

No it's not. >__>
--Pillboi-- wrote:

a high cpu usage.

_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites