1 package org.opencv.android; 2 3 import android.content.Context; 4 5 /** 6 * Helper class provides common initialization methods for OpenCV library. 7 */ 8 public class OpenCVLoader 9 { 10 /** 11 * OpenCV Library version 2.4.2. 12 */ 13 public static final String OPENCV_VERSION_2_4_2 = "2.4.2"; 14 15 /** 16 * OpenCV Library version 2.4.3. 17 */ 18 public static final String OPENCV_VERSION_2_4_3 = "2.4.3"; 19 20 /** 21 * OpenCV Library version 2.4.4. 22 */ 23 public static final String OPENCV_VERSION_2_4_4 = "2.4.4"; 24 25 /** 26 * OpenCV Library version 2.4.5. 27 */ 28 public static final String OPENCV_VERSION_2_4_5 = "2.4.5"; 29 30 /** 31 * OpenCV Library version 2.4.6. 32 */ 33 public static final String OPENCV_VERSION_2_4_6 = "2.4.6"; 34 35 /** 36 * OpenCV Library version 2.4.7. 37 */ 38 public static final String OPENCV_VERSION_2_4_7 = "2.4.7"; 39 40 /** 41 * OpenCV Library version 2.4.8. 42 */ 43 public static final String OPENCV_VERSION_2_4_8 = "2.4.8"; 44 45 /** 46 * OpenCV Library version 2.4.9. 47 */ 48 public static final String OPENCV_VERSION_2_4_9 = "2.4.9"; 49 50 /** 51 * OpenCV Library version 2.4.10. 52 */ 53 public static final String OPENCV_VERSION_2_4_10 = "2.4.10"; 54 55 /** 56 * OpenCV Library version 2.4.11. 57 */ 58 public static final String OPENCV_VERSION_2_4_11 = "2.4.11"; 59 60 /** 61 * OpenCV Library version 3.0.0. 62 */ 63 public static final String OPENCV_VERSION_3_0_0 = "3.0.0"; 64 65 66 /** 67 * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java"). 68 * @return Returns true is initialization of OpenCV was successful. 69 */ 70 public static boolean initDebug() 71 { 72 return StaticHelper.initOpenCV(false); 73 } 74 75 /** 76 * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java"). 77 * @param InitCuda load and initialize CUDA runtime libraries. 78 * @return Returns true is initialization of OpenCV was successful. 79 */ 80 public static boolean initDebug(boolean InitCuda) 81 { 82 return StaticHelper.initOpenCV(InitCuda); 83 } 84 85 /** 86 * Loads and initializes OpenCV library using OpenCV Engine service. 87 * @param Version OpenCV library version. 88 * @param AppContext application context for connecting to the service. 89 * @param Callback object, that implements LoaderCallbackInterface for handling the connection status. 90 * @return Returns true if initialization of OpenCV is successful. 91 */ 92 public static boolean initAsync(String Version, Context AppContext, 93 LoaderCallbackInterface Callback) 94 { 95 return AsyncServiceHelper.initOpenCV(Version, AppContext, Callback); 96 } 97 } 98