Ir a la documentación de este archivo.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00025 package com.googlecode.leptonica.android;
00026
00031 public class AdaptiveMap {
00032 static {
00033 System.loadLibrary("lept");
00034 }
00035
00036
00037
00039 private final static int NORM_REDUCTION = 16;
00040
00042 private final static int NORM_SIZE = 3;
00043
00047 private final static int NORM_BG_VALUE = 200;
00048
00056 public static Pix backgroundNormMorph(Pix pixs) {
00057 return backgroundNormMorph(pixs, NORM_REDUCTION, NORM_SIZE,
00058 NORM_BG_VALUE);
00059 }
00060
00102 public static Pix backgroundNormMorph(Pix pixs, int normReduction,
00103 int normSize, int normBgValue) {
00104 if (pixs == null)
00105 throw new IllegalArgumentException("Source pix must be non-null");
00106
00107 int nativePix = nativeBackgroundNormMorph(pixs.mNativePix,
00108 normReduction, normSize, normBgValue);
00109
00110 if (nativePix == 0)
00111 throw new RuntimeException("Failed to normalize image background");
00112
00113 return new Pix(nativePix);
00114 }
00115
00116
00117
00118
00119
00120 private static native int nativeBackgroundNormMorph(int nativePix,
00121 int reduction, int size, int bgval);
00122 }