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.

Solution (AVS)

  1. Add EnumerateImages filter to get load consecutive images of some disk directory.
  2. Add 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. An output inRegion should be a region of the foils and the letters.
  3. Add OpenRegion filter to remove noise and most of the letters.
  4. Add FillRegionHoles filter to fill small holes in the foils which should not be considered as defects. Set inMaxHoleArea to 10.
  5. Add OpenRegion filter to remove the remaining noises. Set inRadiusX to 6.
  6. Add CloseRegion filter to close the holes in region of foil. Set its inRadiusX to 5.
  7. Add RegionDifference filter to compute the region containing defects.
  8. To split the detected holes add SplitRegionIntoBlobs filter and set inMinBlobArea to 8.
  9. Add RegionMassCenter filter to compute the point with coordinates equal to the average coordinates of the region's pixels.
  10. Add CreateCircle filter and connect its input in.Point with a outMassCenter.

Macrofilter Main

Used Filters

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

Further Readings

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