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


Java FinderPattern.getEstimatedModuleSize方法代码示例

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


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

示例1: compare

import com.google.zxing.qrcode.detector.FinderPattern; //导入方法依赖的package包/类
public int compare(FinderPattern center1, FinderPattern center2) {
    float value = center2.getEstimatedModuleSize() - center1.getEstimatedModuleSize();
    if (((double) value) < 0.0d) {
        return -1;
    }
    return ((double) value) > 0.0d ? 1 : 0;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:MultiFinderPatternFinder.java

示例2: a

import com.google.zxing.qrcode.detector.FinderPattern; //导入方法依赖的package包/类
public int a(FinderPattern finderpattern, FinderPattern finderpattern1)
{
    float f = finderpattern1.getEstimatedModuleSize() - finderpattern.getEstimatedModuleSize();
    if ((double)f < 0.0D)
    {
        return -1;
    }
    return (double)f <= 0.0D ? 0 : 1;
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:10,代码来源:c.java

示例3: compare

import com.google.zxing.qrcode.detector.FinderPattern; //导入方法依赖的package包/类
@Override
public int compare(FinderPattern center1, FinderPattern center2) {
  float value = center2.getEstimatedModuleSize() - center1.getEstimatedModuleSize();
  return value < 0.0 ? -1 : value > 0.0 ? 1 : 0;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:6,代码来源:MultiFinderPatternFinder.java

示例4: selectMutipleBestPatterns

import com.google.zxing.qrcode.detector.FinderPattern; //导入方法依赖的package包/类
private FinderPattern[][] selectMutipleBestPatterns() throws NotFoundException {
    List<FinderPattern> possibleCenters = getPossibleCenters();
    int size = possibleCenters.size();
    if (size < 3) {
        throw NotFoundException.getNotFoundInstance();
    } else if (size == 3) {
        FinderPattern[][] finderPatternArr = new FinderPattern[1][];
        finderPatternArr[0] = new FinderPattern[]{(FinderPattern) possibleCenters.get(0),
                (FinderPattern) possibleCenters.get(1), (FinderPattern) possibleCenters.get(2)};
        return finderPatternArr;
    } else {
        Collections.sort(possibleCenters, new ModuleSizeComparator());
        List<FinderPattern[]> results = new ArrayList();
        for (int i1 = 0; i1 < size - 2; i1++) {
            FinderPattern p1 = (FinderPattern) possibleCenters.get(i1);
            if (p1 != null) {
                for (int i2 = i1 + 1; i2 < size - 1; i2++) {
                    FinderPattern p2 = (FinderPattern) possibleCenters.get(i2);
                    if (p2 != null) {
                        float vModSize12 = (p1.getEstimatedModuleSize() - p2
                                .getEstimatedModuleSize()) / Math.min(p1
                                .getEstimatedModuleSize(), p2.getEstimatedModuleSize());
                        if (Math.abs(p1.getEstimatedModuleSize() - p2.getEstimatedModuleSize
                                ()) > DIFF_MODSIZE_CUTOFF && vModSize12 >=
                                DIFF_MODSIZE_CUTOFF_PERCENT) {
                            break;
                        }
                        for (int i3 = i2 + 1; i3 < size; i3++) {
                            FinderPattern p3 = (FinderPattern) possibleCenters.get(i3);
                            if (p3 != null) {
                                float vModSize23 = (p2.getEstimatedModuleSize() - p3
                                        .getEstimatedModuleSize()) / Math.min(p2
                                        .getEstimatedModuleSize(), p3.getEstimatedModuleSize());
                                if (Math.abs(p2.getEstimatedModuleSize() - p3
                                        .getEstimatedModuleSize()) > DIFF_MODSIZE_CUTOFF &&
                                        vModSize23 >= DIFF_MODSIZE_CUTOFF_PERCENT) {
                                    break;
                                }
                                Object test = new FinderPattern[]{p1, p2, p3};
                                ResultPoint.orderBestPatterns(test);
                                FinderPatternInfo info = new FinderPatternInfo(test);
                                float dA = ResultPoint.distance(info.getTopLeft(), info
                                        .getBottomLeft());
                                float dC = ResultPoint.distance(info.getTopRight(), info
                                        .getBottomLeft());
                                float dB = ResultPoint.distance(info.getTopLeft(), info
                                        .getTopRight());
                                float estimatedModuleCount = (dA + dB) / (p1
                                        .getEstimatedModuleSize() * 2.0f);
                                if (estimatedModuleCount <= MAX_MODULE_COUNT_PER_EDGE &&
                                        estimatedModuleCount >= MIN_MODULE_COUNT_PER_EDGE &&
                                        Math.abs((dA - dB) / Math.min(dA, dB)) < 0.1f) {
                                    float dCpy = (float) Math.sqrt((double) ((dA * dA) + (dB
                                            * dB)));
                                    if (Math.abs((dC - dCpy) / Math.min(dC, dCpy)) < 0.1f) {
                                        results.add(test);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (!results.isEmpty()) {
            return (FinderPattern[][]) results.toArray(new FinderPattern[results.size()][]);
        }
        throw NotFoundException.getNotFoundInstance();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:71,代码来源:MultiFinderPatternFinder.java

示例5: compare

import com.google.zxing.qrcode.detector.FinderPattern; //导入方法依赖的package包/类
@Override
public int compare(FinderPattern center1, FinderPattern center2) {
    float value = center2.getEstimatedModuleSize() - center1.getEstimatedModuleSize();
    return value < 0.0 ? -1 : value > 0.0 ? 1 : 0;
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:6,代码来源:MultiFinderPatternFinder.java


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