gpt4 book ai didi

C# QR 位数组解码

转载 作者:行者123 更新时间:2023-11-30 17:58:05 24 4
gpt4 key购买 nike

我想知道是否有任何库可以解码 QR 码位数组而不是图像。例如:

{
{1,1,1,1,1,1,1,0,0,0,1,0,1,0,1,1,1,1,1,1,1},
{1,0,0,0,0,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,1},
{1,0,1,1,1,0,1,0,1,0,1,1,0,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,0,0,0,0,1,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,0,1,1,1,0,1},
{1,0,0,0,0,0,1,0,1,1,1,0,0,0,1,0,0,0,0,0,1},
{1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,0,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,0},
{1,1,1,1,1,1,0,0,1,0,0,1,0,1,0,1,0,1,1,1,1},
{0,1,1,0,0,0,1,1,0,1,1,1,0,0,1,1,1,1,1,0,1},
{1,0,0,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1},
{0,1,1,0,1,1,1,1,0,0,1,1,0,1,1,1,0,0,1,0,0},
{0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,1,0,1,0,0},
{1,1,1,1,1,1,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0},
{1,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1},
{1,0,1,1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1},
{1,0,1,1,1,0,1,0,1,0,0,0,0,1,1,1,0,0,0,1,1},
{1,0,1,1,1,0,1,0,0,1,1,1,0,1,1,1,0,1,1,0,1},
{1,0,0,0,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0,0,0},
{1,1,1,1,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,1,0}
}

会变成“嗨”。

我不需要任何图像功能。

最佳答案

你可以使用 zxing解码位矩阵。但是,您需要将多维整数数组 转换为交错 bool 数组。只需将 '1' 转换为 'true' 并将 '0' 转换为 'false'。执行以下操作(假设您引用了正确的库)以获得结果。

bool[][] bData; //this should be the converted bit matrix
com.google.zxing.qrcode.decoder.Decoder dec = new com.google.zxing.qrcode.decoder.Decoder();
com.google.zxing.common.DecoderResult result = dec.decode(bData);

关于C# QR 位数组解码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12634982/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com