Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Need your help. Ok guys, let me explain. For example i hv game. It is 500x500 pixels. shows random pictures. When there is a exact image of smiling dog, you need to press space in 1 second.

So basicly i need a fastest, most reliable, most efficient (in terms of performance) way to:

Scan this 500x500 area in real time(one-ten times per second). If image inside this area is that exact image of a smiling dog - press spacebar. If image insade this area is something else - do nothing. So guys, how would you do it, to be as fast, as reliable and as efficient(in terms of performance) as possible?

Should i compare scan area to target image pixel by pixel? or should i for example compare percentage of particular colour? or maybe i should take screenshot of scanning area and shrink it down to 50x50 pixels before comparison, and compare it to shrinked down target image, so it would be faster? or maybe it is better to not shrink them down, but to compare every 10th or 5th pixel and do it gradualy(compare first pixel, if it is same as target image - then compare second pixel. if it is not, wait till next image, or next scanning event and scan 1st pixel again)? Would shrinking down drastically slow down whole process or no? If shrinking is good tool to use in my case, then what shrinking algorythm woudld be fastest? What do you think? Which pixel counting algorythm to use? One by one? But pls remember, it should work in real time!

Ty in advnace. If possible, pls add a semi detailed explanation in your answers, like which language you would use, which library, which function etc :)

EDIT:Found interesting idea, what do you think about it?

"I have an idea, which can work and it most likely to be very fast. You can sub-sample an image to say 80x60 resolution or comparable, and convert it to grey scale (after subsampling it will be faster). Process both images you want to compare. Then run normalised sum of squared differences between two images (the query image and each from the db), or even better Normalised Cross Correlation, which gives response closer to 1, if both images are similar."

Also i need this app to work on windows and mac os.

What I have tried:

-------------------------------------------------------
Posted
Updated 18-Feb-19 23:32pm
Comments
Richard MacCutchan 19-Feb-19 4:04am    
There are many image processing libraries around. Use Google to find them and choose the one that works best for you.
Richard Deeming 20-Feb-19 9:18am    
Is this a game you've written? In which case, surely you already know whether or not the trigger image is showing.

Or are you trying to write a cheat for someone else's game?

1 solution

Maybe you can use this Python project which works on Windows, Linux and Mac:
GitHub - ageitgey/face_recognition: The world's simplest facial recognition api for Python and the command line[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900