3

我想知道是否有任何库可以解码 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}
}

会变成“嗨”。

我不需要任何图像功能。

4

2 回答 2

1

您可以使用zxing来解码位矩阵。但是,您需要将多维整数数组转换为锯齿布尔数组。只需转换'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);
于 2012-09-28T08:47:46.230 回答
0

QrCode.Net的介绍来看,它似乎可以满足您的需求,因为它的功能之一是:

解码以位矩阵形式给出的 QR 码

于 2012-09-28T07:19:26.363 回答