Finding Pattern
How to find, finding patterns in a QR code? Template matching not a good idea, size and rotation confuse it. Use the structural analyzis and shape descriptors is seem to be good way. Finding patterns have a specific form, but don’t know how to use it.
A search would have lead you to an exact solution.
Are you looking for an existing library or read-to-use functionality (without the need to learn the internal working principles), or are you trying to learn the underlying algorithms that make such detections possible?