public static void Main()
int[,] image = new int[,] {
int[,] sequenceX = new int[image.GetLength(0), image.GetLength(1)];
for (int x = 0; x < image.GetLength(0) - 1; x++)
for (int y = 0; y < image.GetLength(1) - 1; y++)
sequenceX[startSequenceX, startSequenceY]++;
if (y > image.GetLength(1) - 1)
int[,] sequenceY = new int[image.GetLength(1), image.GetLength(0)];
for (int y = 0; y < image.GetLength(1) - 1; y++)
for (int x = 0; x < image.GetLength(0) - 1; x++)
sequenceY[startSequenceX, startSequenceY]++;
if (x > image.GetLength(0) - 1)
for (int x = 0; x < sequenceX.GetLength(0) - 1; x++)
for (int y = 0; y < sequenceX.GetLength(1) - 1; y++)
if (sequenceX[x, y] != 0 && sequenceY[y, x] != 0)
Console.WriteLine(String.Format("(x, y) => ({0}, {1}) | width: {2}, height: {3}", x, y, sequenceX[x, y], sequenceY[y, x]));