C# - 图像比较(快一) [英] C# - Image comparison (fast one)

查看:576
本文介绍了C# - 图像比较(快一)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我已经用了超过10万图像的数据库,他们是不一样的大小之类的东西,但我想为我的COMPAGNY以下内容:

At the moment I've got an database with over 100.000 images, they ain't the same size or anything like that but I want to make the following for my compagny:

我插入/上传图片,系统会返回这是最有可能在同一图像。我不知道用什么样的算法,但它必须要快。我可以预先过程中的所有其它图像,并把我在其中用于比较的数据库中的一些信息。

I insert/upload an image and the system returns the image which is most likely the same. I don't know what algorithm to use but it needs to be fast. I can pre-process all the other images and put some info in the database which I use for the comparison.

我想知道的最快方法是什么现在是什么图像比较(与被相同的图像一个很好的机会)。我要救什么样的数据到数据库中(我大概可以推测这一个自己,如果我得到的算法)。

Now what I want to know what the fastest way is to compare the images (with a good chance of being the same image). And what data I should save into the database (I could probably figure this one out myself if I got the algorithm).

它不应该采取更多然后5分钟上传的图像进行比较,以数据库中的所有图像。

It shouldn't take more then 5 minutes to compare the uploaded image to all the images in the database.

在此先感谢!

朱利安

www.tineye.com ,他们有某种我正在寻找算法。猜测他们使用了非常复杂的,我只需要一个做同样的事情,但用较少率更迭的。

Look at www.tineye.com, they have some kind of algorithm that I'm looking for. Guessing they use a very complex one, I just need one that does same thing but with lesser rate of succes.

推荐答案

的方式我会做到这一点是我生成你对每一个比较形象一个非常小的(说..原始图像大小的1/50)的图像,缩略图图像路径存储在数据库中的原始大小一起。我会保持缩略图未压缩BMP的速度和无损耗岬(我刚才提出这个词了!),因为他们是如此之小呢。

The way I would do it is I'd generate a really small (say.. 1/50 of the original image size) image from every image you're comparing against, and store the thumbnail image path along with the original size in the database. I'd keep the thumbnails as uncompressed bmp's for speed and loss-free-ness (I just made that word up!), since they're so small anyway.

来比较其他的新图片,缩下来了相同数额和像素,这对其他像素比较某一阈值(说..从原来的10%的差异)。

To compare your new image against the other ones, shrink it down by the same amount and compare it against the others pixel by pixel, with a certain threshold (say.. 10% difference from the original).

如果它通过测试,可以通过像素做一个完全成熟的像素比较的原始图像。

If it passes this test, you can do a full blown pixel by pixel compare against the original image.

编辑:我只是想指出,我之前也去了概率的方法。它的工作好,但建筑为图像元数据我花,并有大量的误报。出于本能,我认为本地计算平均值为图像的每个网格矩形(这是缩小图像下来一样)会给出类似的,如果没有更好的效果。

edit: I just want to mention that I went down the probabilistic way before too. It worked OK, but building the meta data for the images took forever, and there were a lot of false positives. Instinctively, I think that calculating local averages for each grid rectangle of your image (which is what shrinking your image down does) would give similar, if not better results.

这篇关于C# - 图像比较(快一)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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