You are here: Start » Program Examples » Meter

Meter

Aim

Read value from an analogue temperature indicator.

Input

Set of images with thermometer showing different temperature values.

Output

Value of indication showed by indicator.

Hints

The analogue indicator have theirs best times behind. But there are some applications where replacing these indicator can be expensive. This example shows how to obtain the value from a such kind of analogue indicators.

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

Labeling connections is explained in this article.

Solution (AVS)

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

  2. To create scanning path. Add the CreateCirclePath filter. And select the circle input as in the image below.

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

    Set the inPointCount to 64. Image below shows scanning path with selected invalid point count.

    The image below shows path created with correct points count number.

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

    The image below shows found stripes.

  4. Get centers of 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 value of an analogue indicator.

Used Filters

Icon Name Description
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.
CreateCirclePath Creates a closed path containing cocircular, equidistant points.
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.