You are here: Start » Program Examples » Molybdenum Foil

Molybdenum Foil


The task is to check whether the molybdenum foil inside halogen lamp is not damaged.


An image of halogen lamp. The position of the object is variable.


Region of detected defect and circle around it.


Location of object is variable. The foils are much darker than wire and glass, therefore to find them Blob Analysis technique can be used. In this case this way can be faster than performing Template Matching.

Labeling connections is explained in this article.

Solution (FIS)

  1. In Workspace Explorer open workspace Examples and in Film strip window select MolybdenumFoil dataset. Drag the Image channel to the ACQUIRE section.
  2. Add the ThresholdToRegion filter to create a region containing the foils.
    • Click the "..." button at the inRoi input to open the GUI for marking the region of interest. The halogen lamp moves mainly along the horizontal axis, thus the ROI does not have to be too big.
    • Set the inMaxValue to 50. The inRegion output should be a region of the foils and the letters.
  3. Add the OpenRegion filter to remove noise and most of the letters.
  4. Add the FillRegionHoles filter to fill small holes in the foils which should not be considered as defects. Set the inMaxHoleArea to 10.
  5. Add the OpenRegion filter to remove the remaining noises. Set the inRadiusX to 6.
  6. Add the CloseRegion filter to close the holes in region of foil. Set its inRadiusX to 5.
  7. Add the RegionDifference filter to compute the region containing defects.
  8. To split the detected holes add the SplitRegionIntoBlobs filter and set the inMinBlobArea to 8.
  9. Add the RegionMassCenter filter to compute the point with coordinates equal to the average coordinates of the region's pixels.
  10. Add the CreateCircle filter and connect its in.Point input with the outMassCenter.

Macrofilter Main

Used Filters

Icon Name Description
RegionMassCenter Computes a point with coordinates equal to the average coordinates of the region's pixels.
CreateCircle Creates a circle from an aligned point and radius.
SplitRegionIntoBlobs Segmentation of a region into individual objects when the objects do not touch each other.
CloseRegion Filling-in small gaps in a region without making it thicker.
OpenRegion Removing small parts from a region without making it thinner.
FillRegionHoles Adds pixels to the input region so that it contains no holes.
ThresholdToRegion Extraction of a region of objects that can be defined by a salient brightness.
RegionDifference Computes a region containing pixels from the first input region but not from the second input region.

Further Readings

  • Blob Analysis - Article presents detailed information about the Blob Analysis technique.