You are here: Start » Program Examples » Meter

Meter

Aim:

Read the value from an analog temperature indicator.

Input:

A set of images with a thermometer showing different temperature values.

Output:

The value indicated by the indicator.

Hints:

Analog indicators have seen their best days, but there are some applications where replacing these indicators can be expensive. This example shows how to obtain the value from such analog indicators.

In this case, the hand of the meter can be easily found using the 1D Edge Detection technique. To do that, scanning should be performed on a circular scanning path.

Labeling connections is explained in this article.

Solution (FIS):

  1. In Workspace Explorer, open the workspace Examples, and in the Filmstrip window, select the Meter dataset. Drag the Image channel to the ACQUIRE section.

  2. To create a scanning path, add the CreateCirclePath filter. Select the circle input as in the image below.

    The circle center point should be on the indicator hand mounting point.

    Set the inPointCount to 64. The image below shows a scanning path with an invalid point count.

    The image below shows a path created with the correct point count.

  3. Add the ScanExactlyNStripes filter and set the inStripeCount to 2.

    The image below shows the found stripes.

  4. Get the centers of the found stripes using the SegmentCenter.

  5. Add the GetSortedElements filter and sort found centers by the outStripes.Width outStripes.Count.

  6. Label the outElement0 as Point1 and the outElement1 as Point2.

  7. Create a new Empty formula with an output outValue of type Real:

    outValue : Real? = (Segment2D(Point1, Point2).Direction - inRange.StartAngle) / inRange.SweepAngle * 160

Macrofilter Main finds the value of an analog indicator.

Used Filters

Icon Name Description
CreateCirclePath Creates a closed path containing cocircular, equidistant points.
GetSortedElements Returns elements corresponding to 8 smallest/biggest values from the array of values.
ScanExactlyNStripes Very fast detection (or presence verification) of multiple pairs of opposite edges.
SegmentCenter Computes the center point of a segment.

Further Readings

  • Formulas - Detailed information about using formulas.
  • Shape Fitting - This article presents usage of the Shape Fitting technique.