7. แถวลำดับ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 7-33  เมท็อดการประมวลผลภาพ
  public static int[][] blurFilter(int[][] p) {
    int[][] f = {{1,1,1},{1,1,1},{1,1,1}};
    return convolute(p, f, 0);
  }
  public static int[][] sharpenFilter(int[][] p) {
    int[][] f = {{0,-1,0},{-1,5,-1},{0,-1,0}};
    return convolute(p, f, 0);
  }
  public static int[][] edgeFilter(int[][] p) {
    int[][] f = {{1,1,1},{1,-8,1},{1,1,1}};
    return convolute(p, f, 255); // ตั้ง bias = 255 ได้พื้นขาวขอบดำ 
  }   
  public static int[][] embossFilter(int[][] p) {
    int[][] f = {{-2,-1,0},{-1,1,1},{0,1,2}};
    return convolute(p, f, 0);
  }   
  public static int[][] embossGrayFilter(int[][] p) {
    int[][] f = {{2,0,0},{0,-1,0},{0,0,-1}};
    return convolute(p, f, 128); // ตั้ง bias = 128 ได้พื้นเทา 
  }
}   
©2009 S.Prasitjutrakul