There are many ways to decode QR Code these days. Here is an attempt to detect QR Code in an image to manipulate within OpenCV.
If ar is the area of a polygon r then,
Proof: I have none. May be some other time.
Download from DsynFLO box folder - https://app.box.com/s/191dc0l9hr37orltufok
Perpendicular distance of point from a line formed by two other points - Link