QR Codes Recognition [duplicate]

只谈情不闲聊 提交于 2020-01-01 19:49:07

问题


How can I recognize QR codes in an image and draw a square when a QR code is detected? I have been working with OpenCV and Visual Studio 2010 detecting squares in general and I would want to know if there is something similar (for example,an algorithm) to that to detect QR codes. Thanks in advance.


回答1:


Actually there is an algorithm to detect QR Codes that is described in ISO/IEC18004. You have to look for a specific pattern 1:1:3:1:1 (1 dark module: 1 light module: 3 dark: 1 light : 1 dark). Then you have 1 finder pattern. Afterwards you search the other 2 and you get the orientation... etc.

It is quite complicated, but this way it is possible to recognize the QR Code quite fast. The algorithm is described in pseudo code in the standard. To read is you have to pay for a copy. It is essential to have it if you plan to implement a QR Code reader.




回答2:


There's no single best algorithm for detecting a QR code in an image. Designing such an algorithm is a bit of an art and entails a lot of trial and error and testing.

zxing has a C++ port that includes a QR code detector and decoder. It's tuned for detecting codes in real time from mobile phone cameras but works in other settings. When it detects a code, it returns the finder locations which can be used to provide visual feedback.

I don't know what skill level it would take to import that code into VS but it seems more tractable to do that than try to invent your own detector algorithm.



来源:https://stackoverflow.com/questions/6912474/qr-codes-recognition

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!