Improved javadoc comments. Draft.
authorVsevolod Glumov <seva17@gmail.com>
Tue, 28 Aug 2012 11:01:14 +0000 (15:01 +0400)
committerVsevolod Glumov <seva17@gmail.com>
Tue, 28 Aug 2012 11:01:46 +0000 (15:01 +0400)
12 files changed:
modules/java/generator/src/java/android+AsyncServiceHelper.java
modules/java/generator/src/java/android+BaseLoaderCallback.java
modules/java/generator/src/java/android+InstallCallbackInterface.java
modules/java/generator/src/java/android+LoaderCallbackInterface.java
modules/java/generator/src/java/android+OpenCVLoader.java
modules/java/generator/src/java/android+StaticHelper.java
modules/java/generator/src/java/android+Utils.java
modules/java/generator/src/java/core+TermCriteria.java
modules/java/generator/src/java/engine+OpenCVEngineInterface.aidl
modules/java/generator/src/java/features2d+DMatch.java
modules/java/generator/src/java/features2d+KeyPoint.java
modules/java/generator/src/java/highgui+VideoCapture.java

index 723a560..8069f46 100644 (file)
@@ -105,7 +105,7 @@ class AsyncServiceHelper
     }
     
     /**
-     * URI for OpenCV Manager on Google Play (Android Market)
+     *  URL of OpenCV Manager page on Google Play Market.
      */
     protected static final String OPEN_CV_SERVICE_URL = "market://details?id=org.opencv.engine";
 
@@ -263,7 +263,7 @@ class AsyncServiceHelper
             }
             else
             {
-                // If dependencies list is not defined or empty
+                // If dependencies list is not defined or empty.
                 String AbsLibraryPath = Path + File.separator + "libopencv_java.so";
                 result &= loadLibrary(AbsLibraryPath);
             }
index 2936b8a..220ca5e 100644 (file)
@@ -7,7 +7,7 @@ import android.content.DialogInterface.OnClickListener;
 import android.util.Log;
 
 /**
- * Basic implementation of LoaderCallbackInterface
+ * Basic implementation of LoaderCallbackInterface.
  */
 public abstract class BaseLoaderCallback implements LoaderCallbackInterface {
 
@@ -22,9 +22,9 @@ public abstract class BaseLoaderCallback implements LoaderCallbackInterface {
             /** OpenCV initialization was successful. **/
             case LoaderCallbackInterface.SUCCESS:
             {
-                /** Application must override this method to handle successful library initialization **/
+                /** Application must override this method to handle successful library initialization. **/
             } break;
-            /** OpenCV Manager or library package installation is in progress. Restart of application is required **/
+            /** OpenCV Manager or library package installation is in progress. Restart the application. **/
             case LoaderCallbackInterface.RESTART_REQUIRED:
             {
                 Log.d(TAG, "OpenCV downloading. App restart is needed!");
@@ -40,7 +40,7 @@ public abstract class BaseLoaderCallback implements LoaderCallbackInterface {
 
                 RestartMessage.show();
             } break;
-            /** OpenCV loader cannot start Google Play **/
+            /** OpenCV loader cannot start Google Play Market. **/
             case LoaderCallbackInterface.MARKET_ERROR:
             {
                 Log.d(TAG, "Google Play service is not installed! You can get it here");
@@ -55,13 +55,13 @@ public abstract class BaseLoaderCallback implements LoaderCallbackInterface {
                 });
                 MarketErrorMessage.show();
             } break;
-            /** Package installation was canceled **/
+            /** Package installation has been canceled. **/
             case LoaderCallbackInterface.INSTALL_CANCELED:
             {
                 Log.d(TAG, "OpenCV library instalation was canceled by user");
                 mAppContext.finish();
             } break;
-            /** Application is incompatible with this version of OpenCV Manager. Possible Service update is needed **/
+            /** Application is incompatible with this version of OpenCV Manager. Possibly, a service update is required. **/
             case LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION:
             {
                 Log.d(TAG, "OpenCV Manager Service is uncompatible with this app!");
@@ -76,7 +76,7 @@ public abstract class BaseLoaderCallback implements LoaderCallbackInterface {
                 });
                 IncomatibilityMessage.show();
             }
-            /** Other status, i.e. INIT_FAILED **/
+            /** Other status, i.e. INIT_FAILED. **/
             default:
             {
                 Log.e(TAG, "OpenCV loading failed!");
index bd47770..12785d9 100644 (file)
@@ -1,21 +1,21 @@
 package org.opencv.android;
 
 /**
- * Installation callback interface
+ * Installation callback interface.
  */
 public interface InstallCallbackInterface
 {
     /**
-     * Target package name
-     * @return Return target package name
+     * Target package name.
+     * @return Return target package name.
      */
     public String getPackageName();
     /**
-     * Installation of package is approved
+     * Installation is approved.
      */
     public void install();
     /**
-     * Installation canceled
+     * Installation is canceled.
      */
     public void cancel();
 };
index b96cabe..56cdf15 100644 (file)
@@ -1,44 +1,44 @@
 package org.opencv.android;
 
 /**
- * Interface for callback object in case of asynchronous initialization of OpenCV
+ * Interface for callback object in case of asynchronous initialization of OpenCV.
  */
 public interface LoaderCallbackInterface
 {
     /**
-     * OpenCV initialization finished successfully
+     * OpenCV initialization finished successfully.
      */
     static final int SUCCESS = 0;
     /**
-     * OpenCV library installation via Google Play service was initialized. Application restart is required
+     * OpenCV library installation via Google Play service has been initialized. Restart the application.
      */
     static final int RESTART_REQUIRED = 1;
     /**
-     * Google Play (Android Market) cannot be invoked
+     * Google Play Market cannot be invoked.
      */
     static final int MARKET_ERROR = 2;
     /**
-     * OpenCV library installation was canceled by user
+     * OpenCV library installation has been canceled by user.
      */
     static final int INSTALL_CANCELED = 3;
     /**
-     * Version of OpenCV Manager Service is incompatible with this app. Service update is needed
+     * This version of OpenCV Manager Service is incompatible with the app. Possibly, a service update is required.
      */
     static final int INCOMPATIBLE_MANAGER_VERSION = 4;
     /**
-     * OpenCV library initialization failed
+     * OpenCV library initialization failed.
      */
     static final int INIT_FAILED = 0xff;
 
     /**
-     * Callback method that is called after OpenCV library initialization
-     * @param status Status of initialization. See Initialization status constants
+     * This callback method is called after OpenCV library initialization.
+     * @param status Status of initialization (see Initialization status constants).
      */
     public void onManagerConnected(int status);
 
     /**
-     * Callback method that is called in case when package installation is needed
-     * @param callback Answer object with approve and cancel methods and package description
+     * This callback method is called in case the package installation is needed.
+     * @param callback Answer object with approve and cancel methods and the package description.
      */
     public void onPackageInstall(InstallCallbackInterface callback);
 };
index dd4ee53..376d04c 100644 (file)
@@ -3,18 +3,18 @@ package org.opencv.android;
 import android.content.Context;
 
 /**
- * Helper class provides common initialization methods for OpenCV library
+ * Helper class provides common initialization methods for OpenCV library.
  */
 public class OpenCVLoader
 {
     /**
-     * OpenCV Library version 2.4.2
+     * OpenCV Library version 2.4.2.
      */
     public static final String OPENCV_VERSION_2_4_2 = "2.4.2";
 
     /**
-     * Load and initialize OpenCV library from current application package. Roughly it is analog of system.loadLibrary("opencv_java")
-     * @return Return true is initialization of OpenCV was successful
+     * Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
+     * @return Returns true is initialization of OpenCV was successful.
      */
     public static boolean initDebug()
     {
@@ -22,11 +22,11 @@ public class OpenCVLoader
     }
 
     /**
-     *  Load and initialize OpenCV library using OpenCV Engine service.
-     * @param Version OpenCV Library version
-     * @param AppContext Application context for connecting to service
-     * @param Callback Object, that implements LoaderCallbackInterface for handling Connection status
-     * @return Return true if initialization of OpenCV starts successfully
+     * Loads and initializes OpenCV library using OpenCV Engine service.
+     * @param Version OpenCV Library version.
+     * @param AppContext Application context for connecting to service.
+     * @param Callback Object, that implements LoaderCallbackInterface for handling Connection status.
+     * @return Returns true if initialization of OpenCV is successful.
      */
     public static boolean initAsync(String Version, Context AppContext,
             LoaderCallbackInterface Callback)
index 8bc04e1..3082d22 100644 (file)
@@ -76,7 +76,7 @@ class StaticHelper {
         }
         else
         {
-            // If dependencies list is not defined or empty
+            // If dependencies list is not defined or empty.
             result &= loadLibrary("opencv_java");
         }
 
index a990cd1..ceecf3a 100644 (file)
@@ -76,14 +76,14 @@ public class Utils {
     /**
      * Converts Android Bitmap to OpenCV Mat.
      * <p>
-     * The function converts an image in the Android Bitmap representation to the OpenCV Mat.
+     * This function converts an Android Bitmap image to the OpenCV Mat.
      * <br>The 'ARGB_8888' and 'RGB_565' input Bitmap formats are supported.
      * <br>The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type,
      * it keeps the image in RGBA format.
-     * <br>The function throws an exception if the conversion fails.
+     * <br>This function throws an exception if the conversion fails.
      * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
-     * @param mat is a valid output Mat object, it will be reallocated if needed, so it's possible to pass an empty Mat.
-     * @param unPremultiplyAlpha is a flag if the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one. The flag is ignored for 'RGB_565' bitmaps.
+     * @param mat is a valid output Mat object, it will be reallocated if needed, so it may be empty.
+     * @param unPremultiplyAlpha is a flag if the bitmap needs to be converted from alpha premultiplied format (like Android keeps 'ARGB_8888' ones) to regular one. This flag is ignored for 'RGB_565' bitmaps.
      */
     public static void bitmapToMat(Bitmap bmp, Mat mat, boolean unPremultiplyAlpha) {
         if (bmp == null)
@@ -94,7 +94,7 @@ public class Utils {
     }
 
     /**
-     * Shortened form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false)
+     * Short form of the bitmapToMat(bmp, mat, unPremultiplyAlpha=false).
      * @param bmp is a valid input Bitmap object of the type 'ARGB_8888' or 'RGB_565'.
      * @param mat is a valid output Mat object, it will be reallocated if needed, so it's possible to pass an empty Mat.
      */
@@ -124,7 +124,7 @@ public class Utils {
     }
 
     /**
-     * Shortened form of the <b>matToBitmap(mat, bmp, premultiplyAlpha=false)</b>
+     * Short form of the <b>matToBitmap(mat, bmp, premultiplyAlpha=false)</b>
      * @param mat is a valid input Mat object of the types 'CV_8UC1', 'CV_8UC3' or 'CV_8UC4'.
      * @param bmp is a valid Bitmap object of the same size as the Mat m and of type 'ARGB_8888' or 'RGB_565'.
      */
index 1717883..3c4a8de 100644 (file)
@@ -4,15 +4,15 @@ package org.opencv.core;
 public class TermCriteria {\r
 \r
     /**\r
-     * the maximum number of iterations or elements to compute\r
+     * the maximum of iterations or elements to compute\r
      */\r
     public static final int COUNT = 1;\r
     /**\r
-     * the maximum number of iterations or elements to compute\r
+     * the maximum of iterations or elements to compute\r
      */\r
     public static final int MAX_ITER = COUNT;\r
     /**\r
-     * the desired accuracy or change in parameters at which the iterative algorithm stops\r
+     * the desired accuracy threshold or change in parameters at which the iterative algorithm stops.\r
      */\r
     public static final int EPS = 2;\r
 \r
@@ -21,7 +21,7 @@ public class TermCriteria {
     public double epsilon;\r
 \r
     /**\r
-     * Termination criteria in iterative algorithms\r
+     * Termination criteria for iterative algorithms.\r
      * \r
      * @param type\r
      *            the type of termination criteria: COUNT, EPS or COUNT + EPS\r
@@ -37,7 +37,7 @@ public class TermCriteria {
     }\r
 \r
     /**\r
-     * Termination criteria in iterative algorithms\r
+     * Termination criteria for iterative algorithms\r
      */\r
     public TermCriteria() {\r
         this(0, 0, 0.0);\r
index d3f216c..7bf967f 100644 (file)
@@ -1,33 +1,33 @@
 package org.opencv.engine;
 
 /**
-* Class provides Java interface to OpenCV Engine Service. Is synchronous with native OpenCVEngine class.
+* Class provides a Java interface for OpenCV Engine Service. It's synchronous with native OpenCVEngine class.
 */
 interface OpenCVEngineInterface
 {
        /**
-       * @return Return service version
+       * @return Returns service version.
        */
        int getEngineVersion();
 
        /**
-       * Find installed OpenCV library
-       * @param OpenCV version
-       * @return Return path to OpenCV native libs or empty string if OpenCV was not found
+       * Finds an installed OpenCV library.
+       * @param OpenCV version.
+       * @return Returns path to OpenCV native libs or an empty string if OpenCV can not be found.
        */
        String getLibPathByVersion(String version);
 
        /**
-       * Try to install defined version of OpenCV from Google Play (Android Market).
-       * @param OpenCV version
-       * @return Return true if installation was successful or OpenCV package has been already installed
+       * Tries to install defined version of OpenCV from Google Play Market.
+       * @param OpenCV version.
+       * @return Returns true if installation was successful or OpenCV package has been already installed.
        */
        boolean installVersion(String version);
  
        /**
-       * Return list of libraries in loading order separated by ";" symbol
-       * @param OpenCV version
-       * @return Return OpenCV libraries names separated by symbol ";" in loading order
+       * Returns list of libraries in loading order, separated by semicolon.
+       * @param OpenCV version.
+       * @return Returns names of OpenCV libraries, separated by semicolon.
        */
        String getLibraryList(String version);
 }
\ No newline at end of file
index ac86406..b93a533 100644 (file)
@@ -3,21 +3,21 @@ package org.opencv.features2d;
 //C++: class DMatch\r
 \r
 /**\r
- * Struct for matching: query descriptor index, train descriptor index, train\r
+ * Structure for matching: query descriptor index, train descriptor index, train\r
  * image index and distance between descriptors.\r
  */\r
 public class DMatch {\r
 \r
     /**\r
-     * query descriptor index\r
+     * Query descriptor index.\r
      */\r
     public int queryIdx;\r
     /**\r
-     * train descriptor index\r
+     * Train descriptor index.\r
      */\r
     public int trainIdx;\r
     /**\r
-     * train image index\r
+     * Train image index.\r
      */\r
     public int imgIdx;\r
 \r
@@ -46,7 +46,7 @@ public class DMatch {
     }\r
 \r
     /**\r
-     * less is better\r
+     * Less is better.\r
      */\r
     public boolean lessThan(DMatch it) {\r
         return distance < it.distance;\r
index f141cd1..352f7cd 100644 (file)
@@ -6,29 +6,29 @@ import org.opencv.core.Point;
 public class KeyPoint {\r
 \r
     /**\r
-     * coordinates of the keypoint\r
+     * Coordinates of the keypoint.\r
      */\r
     public Point pt;\r
     /**\r
-     * diameter of the meaningful keypoint neighborhood\r
+     * Diameter of the useful keypoint adjacent area.\r
      */\r
     public float size;\r
     /**\r
-     * computed orientation of the keypoint (-1 if not applicable)\r
+     * Computed orientation of the keypoint (-1 if not applicable).\r
      */\r
     public float angle;\r
     /**\r
-     * the response by which the most strong keypoints have been selected. Can\r
-     * be used for further sorting or subsampling\r
+     * The response, by which the strongest keypoints have been selected. Can\r
+     * be used for further sorting or subsampling.\r
      */\r
     public float response;\r
     /**\r
-     * octave (pyramid layer) from which the keypoint has been extracted\r
+     * Octave (pyramid layer), from which the keypoint has been extracted.\r
      */\r
     public int octave;\r
     /**\r
-     * object id that can be used to clustered keypoints by an object they\r
-     * belong to\r
+     * Object ID, that can be used to cluster keypoints by an object they\r
+     * belong to.\r
      */\r
     public int class_id;\r
 \r
index bb71fc0..98b911d 100644 (file)
@@ -47,14 +47,14 @@ public class VideoCapture {
     //
 
 /**
- * Returns the specified "VideoCapture" property
+ * Returns the specified "VideoCapture" property.
  *
  * Note: When querying a property that is not supported by the backend used by
  * the "VideoCapture" class, value 0 is returned.
  *
- * @param propId Property identifier. It can be one of the following:
- *   * CV_CAP_PROP_FRAME_WIDTH Width of the frames in the video stream.
- *   * CV_CAP_PROP_FRAME_HEIGHT Height of the frames in the video stream.
+ * @param propId Property identifier; it can be one of the following:
+ *   * CV_CAP_PROP_FRAME_WIDTH width of the frames in the video stream.
+ *   * CV_CAP_PROP_FRAME_HEIGHT height of the frames in the video stream.
  *
  * @see <a href="http://opencv.itseez.com/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture-get">org.opencv.highgui.VideoCapture.get</a>
  */
@@ -173,10 +173,10 @@ public class VideoCapture {
 /**
  * Sets a property in the "VideoCapture".
  *
- * @param propId Property identifier. It can be one of the following:
- *   * CV_CAP_PROP_FRAME_WIDTH Width of the frames in the video stream.
- *   * CV_CAP_PROP_FRAME_HEIGHT Height of the frames in the video stream.
- * @param value Value of the property.
+ * @param propId Property identifier; it can be one of the following:
+ *   * CV_CAP_PROP_FRAME_WIDTH width of the frames in the video stream.
+ *   * CV_CAP_PROP_FRAME_HEIGHT height of the frames in the video stream.
+ * @param value value of the property.
  *
  * @see <a href="http://opencv.itseez.com/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture-set">org.opencv.highgui.VideoCapture.set</a>
  */