类com.google.zxing.common.GridSampler源码实例Demo

下面列出了怎么用com.google.zxing.common.GridSampler的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ZXing-Orient   文件: Detector.java
/**
 * 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,
                            low, low,   // topleft
                            high, low,  // topright
                            high, high, // bottomright
                            low, high,  // bottomleft
                            topLeft.getX(), topLeft.getY(),
                            topRight.getX(), topRight.getY(),
                            bottomRight.getX(), bottomRight.getY(),
                            bottomLeft.getX(), bottomLeft.getY());
}
 
/**
 * 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,
                            low, low,   // topleft
                            high, low,  // topright
                            high, high, // bottomright
                            low, high,  // bottomleft
                            topLeft.getX(), topLeft.getY(),
                            topRight.getX(), topRight.getY(),
                            bottomRight.getX(), bottomRight.getY(),
                            bottomLeft.getX(), bottomLeft.getY());
}
 
源代码3 项目: weex   文件: Detector.java
/**
 * 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,
                            low, low,   // topleft
                            high, low,  // topright
                            high, high, // bottomright
                            low, high,  // bottomleft
                            topLeft.getX(), topLeft.getY(),
                            topRight.getX(), topRight.getY(),
                            bottomRight.getX(), bottomRight.getY(),
                            bottomLeft.getX(), bottomLeft.getY());
}
 
源代码4 项目: barcodescanner-lib-aar   文件: Detector.java
/**
 * 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,
                            low, low,   // topleft
                            high, low,  // topright
                            high, high, // bottomright
                            low, high,  // bottomleft
                            topLeft.getX(), topLeft.getY(),
                            topRight.getX(), topRight.getY(),
                            bottomRight.getX(), bottomRight.getY(),
                            bottomLeft.getX(), bottomLeft.getY());
}
 
源代码5 项目: ScreenCapture   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码6 项目: Tesseract-OCR-Scanner   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码7 项目: QrCodeScanner   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码8 项目: ZXing-Orient   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码9 项目: ZXing-Orient   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    ResultPoint topLeft,
                                    ResultPoint bottomLeft,
                                    ResultPoint bottomRight,
                                    ResultPoint topRight,
                                    int dimensionX,
                                    int dimensionY) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();

  return sampler.sampleGrid(image,
                            dimensionX,
                            dimensionY,
                            0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            dimensionY - 0.5f,
                            0.5f,
                            dimensionY - 0.5f,
                            topLeft.getX(),
                            topLeft.getY(),
                            topRight.getX(),
                            topRight.getY(),
                            bottomRight.getX(),
                            bottomRight.getY(),
                            bottomLeft.getX(),
                            bottomLeft.getY());
}
 
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
private static BitMatrix sampleGrid(BitMatrix image,
                                    ResultPoint topLeft,
                                    ResultPoint bottomLeft,
                                    ResultPoint bottomRight,
                                    ResultPoint topRight,
                                    int dimensionX,
                                    int dimensionY) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();

  return sampler.sampleGrid(image,
                            dimensionX,
                            dimensionY,
                            0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            dimensionY - 0.5f,
                            0.5f,
                            dimensionY - 0.5f,
                            topLeft.getX(),
                            topLeft.getY(),
                            topRight.getX(),
                            topRight.getY(),
                            bottomRight.getX(),
                            bottomRight.getY(),
                            bottomLeft.getX(),
                            bottomLeft.getY());
}
 
源代码12 项目: weex   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码13 项目: weex   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    ResultPoint topLeft,
                                    ResultPoint bottomLeft,
                                    ResultPoint bottomRight,
                                    ResultPoint topRight,
                                    int dimensionX,
                                    int dimensionY) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();

  return sampler.sampleGrid(image,
                            dimensionX,
                            dimensionY,
                            0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            dimensionY - 0.5f,
                            0.5f,
                            dimensionY - 0.5f,
                            topLeft.getX(),
                            topLeft.getY(),
                            topRight.getX(),
                            topRight.getY(),
                            bottomRight.getX(),
                            bottomRight.getY(),
                            bottomLeft.getX(),
                            bottomLeft.getY());
}
 
源代码14 项目: barcodescanner-lib-aar   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码15 项目: barcodescanner-lib-aar   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    ResultPoint topLeft,
                                    ResultPoint bottomLeft,
                                    ResultPoint bottomRight,
                                    ResultPoint topRight,
                                    int dimensionX,
                                    int dimensionY) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();

  return sampler.sampleGrid(image,
                            dimensionX,
                            dimensionY,
                            0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            dimensionY - 0.5f,
                            0.5f,
                            dimensionY - 0.5f,
                            topLeft.getX(),
                            topLeft.getY(),
                            topRight.getX(),
                            topRight.getY(),
                            bottomRight.getX(),
                            bottomRight.getY(),
                            bottomLeft.getX(),
                            bottomLeft.getY());
}
 
源代码16 项目: reacteu-app   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix matrix,
                                    ResultPoint topLeft,
                                    ResultPoint bottomLeft,
                                    ResultPoint topRight,
                                    ResultPoint bottomRight,
                                    int xdimension,
                                    int ydimension) throws NotFoundException {

  // Note that unlike the QR Code sampler, we didn't find the center of modules, but the
  // very corners. So there is no 0.5f here; 0.0f is right.
  GridSampler sampler = GridSampler.getInstance();

  return sampler.sampleGrid(
      matrix, 
      xdimension, ydimension,
      0.0f, // p1ToX
      0.0f, // p1ToY
      xdimension, // p2ToX
      0.0f, // p2ToY
      xdimension, // p3ToX
      ydimension, // p3ToY
      0.0f, // p4ToX
      ydimension, // p4ToY
      topLeft.getX(), // p1FromX
      topLeft.getY(), // p1FromY
      topRight.getX(), // p2FromX
      topRight.getY(), // p2FromY
      bottomRight.getX(), // p3FromX
      bottomRight.getY(), // p3FromY
      bottomLeft.getX(), // p4FromX
      bottomLeft.getY()); // p4FromY
}
 
源代码17 项目: reacteu-app   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码18 项目: reacteu-app   文件: Detector.java
/**
 * Samples an Aztec matrix from an image
 */
private BitMatrix sampleGrid(BitMatrix image,
                             ResultPoint topLeft,
                             ResultPoint bottomLeft,
                             ResultPoint bottomRight,
                             ResultPoint topRight) throws NotFoundException {

  int dimension;
  if (compact) {
    dimension = 4*nbLayers+11;
  } else {
    if (nbLayers <= 4) {
      dimension = 4*nbLayers + 15;
    } else {
      dimension = 4*nbLayers + 2*((nbLayers-4)/8 + 1) + 15 ;
    }
  }

  GridSampler sampler = GridSampler.getInstance();

  return sampler.sampleGrid(image,
    dimension,
    dimension,
    0.5f,
    0.5f,
    dimension - 0.5f,
    0.5f,
    dimension - 0.5f,
    dimension - 0.5f,
    0.5f,
    dimension - 0.5f,
    topLeft.getX(),
    topLeft.getY(),
    topRight.getX(),
    topRight.getY(),
    bottomRight.getX(),
    bottomRight.getY(),
    bottomLeft.getX(),
    bottomLeft.getY());
}
 
源代码19 项目: reacteu-app   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    ResultPoint topLeft,
                                    ResultPoint bottomLeft,
                                    ResultPoint bottomRight,
                                    ResultPoint topRight,
                                    int dimensionX,
                                    int dimensionY) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();

  return sampler.sampleGrid(image,
                            dimensionX,
                            dimensionY,
                            0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            0.5f,
                            dimensionX - 0.5f,
                            dimensionY - 0.5f,
                            0.5f,
                            dimensionY - 0.5f,
                            topLeft.getX(),
                            topLeft.getY(),
                            topRight.getX(),
                            topRight.getY(),
                            bottomRight.getX(),
                            bottomRight.getY(),
                            bottomLeft.getX(),
                            bottomLeft.getY());
}
 
源代码20 项目: RipplePower   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image, ResultPoint topLeft, ResultPoint bottomLeft,
		ResultPoint bottomRight, ResultPoint topRight, int dimensionX, int dimensionY) throws NotFoundException {

	GridSampler sampler = GridSampler.getInstance();

	return sampler.sampleGrid(image, dimensionX, dimensionY, 0.5f, 0.5f, dimensionX - 0.5f, 0.5f, dimensionX - 0.5f,
			dimensionY - 0.5f, 0.5f, dimensionY - 0.5f, topLeft.getX(), topLeft.getY(), topRight.getX(),
			topRight.getY(), bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());
}
 
源代码21 项目: Telegram-FOSS   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码22 项目: Telegram   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码23 项目: MiBandDecompiled   文件: Detector.java
private static BitMatrix a(BitMatrix bitmatrix, ResultPoint resultpoint, ResultPoint resultpoint1, ResultPoint resultpoint2, ResultPoint resultpoint3, int i)
{
    return GridSampler.getInstance().sampleGrid(bitmatrix, i, i, 0.0F, 0.0F, i, 0.0F, i, i, 0.0F, i, resultpoint.getX(), resultpoint.getY(), resultpoint2.getX(), resultpoint2.getY(), resultpoint3.getX(), resultpoint3.getY(), resultpoint1.getX(), resultpoint1.getY());
}
 
源代码24 项目: MiBandDecompiled   文件: Detector.java
private static BitMatrix a(BitMatrix bitmatrix, PerspectiveTransform perspectivetransform, int i)
{
    return GridSampler.getInstance().sampleGrid(bitmatrix, i, i, perspectivetransform);
}
 
源代码25 项目: MiBandDecompiled   文件: Detector.java
private BitMatrix a(BitMatrix bitmatrix, ResultPoint resultpoint, ResultPoint resultpoint1, ResultPoint resultpoint2, ResultPoint resultpoint3)
{
    int i;
    GridSampler gridsampler;
    float f1;
    float f2;
    float f3;
    float f4;
    float f5;
    float f6;
    float f7;
    float f8;
    float f9;
    float f10;
    float f11;
    float f12;
    if (b)
    {
        i = 11 + 4 * c;
    } else
    if (c <= 4)
    {
        i = 15 + 4 * c;
    } else
    {
        i = 15 + (4 * c + 2 * (1 + (-4 + c) / 8));
    }
    gridsampler = GridSampler.getInstance();
    f1 = (float)i - 0.5F;
    f2 = (float)i - 0.5F;
    f3 = (float)i - 0.5F;
    f4 = (float)i - 0.5F;
    f5 = resultpoint.getX();
    f6 = resultpoint.getY();
    f7 = resultpoint3.getX();
    f8 = resultpoint3.getY();
    f9 = resultpoint2.getX();
    f10 = resultpoint2.getY();
    f11 = resultpoint1.getX();
    f12 = resultpoint1.getY();
    return gridsampler.sampleGrid(bitmatrix, i, i, 0.5F, 0.5F, f1, 0.5F, f2, f3, 0.5F, f4, f5, f6, f7, f8, f9, f10, f11, f12);
}
 
源代码26 项目: MiBandDecompiled   文件: Detector.java
private static BitMatrix a(BitMatrix bitmatrix, ResultPoint resultpoint, ResultPoint resultpoint1, ResultPoint resultpoint2, ResultPoint resultpoint3, int i, int j)
{
    return GridSampler.getInstance().sampleGrid(bitmatrix, i, j, 0.5F, 0.5F, (float)i - 0.5F, 0.5F, (float)i - 0.5F, (float)j - 0.5F, 0.5F, (float)j - 0.5F, resultpoint.getX(), resultpoint.getY(), resultpoint3.getX(), resultpoint3.getY(), resultpoint2.getX(), resultpoint2.getY(), resultpoint1.getX(), resultpoint1.getY());
}
 
源代码27 项目: RipplePower   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image, PerspectiveTransform transform, int dimension)
		throws NotFoundException {

	GridSampler sampler = GridSampler.getInstance();
	return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
源代码28 项目: barterli_android   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image, PerspectiveTransform transform, int dimension) throws NotFoundException {

        GridSampler sampler = GridSampler.getInstance();
        return sampler.sampleGrid(image, dimension, dimension, transform);
    }
 
源代码29 项目: android-quick-response-code   文件: Detector.java
private static BitMatrix sampleGrid(BitMatrix image, PerspectiveTransform transform, int dimension) throws NotFoundException {

        GridSampler sampler = GridSampler.getInstance();
        return sampler.sampleGrid(image, dimension, dimension, transform);
    }
 
 类所在包
 同包方法