You are here: Start » Program Examples » Fertilizer Granulation

Fertilizer Granulation

Aim

Devise an algorithm which will examine the granulation of the fertilizer and detect grains which sizes do not fit in specified range.

Input

Single image of the granulated fertilizer.

Output

Detected and circled correct and incorrect pills:

Hints

Performing some operations on the image will help you detect the center of each granule.

Solution (AVS)

  1. Add EnumerateImages filter to load the image from the disk directory.
  2. To easily distinguish the dots use SmoothImage_Gauss to make the image blurred. Change inStdDevX to 2.5.
  3. Add ImageLocalMaxima filter to detect all the centers of the circles-to-be. Change inConsiderPlateaus to true.
  4. Create a circle using CreateCircle filter. To the inPoint connect outLocalMaxima.Point - detected centers of the circles. Set inRadius parameter in filter properties as 8.
  5. The next step is to fit the circles to the original image. You can do it with FitCircleToRidges filter. As inImage use the original image. Connect outCircle positions to the inFittingField.Axis. Change of the following parameters will be required:
  6. Create a formula using right-click and Add Formula Here option to compare outCircle.Radius. Set minimal value as 6 and maximal value as 10. Add ?? False at the end of it to filter out any Nil occurrences and set them as False by default.
  7. Add DrawCircles_TwoColors. As inImage use the original image. To inCircles connect outCircle from FitCircleToRidges filter. Connect outIsInRange to inConditions. You can change the marking hue in the properties of the filter. They are green and red by default.

Macrofilter Main

Used Filters

Icon Name Description
SmoothImage_Gauss Removal of gaussian noise from images.
DrawCircles_TwoColors Draws circles on an image with two colors, depending on the status of each circle (usually: green or red for pass/fail status).
FitCircleToRidges Precise detection of a thin circular line, whose rough location is known beforehand.
CreateCircle Creates a circle from an aligned point and radius.
ImageLocalMaxima Detection of characteristic points, usually after some image transformations.
LoadImage Loads a single image from a file.

Further Readings

  • Image Processing - A comprehensive introduction to Image Processing.
  • Shape Fitting - This article presents usage of the Shape Fitting technique.