Android Bitmap Color Get kernelMatch(int x, int y, int w, int h, Bitmap bitmap, int[][] se)

Here you can find the source of kernelMatch(int x, int y, int w, int h, Bitmap bitmap, int[][] se)

Description

kernel Match

Declaration

private static boolean kernelMatch(int x, int y, int w, int h,
            Bitmap bitmap, int[][] se) 

Method Source Code

//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;
    }
}

Related

  1. countSE(Bitmap bitmap, int[][] se)
  2. getContactCount(Bitmap bitmap)
  3. getPixelsCount(Bitmap bitmap)
  4. getColorHistogram(Bitmap bitmap)
  5. isBitmapWhiteAtTopOrBottom(Bitmap largeBitmap)