当前位置: 首页>>代码示例>>Java>>正文


Java GridSampler.getInstance方法代码示例

本文整理汇总了Java中com.google.zxing.common.GridSampler.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java GridSampler.getInstance方法的具体用法?Java GridSampler.getInstance怎么用?Java GridSampler.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.zxing.common.GridSampler的用法示例。


在下文中一共展示了GridSampler.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
/**
 * 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());
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:30,代码来源:Detector.java

示例2: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
/**
 * 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());
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:30,代码来源:Detector.java

示例3: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

  GridSampler sampler = GridSampler.getInstance();
  return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:8,代码来源:Detector.java

示例4: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
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());
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:31,代码来源:Detector.java

示例5: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
private BitMatrix sampleGrid(BitMatrix image, ResultPoint topLeft, ResultPoint topRight,
                             ResultPoint bottomRight, ResultPoint bottomLeft) throws
        NotFoundException {
    GridSampler sampler = GridSampler.getInstance();
    int dimension = getDimension();
    float low = (((float) dimension) / 2.0f) - ((float) this.nbCenterLayers);
    float high = (((float) dimension) / 2.0f) + ((float) this.nbCenterLayers);
    return sampler.sampleGrid(image, dimension, dimension, low, low, high, low, high, high,
            low, high, topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(),
            bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:Detector.java

示例6: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
/**
 * 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());
}
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:43,代码来源:Detector.java

示例7: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
private static BitMatrix sampleGrid(BitMatrix image,
                                    PerspectiveTransform transform,
                                    int dimension) throws NotFoundException {

    GridSampler sampler = GridSampler.getInstance();
    return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:8,代码来源:Detector.java

示例8: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
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());
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:31,代码来源:Detector.java

示例9: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
/**
 * 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());
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:43,代码来源:Detector.java

示例10: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
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
}
 
开发者ID:Thinkmill,项目名称:reacteu-app,代码行数:33,代码来源:Detector.java

示例11: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
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());
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:10,代码来源:Detector.java

示例12: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
private static BitMatrix sampleGrid(BitMatrix image,
		PerspectiveTransform transform, int dimension)
		throws NotFoundException {

	GridSampler sampler = GridSampler.getInstance();
	return sampler.sampleGrid(image, dimension, dimension, transform);
}
 
开发者ID:Tinker-S,项目名称:FaceBarCodeDemo,代码行数:8,代码来源:Detector.java

示例13: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
private static BitMatrix sampleGrid(BitMatrix matrix, ResultPoint topLeft,
    ResultPoint bottomLeft, ResultPoint topRight, ResultPoint bottomRight, int dimension)
    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, 
      dimension, dimension,
      0.0f, // p1ToX
      0.0f, // p1ToY
      dimension, // p2ToX
      0.0f, // p2ToY
      dimension, // p3ToX
      dimension, // p3ToY
      0.0f, // p4ToX
      dimension, // 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
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:29,代码来源:Detector.java

示例14: sampleGrid

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
/**
 * 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());
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:43,代码来源:Detector.java

示例15: a

import com.google.zxing.common.GridSampler; //导入方法依赖的package包/类
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);
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:43,代码来源:Detector.java


注:本文中的com.google.zxing.common.GridSampler.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。