实时图像匹配的最佳方式 [英] Best way of image matching in real time

查看:126
本文介绍了实时图像匹配的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要你的帮助。好的,让我解释一下。例如我的hv游戏。它是500x500像素。显示随机图片。当有一个微笑的狗的确切图像,你需要在1秒内按空格。



所以基本上我需要一个最快,最可靠,最有效(在术语上)性能)方式:



实时扫描500x500区域(每秒十次)。如果这个区域内的图像是微笑狗的精确图像 - 按空格键。如果图像刺穿这个区域是别的 - 什么都不做。那么伙计们,你会怎样做,尽可能快,可靠,高效(在性能方面)?



我应该将扫描区域与目标图像逐像素?或者我应该比较特定颜色的百分比?或者我应该拍摄扫描区域的屏幕截图并在比较之前将其缩小到50x50像素,并将其与缩小的目标图像进行比较,这样会更快?或者最好不要缩小它们,但是要比较每个第10或第5个像素并逐渐进行(比较第一个像素,如果它与目标图像相同 - 然后比较第二个像素。如果不是,请等到下一个图像,或下一次扫描事件并再次扫描第一个像素)?收缩会大幅减缓整个过程还是没有?如果萎缩是我的情况下使用的好工具,那么缩小的algorythm最快的是什么?你怎么看?哪个像素计算algorythm使用?逐一?但请记住,它应该是实时工作的!



Ty in advnace。如果可能的话,请在你的答案中添加一个半详细的解释,比如你将使用哪种语言,哪个库,哪个函数等:)



编辑:发现有趣的想法,你觉得怎么样?



我有一个想法,它可以工作,而且很可能非常快。你可以对图像进行二次采样说80x60分辨率或相当,并将其转换为灰度(在二次采样之后它会更快)。处理您想要比较的两个图像。然后运行两个图像(查询图像和每个来自数据库)之间的平方差的归一化和,或者如果两个图像都相似,那么甚至更好的归一化交叉相关,它会使响应接近1。



此外,我需要这个应用程序才能在Windows和Mac OS上工作。< br $> b $ b

我的尝试:



------- ------------------------------------------------

解决方案

也许你可以使用这个Python项目Windows,Linux和Mac上的ks:

GitHub - ageitgey / face_recognition:世界上最简单的面部识别API,用于Python和命令行 [ ^ ]


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:

-------------------------------------------------------

解决方案

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[^]


这篇关于实时图像匹配的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆