由网友(我の世界、不需要谁来懂)分享简介:什么是最好的(最快)的方法来检查,如果一个小画面是在一个大的图片吗? (缩放图片:)想找到:Want to Find:我有一个解决方案,但它是非常缓慢的:I have a solution, but it is very slow:在我遍历在全局中的每一个像素(x,y)和比较小图片(色值)的像素(0,0)。如果...
什么是最好的(最快)的方法来检查,如果一个小画面是在一个大的图片吗?
(缩放图片:)
想找到:
Want to Find:
我有一个解决方案,但它是非常缓慢的:
I have a solution, but it is very slow:
在我遍历在全局中的每一个像素(x,y)和比较小图片(色值)的像素(0,0)。 如果像素是一样的,我遍历小图片,并与更大的一个比较。如果失败了,它可以追溯到大图扫描循环。此方法需要像〜7秒找到1600x1200分辨率照片的50×50照片。
this method needs like ~7 seconds to find a 50x50 pic on 1600x1200 photo.
也许你知道一个更好的算法?我知道它可以在第二个做到这一点的软件。
maybe you know a better algorithm? i know a software which can do this in under a second.
推荐答案
数学运算卷积的(其可以被有效地与快速傅立叶变换的实现)可以被用于此目的。
The mathematical operation convolution (which can be efficiently implemented with the Fast Fourier Transform) can be used for this.
相关推荐
最新文章