refactor/ThoughtWorks.QRCode/Codec/Reader/QRCodeImageReader.cs
(开头部分) 22KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace ThoughtWorks.QRCode.Codec.Reader
{
using System;
using System.Collections;
using ThoughtWorks.QRCode.Codec.Data;
using ThoughtWorks.QRCode.Codec.Reader.Pattern;
using ThoughtWorks.QRCode.Codec.Util;
using ThoughtWorks.QRCode.ExceptionHandler;
using ThoughtWorks.QRCode.Geom;
public class QRCodeImageReader
{
public const bool POINT_DARK = true;
public const bool POINT_LIGHT = false;
internal DebugCanvas canvas = QRCodeDecoder.Canvas;
public static int DECIMAL_POINT = 0x15;
internal SamplingGrid samplingGrid;
internal bool[][] bitmap;
internal virtual bool[][] applyCrossMaskingMedianFilter(bool[][] image, int threshold)
{
bool[][] flagArray = new bool[image.Length][];
for (int i = 0; i < image.Length; i++)
{
flagArray[i] = new bool[image[0].Length];
}
for (int j = 2; j < (image[0].Length - 2); j++)
{
for (int k = 2; k < (image.Length - 2); k++)
{
int num2 = 0;
for (int m = -2; m < 3; m++)
{
if (image[k + m][j])
{
num2++;
}
if (image[k][j + m])
{
num2++;
}
}
if (num2 > threshold)
{
flagArray[k][j] = true;
}
}
}
return flagArray;
}
internal virtual bool[][] applyMedianFilter(bool[][] image, int threshold)
{
bool[][] flagArray = new bool[image.Length][];
for (int i = 0; i < image.Length; i++)
{
flagArray[i] = new bool[image[0].Length];
}
for (int j = 1; j < (image[0].Length - 1); j++)
{
后面还有 477 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。