public bool equalImagesFast(int first, int second)
{
ImageInfo temp1 = null, temp2 = null;
int size = similarSizes(out temp1, out temp2, first, second);
int[] stripLen = new int[2];
stripLen[0] = 2 * (int)(((AROUND * 100) / 255) * size);
int numStrips = (int)Math.Ceiling((double)(size) / stripLen[0]);
stripLen[1] = size - stripLen[0] * (numStrips - 1);
byte[] firstA = temp1.getImb();
byte[] secondA = temp2.getImb();
int sum = 0;
for (int k = 0; k < numStrips - 1; k++)
{
int stripEnd = (k+1)*stripLen[0];
for (int i = k*stripLen[0]; i < stripEnd; i++)
sum += Math.Abs(firstA[i] - secondA[i]);
if (sum > 100 * AROUND * size)
return false;
}
for (int i = (numStrips - 1) * stripLen[0]; i < size; i++)
sum += Math.Abs(firstA[i] - secondA[i]);
//if the success more then (95%) [100 - 100 * ARROUND] the images is eaqual
if (sum <= 100 * AROUND * size)
{
AddToResult(first, second);
return true;
}
return false;
}