Here you can find the source of sum(double[][] kernel1, double[][] kernel2)
Parameter | Description |
---|---|
kernel1 | a parameter |
kernel2 | a parameter |
public static double[][] sum(double[][] kernel1, double[][] kernel2)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w. j a v a2 s . c o m*/ * Sum two kernel matrices * * @param kernel1 * @param kernel2 * @return */ public static double[][] sum(double[][] kernel1, double[][] kernel2) { double[][] kernel = new double[kernel1.length][kernel1.length]; for (int i = 0; i < kernel1.length; i++) { for (int j = i; j < kernel1[i].length; j++) { kernel[i][j] = kernel1[i][j] + kernel2[i][j]; } } return kernel; } }