2012-09-28 92 views
3

我想知道是否有任何庫可以解碼QR碼位數組而不是圖像。 對於實例:C#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} 
} 

會變成「嗨」。

我不需要任何圖像功能。

+0

檢查了這一點http://stackoverflow.com/questions/231741/qr-code-2d-barcode-coding-and-decoding-algorithms似乎 – Alex

回答

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); 
+0

謝謝。分配。 – Miz

+0

@Miz,不客氣。 – mbm

0

QrCode.Net呈現,似乎它會做什麼你正在尋找作爲它的一個特點是:

解碼QR碼給出位矩陣

+1

項目並未有解碼實現。 – Miz