You are here: Start » Program Examples » Heater Control

Heater Control

Aim

The task is to emulate heater control with HMI and interpret data from thermal camera monitoring the heater. Data should be presented as heatmap. Temperature of the heater should be measured and in Celsius degrees. Temperature of the heater should be measured and in Celsius degrees.

Input

Raw data from thermal camera, and inputs from HMI.

Output

Data from thermal camera showed as Heatmap, and measurement of temperature of heater in Celsius degrees on scale.

Data from thermal camera, contain temperature value for each pixel, with can be display as a picture, but formula provided from camera manufacturer must be used, to transform this data to Celsius degrees. this formula is: C = X*0.04 - 273.15

Result image can be converted to HeatMap with ColorizeImage filter

To measure temperature of heater, there need to be prepared custom region, that match heater area, and not the background.

Solution (AVS)

Example program has added emulation of switch, to turn on, and off heater, and additional task for fluid control of color change of HMI Indicators. This elements are optional, and as such are not needed for program to work properly. The optional parts are in ChoseImage and AdjustTrackBarColorToTemp Tasks.

First, lets generate Image with pixels values corresponding to Celsius degree, and colorize it, to look like image from thermal camera. Lest check GenerateHeatmap task.

1.  Navigate to **Examples\Heater Control (Thermal Imaging)** in your Aurora Vision Studio install directory. The Heater Images contains .avdata files.

2.  Drag and drop **Heater Images** folder to **Acquire** section of the program. It should instert **EnumerateObjects** filter. 
    Data from thermal camera are intepreted as image with **UInt16** data type.

3.  To be able to perform operations on this image, convert pixel type to **Real**, using ConvertPixelType filter.

4.  Next, it is needed to change data from thermal camera to Celsius degrees. To do this, use **MultiplyImage**, and **AddToImage** filters, to proces the image acording to formula: **C = X*0.04 - 273.15**

5.  Result image has values corresponding to celsius degrees. If you use color picker tool to inspect image, is hould return value in Celsius degrees, but is in **Real** pixelformat. 
    Most tools use **UInt8** format, so use once again **ConvertPixelType**.

6.  To get Heatmpa, use **ColorizeImage** filter. You can choose one from several available color palets. 
    As the goal of this example is recreating thermal camera vision, **Iron** palette is best suited.

7.  Place **view2DBox1** on HMI, and connect **outImage** of **ColorizeImage** to **inImage** input.

Next step is to measure average temperature of heater. This is done inside CalculateHeaterTemperature

1.  Use **ImageAverate** filter, to get average pixel value of heater. You can set region manualy, or use **regionEditor1**  on HMI  to have posibilty of seting Roi from HMI.
    In this case it is advised to prepare an default region in case region from HMI is cleered.

2.  To generate outline of selected region, use **DilateRegion**, and **RegionDifference** filters and connect it do **inData1** input of **view2DBox1**.

Macrofilter Main

Macrofilter ChooseImage

Macrofilter GenerateHeatmap

Macrofilter CalculateHeaterTemperature

Macrofilter AdjustTrackBarColorToTemp

Further Readings