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.

Solution (AVS)

  1. Add filter EnumerateImages to program.

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

    Circle center point should lay on the indicator hand mounting point.

    Set 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 filter ScanExactlyNStripes and set inStripeCount to 2.

    The image below shows found stripes.

  4. Get centers of found stripes using SegmentCenter.

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

  6. Add filter SegmentOrientation and expand inSegment.

  7. To created inputs of SegmentOrientation connect outputs from GetSortedElements.

  8. Create a new Empty Formula with inputs:

    • inAngle of type Real. To this input connect output of SegmentOrientation.
    • inRange of type Arc2D. Set this output to an arc like on the image below.

    • Create an output outValue of type Real and enter following formula:

      outValue = (inAngle - inRange.StartAngle) / inRange.SweepAngle * 160

Macrofilter Main finds value of an analogue indicator.

Used Filters

Icon Name Description
EnumerateImages Emulates image acquisition with images stored on disk.
GetSortedElements Returns elements corresponding to 8 smallest/biggest values from the array of values.
SegmentOrientation Computes the orientation of a segment.
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.