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 


Comparing Pictures In C

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author 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: Mon Aug 20, 2007 2:40 pm    Post subject: Comparing Pictures In C Reply with quote

If anyone knows how, can you please tell me how to take a picture and compare it to another picture, to find what part of the picture it is, in ANSI C. For instance, if you had a picture of an island, and another picture of a palm tree. And find out were the exact photo of the palm tree is in the picture of the island. I would also like to know, how to let a user upload a picture and use that to be found. Thanks.

Edit: 1137 post. That's close to 1337! Kinda. In a way.

_________________

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
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Aug 20, 2007 2:43 pm    Post subject: Reply with quote

memcmp
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: Mon Aug 20, 2007 2:47 pm    Post subject: Reply with quote

Thanks for the quick answer, but that just compares parts of two strings, how do you use that for a picture, and about the uploading?
_________________

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
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Aug 20, 2007 2:49 pm    Post subject: Reply with quote

It does not compare two strings, strcmp is for comparing two strings. You would map the pictures into memory and use memcmp on them.
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: Mon Aug 20, 2007 2:52 pm    Post subject: Reply with quote

Ok, thanks, I'll try reading up on it. If I have any problems, I'll ask. But remember, I only know very simple C. I don't even know pointers yet! If I understand everything, I'll try, and if I have any problems then, then I'll also ask! Anyway, thanks again!
_________________

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
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Mon Aug 20, 2007 7:41 pm    Post subject: Reply with quote

You don't know C. So your prificient in...delphi...asm...?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
--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 Aug 21, 2007 2:46 am    Post subject: Reply with quote

Nope, I know absolutely no delphi. As for asm, I have only learnt auto-assembly, as that is all I have had a need for, and, I would say, I was good at aa. I mean, I also know some languages which aren't really languages, but they are, such as, DOS, qbasic and a bit more than basic html.
_________________

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
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Tue Aug 21, 2007 7:19 am    Post subject: Reply with quote

Appalsap: memcmp won't work well for this, because of how the images wrap in memory, and the fact that you would have to do comparisons starting at every byte of the original image.

You would have to use bitmap library (it would be much harder with a compressed image format such as jpeg or png or gif) and compare the first pixel of the inset to each pixel of the original. Then if one matches, move on to the second pixel, continue until
A) test fails
B) image wraps

If the test fails pick back up one after the first pixel that was correct.
If the image wraps, start testing one pixel below the first pixel that was correct.

It might be sufficient to only test a few rows.

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
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 Aug 21, 2007 11:10 am    Post subject: Reply with quote

Well, with what I am thinking of, the initial picture is huge, but the smaller picture is only about 200 pixels tall. So then, how would you compare two pixels colours? How do you even find the colour of a specific pixel? Thanks.
_________________

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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
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