视觉相似性搜索算法 [英] Visual similarity search algorithm

查看:162
本文介绍了视觉相似性搜索算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立这样一个 http://labs.ideeinc.com/multicolr , 但我不知道他们正在使用的算法,有谁知道?

I'm trying to build a utility like this http://labs.ideeinc.com/multicolr, but I don't know which algorithm they are using, Does anyone know?

推荐答案

他们所做的一切是匹配的直方图。

All they are doing is matching histograms.

因此​​,建立一个直方图图像。通过图像的尺寸规范化直方图。 A 直方图是一样多的元素颜色的载体。你不需要32,24,和精度甚至不是16位,这将只是你慢下来。出于性能的考虑,我将映射到4​​,8,和10-12位的直方图。

So build a histogram for your images. Normalize the histograms by size of image. A histogram is a vector with as many elements as colors. You don't need 32,24, and maybe not even 16 bits of accuracy and this will just slow you down. For performance reasons, I would map the histograms down to 4, 8, and 10-12 bits.

  • 请模糊最小距离比较的所有4位直方图和样品颜色之间。
  • 然后采取一套,做8位直方图进行比较。
  • 那么,也许上升到10或12位的直方图,其余组比较。这将是性能最高的搜索,因为你总集比较有极少数的计算,发现一小部分。
  • 然后你的工作与一些计算更高等的小的子集
  • Do a fuzzy least distance compare between the all the 4 bit histograms and your sample colors.
  • Then take that set and do the 8 bit histogram compare.
  • Then maybe go up to a 10 or 12 bit histogram compare with the remaining set. This will be the highest performance search, because you are comparing the total set with a very small number of calculations, to find a small subset.
  • Then you work on the small subset with a higher number of calculations, etc.

真正的大招是要找到匹配类似的直方图最好的算法。

The real big trick is to find the best algorithm for matching similar histograms.

  • 开始的距离计算。在3个维度,我认为它是:

  • Start with the distance calculation. In 3 dimensions i think it was:

SQRT((X1-X2)^ 2 +(Y1-Y2)^ 2 +(Z 1 -Z 2)^ 2)

SQRT((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2)

我从内存中这样做,所以找起来,以确保。

I'm doing this from memory, so look it up to make sure.

  • 你的目的,你将有超过3个维度,这样你才会有更多的条款。 4位直方图将有16项,8位一会256条款等记住,这样的数学是缓慢的,所以实际上没有做 SQRT 部分。如果您标准化您的图片的尺寸足够小,说下来到10000个像素,那么你知道你才会永远要做 X ^ 2 的值0..10, 0000。 pre-计算查找表X ^ 2 其中,X的距离0..10,000。那么你的计算会很快。

  • For your purposes, you will have more than 3 dimensions, so you will have more terms. A 4 bit histogram would have 16 terms, an 8 bit one would have 256 terms, etc. Remember that this kind of math is slow, so don't actually do the SQRT part. If you normalize the size of your images small enough, say down to 10,000 pixels, then you know you only will ever have to do x^2 for values 0..10,0000. Pre-calculate a lookup table of x^2 where x goes from 0..10,000. Then your calculations will go fast.

当您从调色板中选择一种颜色,只要与颜色= 10,0000直方图。当选择2,请用直方图颜色1 = 5000,颜色2 = 5000等。

When you select a color from the palette, just make a histogram with that color = 10,0000. When select 2, make a histogram with color1=5000, color2=5000 etc.

在最后,你将不得不在忽悠因素都会使应用程序符合真实的世界,但你会发现,这些与测试。

In the end you will have to add in fudge factors to make the application match the real world, but you will find these with testing.

这篇关于视觉相似性搜索算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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