算法来检测图像中的另一图像与一些噪声 [英] Algorithm to detect an image in another image with some noise
问题描述
我在寻找最好的图书馆搜索同一区域在两个不同的图像,所有图像被COM pressed JPEG格式,具有很大的噪音。我有一个很难找到的。现在的问题是,如果你放大一个JPEG,你会看到,它看起来像莫奈,我的意思是,噪声包含一个调色板与原始图像没有直接的联系。因此,而不是寻找一个相同的阵列的形象,我需要找到最相似的阵列。
这些图像来自随机截图通过GoogleMap的类似的网站,并且图像不能在另一种格式比JPEG格式。
我尝试了很多的手工方式。
我的一个方法是:
这个算法的工作,但是我做的一切都在一维数组,这是非常缓慢的。
有现有的库,将直接做到这一点的算法?
我的算法是:
//其中SRC是我搜索更大的图片
//偏移量是凡在我小的形象,我开始搜索
//莱恩是怎么长的是我搜索的数组
//大小是更大的图像中,我寻找的大小。
//私有点simpleSearch(byte []的SRC,诠释抵消,诠释的len,byte []的搜索,尺寸大小)
{
byte []的DDD =新的字节[长度];
Array.Copy(搜索,偏移,国内长途,0,len个);
INT最低=亿;
INT locmatch = 0;
的for(int i = 0; I< src.Length - LEN;我++)
{
INT thed = 0;
对于(INT一= 0; A< len个; A ++)
{
INT的diff = Math.Abs(源[1 +α] - DDD [一个]);
thed + =差异;
}
thed = thed / LEN;
如果(thed<最低)
{
最低= thed;
locmatch = I-LEN;
}
}
INT YY =(locmatch / size.Width);
INT XX = locmatch - (YY * size.Width);
点P =新的点(XX,YY);
返回磷;
}
是的相关性或光谱特征办法告诉两个图像区域的相似程度。但我觉得你真的想在这里什么是算法为高效搜索的重叠区域。
通讯问题是计算机视觉中一个明确的问题,试图弄清楚哪些部位一个图像对应于另一图象的哪些部分。有 RANSAC 基础的算法。
还有一个四叉树算法带来的复杂性下降以对数秩序。
I'm searching for the best library to search for identical area in two different images, all images being compressed in JPEG, with a lot of noise. I'm having a hard time finding one. The problem is if you zoom a jpeg, you'll see that it looks like a Monet, I mean, the noise contains a color palette that have no direct link with the original image. So instead of searching for an identical array in the image, I need to find the 'most similar array'.
These images come from random screenshot over a googlemap similar websites, and the images cannot be in another format than jpeg.
I tried a lot of manual way.
One of my method is:
This algorithm works, but I'm doing everything in one dimension array, and it is very slow.
Is there existing libraries that would do this algorithm directly?
My algorithm is:
// Where SRC is the bigger image in which I search
// Offset is where in my small image I start to search
// Len is how long is my searched array
// Size is the size of the bigger image in which I'm searching.
// private Point simpleSearch(byte[] src, int offset, int len, byte[] search, Size size)
{
byte[] ddd = new byte[len];
Array.Copy(search, offset, ddd, 0, len);
int lowest = 100000000;
int locmatch = 0;
for (int i = 0; i < src.Length - len; i++)
{
int thed = 0;
for (int a = 0; a < len; a++)
{
int diff = Math.Abs(src[i + a] - ddd[a]);
thed += diff;
}
thed = thed / len;
if (thed < lowest)
{
lowest = thed;
locmatch = i-len;
}
}
int yy = (locmatch / size.Width);
int xx = locmatch - (yy * size.Width);
Point p = new Point(xx, yy);
return p;
}
Yep correlation or spectrum signature are ways to tell how similar two image regions are. But I think what you really want here is an algorithm to efficiently search the overlapping region.
Correspondence problem is a well defined problem in computer vision that tries to figure out which parts of an image correspond to which parts of another image. There are RANSAC based algorithms.
There's also a quad-tree algorithm that brings the complexity down to logarithm order.
这篇关于算法来检测图像中的另一图像与一些噪声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!