开发者

QR Codes Recognition [duplicate]

开发者 https://www.devze.com 2023-03-25 13:04 出处:网络
This question already exists: QR Codes Recognition Algorithm [closed] Closed 9 years ago. How can I recognize QR codes in an image and draw a square when a QR code is detected? I have been wo
This question already exists: QR Codes Recognition Algorithm [closed] Closed 9 years ago.

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 squ开发者_运维百科ares 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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消