@Override
	public double[][] Convolve(double[][] image, double[][] kernel){
		double[][] result = new double[image.length][image[0].length];
		int kernel_height = kernel.length;
		int kernel_width = kernel[0].length;
		double max = Double.MIN_VALUE;
		double min = Double.MAX_VALUE;
		for(int y = 0; y < result.length; y++){
			for(int x = 0; x < result[0].length; x++){
				result[y][x] = 0.0;
				for(int y_2 = 0; y_2 < kernel_height; y_2++){
					for(int x_2 = 0; x_2 < kernel_width; x_2++){
						result[y][x] += image[(y + y_2-y_2/2) % image.length][(x + x_2-x_2/2) % image[0].length] * kernel[y_2][x_2];
						if(result[y][x] > max){
							max = result[y][x];
						}
						if(result[y][x] < min){
							min = result[y][x];
						}
					}
				}
			}
		}
		for(int y = 0; y < result.length; y++){
			for(int x = 0; x < result[y].length; x++){
				result[y][x] = Math.abs((result[y][x] - min) / (max - min));
			}
		}
		return result;
	}