public static int[][] diff(double[][] image1, double[][] image2) {
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		int[][] diffImage = new int[image1.length][image1[0].length];
		for (int i = 0; i < image1.length; i++) {
			for (int j = 0; j < image1[i].length; j++) {
				diffImage[i][j] = (int) (image1[i][j] - image2[i][j]);
				if (diffImage[i][j] > max)
					max = diffImage[i][j];
				if (diffImage[i][j] < min)
					min = diffImage[i][j];
				// diffImage[i][j] = diffImage[i][j] < 0 ? 0 : diffImage[i][j] > 255 ? 255 : diffImage[i][j];
			}
		}

		int delta = max - min;
		delta = 0;
		if (delta != 0) {
			for (int i = 0; i < diffImage.length; i++) {
				for (int j = 0; j < diffImage[i].length; j++) {
					diffImage[i][j] = diffImage[i][j] * 256 / delta;
				}
			}

		}
		return diffImage;
	}