# How to best identify QR markers?

**URL:** https://forum.opencv.org/t/how-to-best-identify-qr-markers/2817
**Category:** C++
**Tags:** homography
**Created:** [April 17, 2021, 3:22pm UTC](https://forum.opencv.org/t/how-to-best-identify-qr-markers/2817 "2021-04-17T15:22:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hamzaabd](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@hamzaabd](https://forum.opencv.org/u/hamzaabd)
#### Post date: [April 17, 2021, 3:22pm UTC](https://forum.opencv.org/t/how-to-best-identify-qr-markers/2817/1 "2021-04-17T15:22:46Z")

</div>

I have made a code to identify QR markers but I want to make sure that it is the correct method. My current method is to make the QR marker canonized (make the QR marker fit a square ) and then resize it to an 8 by 8 image and then see for each pixel if it is 1 or 0 and store that in an array. Then I match it with an array made from a list of the original markers. This works but some of the QR markers are not identified which is why I wanna see if there are other methods. Maybe I should look at the features of the QR markers to find a match instead?

---

<div class="post-metadata">

### Author: ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)
#### Post date: [April 17, 2021, 4:00pm UTC](https://forum.opencv.org/t/how-to-best-identify-qr-markers/2817/2 "2021-04-17T16:00:24Z")

</div>

sounds like you’re reinventing the wheel.

why not use one of the existing qr schemes in opencv, e.g. [here](https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html) or [here](https://docs.opencv.org/master/dd/d63/group __wechat__ qrcode.html) ?

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [April 18, 2021, 8:57am UTC](https://forum.opencv.org/t/how-to-best-identify-qr-markers/2817/3 "2021-04-18T08:57:22Z")

</div>

there’s a difference between “QR codes” and “augmented reality markers”.

QR codes convey data, and nothing else. it can be a lot of data, kilobytes even. they’re designed so that a machine can robustly recover all the information.

AR markers have a simple identity (a dozen bits or so), and they allow a camera to determine its precise location relative to the marker.

QR codes aren’t designed for localization, AR markers aren’t designed to hold a lot of data.

![QR code from wikipedia](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/1/1297b29545dbf22e02fac22cf876e23965924006.png) ![comparison of AR markers from wikipedia](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/4/4de470c688364bed3b3adcb71dd9cc1c42632d31.png)
