Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement Realtime Barcode Scanner on Windows Phone 8.1 Runtime using ZXing and MFT

I'm working on a Windows Phone 8.1 Runtime shopping application which needs barcode scanner feature. I'm using the ZXing lib, which is fine. My problem isn't about decoding the picture, ZXing does a great job, but to get the Camera Preview realtime, and feed it to ZXing. After a little research I found this forum https://web.archive.org/web/20150328233747/http://developer.nokia.com/community/discussion/showthread.php/247707-Windows-Phone-8-1-Windows-Media-Capture-API-and-Preview-Frames. Can someone give me a working sample of combining an MFT and ZXing? Or how can I get the preview and handle it in my C# code? My project is close to the deadline, so please help me out! Right now the barcode scanning is really messy, I have a "Scan" UI button, which calls the MediaCapture.CapturePhotoToStreamAsync method, but that's not a good solution. I need realtime, automatic scanning.

Thank you!

like image 237
WPMed Avatar asked Feb 10 '15 15:02

WPMed


1 Answers

I finally found a solution. I Microsoft engineer, Matthieu Maitre, hacked together something very useful. The main purpose of his project was "Apply image effects from the Nokia Imaging SDK and DirectX HLSL pixel shaders to videos in Universal Store Apps..". He had an "effect" called "QrCodeDetector", which I tried out and worked, but was really slow. So I asked him if he could enhance the effect, and in two days he updated the nuget package, and it works, and it is lightning fast now: https://github.com/mmaitre314/VideoEffect#realtime-video-analysis-and-qr-code-detection

like image 183
WPMed Avatar answered Oct 21 '22 10:10

WPMed