Skills Mapping
Dr P. Shields - 07/03/2024
Schedule:
Tuesday, Week 21 .

QR code


This lab script describes an image processing problem that you can solve using MATLAB. You are encouraged to complete the green screen problem before attempting this. Solving this problem will allow you to claim Programming in MATLAB at the Application level.

This is a more open-ended programming task where it is not necessarily clear what the best route is for solving it. It is based on some simple image processing steps in order to recognise and decode a two-dimensional bar code.

It will not require any of the advanced image processing toolbox that is available in the full version of MATLAB. Indeed this toolbox is not installed on MATLAB Grader, so you cannot rely on these commands.

Introduction

A QR code is one type of two dimensional bar code that can store information. An example is shown in .

Example of QR code.
Example of QR code.

The black and white squares represent a binary one if white or zero if black. A sequence of these squares can therefore represent a larger binary number.

I have provided a sequence of different tasks in MATLAB Grader for you to solve progressively more complicated codes. The final task, which will challenge the best programmers, is to find and decode a rotated QR code within a photograph, for example as shown in .

Example of a rotated QR code.
Example of a rotated QR code.

Before submitting your solution, you can run your code to check it does not produce any errors (using the Run Function/Script button). Additionally some of the tests are available as ‘pretests’ to highlight common issues. You should aim to make sure your code is suitably commented.

Resources

You will need the following resources to complete these tasks (right click and ‘Save link as…‘):

  1. code1.mat
  2. code2a.mat
  3. code2b.mat
  4. code3.mat
  5. code4seen1.mat
  6. code4seen2.jpg
  7. imageRotate.p