2013-05-09 144 views
0

我目前正在學習QR碼解碼器。以前,我以「https://zxingnet.svn.codeplex.com/svn/trunk/Clients/EmguCVDemo/」爲例,並重建它。我還增加了額外的功能。它工作正常如圖如下解碼多個二維碼網絡攝像頭爲基礎的QR解碼器

enter image description here

但是我很快認識到,如果有攝像頭的視頻捕獲

enter image description here

期間在圖像中更然後1個QR碼解碼器不能解碼我擡頭看着「http://zxing.org/w/docs/javadoc/com/google/zxing/multi/MultipleBarcodeReader.html」,並使用了上述方法,但如果圖像中有1個以上,它仍然不能檢測到qr碼。如果有人能夠提供一些關於這個問題的指導或教程,我將不勝感激。謝謝

回答

0

您應該EmguCVDemo內更改下面的代碼

  // decode it 
      var result = reader.Decode(image); 
      // show result 
      if (result != null) 
      { 
       ... 
      } 

  // decode it 
      var results = reader.DecodeMultiple(image); 
      // show results 
      if (results != null) 
      { 
       // it's now an array of results 
       ... 
      } 

讀者實例的初始化應該

reader = new BarcodeReaderImage(); 

改爲

reader = new BarcodeReaderImage() { PossibleFormats = new List<BarcodeFormat> { BarcodeFormat.QR_CODE } }; 
+0

海先生,感謝您的高舉。我正在基於aforge演示構建我的項目。必須將這些更改應用於emgu cv demo而不是aforge。希望能從你那聽到答覆。謝謝 – 2013-05-13 05:54:08

+0

對不起,我的錯誤先生,我給了錯誤的信息,我使用「https://zxingnet.svn.codeplex.com/svn/trunk/Clients/AForgeDemo/」 – 2013-05-13 06:40:26

+0

構建程序我已經改變了代碼解碼部分,但仍然無法讀取多個圖像。我已將我的程序粘貼到此處http://pastebin.com./B0VHKbGF。主席先生可以看看並提供建議。謝謝。 – 2013-05-13 06:44:32