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 (FIS)
-
Add filter EnumerateImages to program.
-
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.
-
Add filter ScanExactlyNStripes and set inStripeCount to 2.
The image below shows found stripes.
-
Get centers of found stripes using SegmentCenter.
-
Add filter GetSortedElements and sort found centers by outStripes.Width outStripes.Count.
-
Label the outElement0 as Point1 and outElement1 as Point2.
-
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. |
![]() |
CreateCirclePath | Creates a closed path containing cocircular, equidistant points. |
![]() |
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.