You are here: Start » Tutorial Exercises » Finding PCB Missing Covering (pcb)

Finding PCB Missing Covering (pcb)

Aim

Create application that will find uncovered part of printed circuit board.

Input

An image of connection slot pins. Some connections with pins are not covered with solder mask.

The input image is stored in pcb directory.

Output

The count of pins with not covered connections. The minimal area of uncovered connection should be 20 pixels.

Hints

The region of interest where uncovered elements can be found can be reduced. Only left part of pin can be analyzed.

To extract pins from the background, ThresholdToRegion filter can be used. Basic thresholding can be used because the color of pins is much brighter than the dark solder mask.

To find the defects, it is necessary to use a region morphology operation. Results of some morphology operations are showed in the image below.

Solution (AVS)

  1. Load image from a file using LoadImage.

  2. Extract pins from the image using ThresholdImage. Edit the inRoi input creating a region that covers the left side of the pins. Set inMinValue to 75.0.

  3. To get the PCB area without a covering use the OpenRegion filter with the Ellipse mask and the input value of inRadiusX set to 8. The image below shows blobs before and after opening.

  4. The resulting region is a difference between the found region and the region after opening. To get this region use RegionDifference filter. The image below shows the region before opening (red) and the region after opening (green).

  5. Opening the region allows to find the uncovered parts but also creates some artifacts on the right side of the region. Remove the right part of the region. Remove artifacts by adding RegionIntersection filter. Find intersection of the region with artifacts and a region which covers only the right ends of the pins.

  6. The next step is to split the computed region using SplitRegionIntoBlobs with the minimal region of area equal to 15px.

  7. To get the count of regions, expand Count field of input outBlobs of SplitRegionIntoBlobs filter.

Macrofilter Main finds the uncovered parts of a PCB using basic Blob Analysis technique.