# EasyLocateInference

| Support            | ![](assets/images/sample_programs/applies_to/cpp.svg) ![](assets/images/sample_programs/applies_to/cs.svg)  ![](assets/images/sample_programs/applies_to/qt.svg) ![](assets/images/sample_programs/applies_to/python.svg)   |
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Required licenses  | **EasyLocate**                                                                                                                                                                                                              |
| Recommended images | In the Deep Learning Additional Resources, the images from the folder `EasyLocate`                                                                                                                                          |
| Location           | `Deep Learning Inspection/EasyLocateInference` and `Console samples/Deep Learning Inspection` *with Python*                                                                                                                 |

## Purpose

This sample program demonstrates how to:

- Perform an inference with **EasyLocate**.
- Display the results.

![](assets/images/sample_programs/deep_learning_easylocateinference.webp)

## Code highlights

In the Deep Learning Additional Resources, use:

- For **EasyLocate Axis Aligned Bounding Box**:
  - Images: `EasyLocate/ElectronicComponentsBag/Images`
  - Tool: `EasyLocate/ElectronicComponentsBag/Tool 1/ElectronicComponentsBag.edltool`
- For **EasyLocate Interest Point**:
  - Images: `EasyLocate/CeramicCapa/Images`
  - Tool: `EasyLocate/CeramicCapa/Tool 1/CeramicCapa.edltool`

1. Apply the **EasyLocate** tool on an image.
   ```c++
   ELocatorResult m_Result = m_Locator->Apply(m_Img);
   ```
2. Draw the image.
   ```c++
   if (!pDoc->m_Img.IsVoid())
   {
     pDoc->m_Img.Draw(drawAdapter, 2.f, 2.f, -20, -20);
   }
   ```
3. Draw the detected bounding boxes or interest points.
   ```c++
   pDoc->m_Result.Draw(drawAdapter, true, true, 2.f, 2.f, -20, -20);
   ```
