# Grading a QR Code

This code snippet shows how to read a QR code and retrieve its print quality grades.

## C++

```cpp
#include <eVision/EasyQRCode/EQRCodeReader.h>
```

```cpp
using namespace eVision;

// Load an image
EImageBW8 image;
image.Load("image.bmp");

// Prepare a qr code reader
EQRCodeReader reader;

// Tell the reader to compute grades for the codes read
reader.SetComputeGrading(true);

// Read the codes in this image
std::vector<EQRCode> codes = reader.Read(image);

// Retrieve the detected codes
// Retrieve the ISO15415 grades of the first code
EQRCodeIso15415GradingParameters grades = codes[0].GetIso15415GradingParameters();

// Retrieve the scan grade of the code
int scanGrade = grades.ScanGrade;
```

#### SEE ALSO
[`EQRCodeReader::Read`](../../../../doxygen_cpp/classeVision_1_1EQRCodeReader.html#aca78237d6203febd6221ed2e05cdc19b) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1EQRCodeReader.html#af3a09d6c336baba0d2d1f078f37c6877) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1EQRCodeReader.html#a98fbd0bb085de6d6d609875e6cc82ae4), [`EQRCodeReader::SetComputeGrading`](../../../../doxygen_cpp/classeVision_1_1EQRCodeReader.html#add8deda02d69778ae7cd2080499d0fc6) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1EQRCodeReader.html#a684e74bd9cf06a88da5023a1505c8100) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1EQRCodeReader.html#afcd3122bb9bc94aa6506f635f6f22508)

## C#

```cs
using eVision;
```

```cs
// Load an image
EImageBW8 image = new EImageBW8();
image.Load("image.bmp");

// Prepare a qr code reader
EQRCodeReader reader = new EQRCodeReader(); ;

// Tell the reader to compute grades for the codes read
reader.ComputeGrading = true;

// Read the codes in this image
EQRCode[] codes = reader.Read(image);

// Retrieve the detected codes
// Retrieve the ISO15415 grades of the first code
EQRCodeIso15415GradingParameters grades = codes[0].Iso15415GradingParameters;

// Retrieve the scan grade of the code
int scanGrade = grades.ScanGrade;
```

#### SEE ALSO
[`EQRCodeReader.Read`](../../../../doxygen_cs/classeVision_1_1EQRCodeReader.html#af3a09d6c336baba0d2d1f078f37c6877) [<sub>C++</sub>](../../../../doxygen_cpp/classeVision_1_1EQRCodeReader.html#aca78237d6203febd6221ed2e05cdc19b) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1EQRCodeReader.html#a98fbd0bb085de6d6d609875e6cc82ae4), [`EQRCodeReader.ComputeGrading`](../../../../doxygen_cs/classeVision_1_1EQRCodeReader.html#a684e74bd9cf06a88da5023a1505c8100) [<sub>C++</sub>](../../../../doxygen_cpp/classeVision_1_1EQRCodeReader.html#a465f2001a35e0822c1a5bb5f0d89fe72) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1EQRCodeReader.html#afcd3122bb9bc94aa6506f635f6f22508)

## Python

```py
import eVision

# Load an image
image = eVision.EImageBW8()
image.Load("image.bmp")

# Prepare a qr code reader
reader = eVision.EQRCodeReader() 

# Tell the reader to compute grades for the codes read
reader.ComputeGrading = True

# Read the codes in this image
codes = reader.Read(image)

# Retrieve the detected codes
# Retrieve the ISO15415 grades of the first code
grades = codes[0].Iso15415GradingParameters

# Retrieve the scan grade of the code
scanGrade = grades.ScanGrade
```

#### SEE ALSO
[`EQRCodeReader.Read`](../../../../doxygen_python/classeVision_1_1EQRCodeReader.html#a98fbd0bb085de6d6d609875e6cc82ae4) [<sub>C++</sub>](../../../../doxygen_cpp/classeVision_1_1EQRCodeReader.html#aca78237d6203febd6221ed2e05cdc19b) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1EQRCodeReader.html#af3a09d6c336baba0d2d1f078f37c6877), [`EQRCodeReader.ComputeGrading`](../../../../doxygen_python/classeVision_1_1EQRCodeReader.html#afcd3122bb9bc94aa6506f635f6f22508) [<sub>C++</sub>](../../../../doxygen_cpp/classeVision_1_1EQRCodeReader.html#a465f2001a35e0822c1a5bb5f0d89fe72) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1EQRCodeReader.html#a684e74bd9cf06a88da5023a1505c8100)
