Search in sources :

Example 1 with GridSampler

use of com.google.zxing.common.GridSampler in project zxing by zxing.

the class Detector method sampleGrid.

/**
   * Creates a BitMatrix by sampling the provided image.
   * topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the
   * diagonal just outside the bull's eye.
   */
private BitMatrix sampleGrid(BitMatrix image, ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomRight, ResultPoint bottomLeft) throws NotFoundException {
    GridSampler sampler = GridSampler.getInstance();
    int dimension = getDimension();
    float low = dimension / 2.0f - nbCenterLayers;
    float high = dimension / 2.0f + nbCenterLayers;
    return sampler.sampleGrid(image, dimension, dimension, // topleft
    low, // topleft
    low, // topright
    high, // topright
    low, // bottomright
    high, // bottomright
    high, // bottomleft
    low, // bottomleft
    high, topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(), bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());
}
Also used : GridSampler(com.google.zxing.common.GridSampler) ResultPoint(com.google.zxing.ResultPoint)

Example 2 with GridSampler

use of com.google.zxing.common.GridSampler in project incubator-weex by apache.

the class Detector method sampleGrid.

/**
 * Creates a BitMatrix by sampling the provided image.
 * topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the
 * diagonal just outside the bull's eye.
 */
private BitMatrix sampleGrid(BitMatrix image, ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomRight, ResultPoint bottomLeft) throws NotFoundException {
    GridSampler sampler = GridSampler.getInstance();
    int dimension = getDimension();
    float low = dimension / 2.0f - nbCenterLayers;
    float high = dimension / 2.0f + nbCenterLayers;
    return sampler.sampleGrid(image, dimension, dimension, // topleft
    low, // topleft
    low, // topright
    high, // topright
    low, // bottomright
    high, // bottomright
    high, // bottomleft
    low, // bottomleft
    high, topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(), bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());
}
Also used : GridSampler(com.google.zxing.common.GridSampler) ResultPoint(com.google.zxing.ResultPoint)

Example 3 with GridSampler

use of com.google.zxing.common.GridSampler in project weex-example by KalicyZhou.

the class Detector method sampleGrid.

/**
   * Creates a BitMatrix by sampling the provided image.
   * topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the
   * diagonal just outside the bull's eye.
   */
private BitMatrix sampleGrid(BitMatrix image, ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomRight, ResultPoint bottomLeft) throws NotFoundException {
    GridSampler sampler = GridSampler.getInstance();
    int dimension = getDimension();
    float low = dimension / 2.0f - nbCenterLayers;
    float high = dimension / 2.0f + nbCenterLayers;
    return sampler.sampleGrid(image, dimension, dimension, // topleft
    low, // topleft
    low, // topright
    high, // topright
    low, // bottomright
    high, // bottomright
    high, // bottomleft
    low, // bottomleft
    high, topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(), bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());
}
Also used : GridSampler(com.google.zxing.common.GridSampler) ResultPoint(com.google.zxing.ResultPoint)

Example 4 with GridSampler

use of com.google.zxing.common.GridSampler in project android-zxing by PearceXu.

the class Detector method sampleGrid.

/**
 * Creates a BitMatrix by sampling the provided image.
 * topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the
 * diagonal just outside the bull's eye.
 */
private BitMatrix sampleGrid(BitMatrix image, ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomRight, ResultPoint bottomLeft) throws NotFoundException {
    GridSampler sampler = GridSampler.getInstance();
    int dimension = getDimension();
    float low = dimension / 2.0f - nbCenterLayers;
    float high = dimension / 2.0f + nbCenterLayers;
    return sampler.sampleGrid(image, dimension, dimension, // topleft
    low, // topleft
    low, // topright
    high, // topright
    low, // bottomright
    high, // bottomright
    high, // bottomleft
    low, // bottomleft
    high, topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(), bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());
}
Also used : GridSampler(com.google.zxing.common.GridSampler) ResultPoint(com.google.zxing.ResultPoint)

Aggregations

ResultPoint (com.google.zxing.ResultPoint)4 GridSampler (com.google.zxing.common.GridSampler)4