IT. Expert System.

Android Reference

GestureUtils


android.gesture

Class GestureUtils



  • public final class GestureUtils
    extends Object
    Utility functions for gesture processing & analysis, including methods for:
    • feature extraction (e.g., samplers and those for calculating bounding boxes and gesture path lengths);
    • geometric transformation (e.g., translation, rotation and scaling);
    • gesture similarity comparison (e.g., calculating Euclidean or Cosine distances between two gestures).
    • Method Detail

      • spatialSampling

        public static float[] spatialSampling(Gesture gesture,
                              int bitmapSize)
        Samples the gesture spatially by rendering the gesture into a 2D grayscale bitmap. Scales the gesture to fit the size of the bitmap. The scaling does not necessarily keep the aspect ratio of the gesture.
        Parameters:
        gesture - the gesture to be sampled
        bitmapSize - the size of the bitmap
        Returns:
        a bitmapSize x bitmapSize grayscale bitmap that is represented as a 1D array. The float at index i represents the grayscale value at pixel [i%bitmapSize, i/bitmapSize]
      • spatialSampling

        public static float[] spatialSampling(Gesture gesture,
                              int bitmapSize,
                              boolean keepAspectRatio)
        Samples the gesture spatially by rendering the gesture into a 2D grayscale bitmap. Scales the gesture to fit the size of the bitmap.
        Parameters:
        gesture - the gesture to be sampled
        bitmapSize - the size of the bitmap
        keepAspectRatio - if the scaling should keep the gesture's aspect ratio
        Returns:
        a bitmapSize x bitmapSize grayscale bitmap that is represented as a 1D array. The float at index i represents the grayscale value at pixel [i%bitmapSize, i/bitmapSize]
      • temporalSampling

        public static float[] temporalSampling(GestureStroke stroke,
                               int numPoints)
        Samples a stroke temporally into a given number of evenly-distributed points.
        Parameters:
        stroke - the gesture stroke to be sampled
        numPoints - the number of points
        Returns:
        the sampled points in the form of [x1, y1, x2, y2, ..., xn, yn]
      • computeOrientedBoundingBox

        public static OrientedBoundingBox computeOrientedBoundingBox(ArrayList<GesturePoint> originalPoints)
        Computes an oriented, minimum bounding box of a set of points.
        Parameters:
        originalPoints -
        Returns:
        an oriented bounding box
      • computeOrientedBoundingBox

        public static OrientedBoundingBox computeOrientedBoundingBox(float[] originalPoints)
        Computes an oriented, minimum bounding box of a set of points.
        Parameters:
        originalPoints -
        Returns:
        an oriented bounding box


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 360 / 158855694. Delta: 0.04562 с