You are here: Start » Program Examples » Nails, Screws and Nuts

Nails, Screws and Nuts

Aim

The aim of the program is to distinguish nails from screws and nuts.

Input

The image of the parts.

Output

Detected nails and their dimensions.

Hints

In this example the easiest way to achieve the goal is to use Blob Analysis technique.

Solution (AVS)

  1. Add LoadImage filter.
  2. Add the ExtractBlobs_Intensity filter. Connect outImage output from a previous filter with inImage of the current one.
  3. Click on the filter and uncheck the inThresholdParams.MinIntensity parameter. Set inThresholdParams.MaxIntensity to 200 to separate the darker parts from the brighter background.
  4. Set the inBlobSplittingParams.MinArea parameter to 10 to find only these parts of required area and to make sure any noise is removed.
  5. Add the ClassifyRegions filter. Connect outBlobs from the previous filter with inRegions of the current one.
  6. Set inFeature to Elongation as it is the feature the most distinctive for nails and inMinimum to 10 so that nails are not confused with screws.

Macrofilter Main

Used Filters

Icon Name Description
LoadImage Loads a single image from a file.
ClassifyRegions Use this filter when to you have an array of regions and you want to select some of them for further processing.
ExtractBlobs_Intensity Segments an image into blobs by thresholding.

Further Readings

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