You are here: Start » Program Examples » Plate Measurement (Advanced)
Plate Measurement (Advanced)
Aim
The aim of the program is to measure the the length of a metal plate.
Input
An image of a metal plate.
Output
The image of the metal plate with marked segments connecting the edges vertically and information about plate's length.
Hints
This is the advanced variant of the same example as Plate Measurement. Here we use an analogous approach, however some advanced tools are applied so if you do not feel secure enough, we recommend to take a look at Plate Measurement example first.
Solution (FIS)
- Add FindFiles_Deprecated filter.
- Add LoadImage filter and connect outFilePaths with inFile.
- Add new step and name it Measure. Connect outImage to it.
- In Project Explorer find Create New Global Parameter button, click it and:
- Set name to ScanCount.
- Set type to IntegerArray.
- Set values: 5, 10, 20, 30, 50.
- Connect ScanCount to the macrofilter Measure and get inside it.
- Add MeasureObjectWidth filter.
- Connect macrofilter's inInput with inImage.
- Connect macrofilter's inScanCount with inScanCount.
- Click on MeasureObjectWidth filter and make these changes in Properties window (in the lower left corner):
- Define a scanning field in inScanField vertically and let it be wide enough (for example one third of plate's width).
- Set inStripeScanParams.StripePolarity to Bright.
- Set inStripeScanParams.MinStripeWidth to 500.
- Add RemoveNils filter. Connect outObjectWidth with inArray.
- Add Statistics_OfArray filter and connect outArray with inValues.
- Connect outStandardDeviation to macrofilter outputs and name it outStandardDeviation.
- Go back to Main and add RealArrayToProfile filter. Connect outStandardDeviation from Measure macrofilter with inArray.
Macrofilter Main
Macrofilter Measure
Used Filters
Icon | Name | Description |
---|---|---|
![]() |
MeasureObjectWidth | Measures the width of an object using stripe detection. |
![]() |
RealArrayToProfile | Converts an array of real numbers to a profile. |
![]() |
Statistics_OfArray | Computes basic statistical information out of an array of real numbers. The array must be not empty. |
![]() |
LoadImage | Loads a single image from a file. |
![]() |
RemoveNils | This filter is useful e.g. when inspecting multiple objects while some of the inspections may fail (Nil result). RemoveNils is used to ignore the failed cases in the final result. |
![]() |
FindFiles | Returns files of the input directory. |
Further Readings
- 1D Edge Detection - The article explaining how edge detection filters work.