Here you can find the source of kernelMatch(int x, int y, int w, int h, Bitmap bitmap, int[][] se)
private static boolean kernelMatch(int x, int y, int w, int h, Bitmap bitmap, int[][] se)
//package com.java2s; import android.graphics.Bitmap; public class Main { private static boolean kernelMatch(int x, int y, int w, int h, Bitmap bitmap, int[][] se) { int lenh = se[0].length, lenv = se.length; for (int i = 0; i < lenv; i++) { for (int j = 0; j < lenh; j++) { int pVal = ((bitmap.getPixel((x + j) % w, (y + i) % h) & 0xff) > 0 ? 1 : 0);//from ww w.j a v a 2 s .c om if (se[i][j] != pVal) { return false; } } } return true; } }