weld camera, WeldStudio, software

Using Template Matching to Locate Features in a Weld Process

Cameron Serles
Written by Cameron Serles on July 7, 2020

Xiris has recently introduced a new version of its WeldStudio software with a powerful set of template matching tools.  Template matching is a technique in machine vision that finds small portions of an image which match a template, or model, image.  When used in imaging welding processes, it can have many applications such as measuring the quality of a torch tip; or as a way to track a target such as a seam for automated welding; or as a way to detect edges in a weld process.

When using template or pattern matching, you create a template that represents the object for which you are searching. The tool then searches for instances of the template in each candidate image, calculating a score for each match. This score indicates how closely the template resembles the located matches.  The tool is capable of finding template matches with some degree of lighting variation, blur, noise, or shape changes.

It is particularly useful when objects with unknown shape characteristics need to be found in an image.  We have implemented two versions of Template Matching tools: 


1. Geometric Pattern Matching

This tool attempts to match groups of edges in a user-taught model (or template) against groups of edges in the candidate image.  The match process can match single edges or high-level shapes that are based on groups of edges. This tool is particularly useful in helping to quickly locate objects with good geometric edge information in an image of the weld process.

Screen Shot 2020-06-29 at 10.21.35 AM

Geometric Template Matching in WeldStudio


2. Normalized Greyscale Correlation (NGC) Template Matching

The NGC Template Matching tool implements a classical Normalized Grayscale Correlation algorithm.  In general, the NGC tool works well on images where the template is primarily characterized by greyscale information (as opposed to features like edges), such as in a TIG torch tip. Templates containing intricate image data with no discernible pattern, are the most successful.

The NGC tool provides a fast general purpose algorithm to locate a part, but it is not rotation invariant (not able to process images with more than 5-10% rotation) or scale invariant (not able to process images with more than 10% variation in size).


Screen Shot 2020-06-29 at 10.21.48 AM

NGC Template Matching in WeldStudio


When to Use Template Matching Tools

When processing images of welding, template matching can be used for:

  • Inspection: detecting simple defects such as missing or broken weld wire or torch tips.
  • Alignment: determine the position of a known object by locating features of interest of the object.
  • Gauging: measure the distance, angles or other critical dimensions in an image, such as between weld torch and seam.

With either template matching tool, the user trains the model and defines the region in which to look for instances of the model.  The tool will return all instances in the image that match the model at a score above a pre-defined threshold. Each candidate match is given a score based on the match to the template greyscale or edge content; this score level must be achieved or exceeded for a match to be reported.


Template matching tools are a powerful addition to any image processing of images from a weld camera.  Two tools are available in WeldStudio that can find matches of a template based on its greyscale values (NGC template matching tool) or groups of edges (Geometric Pattern matching) in an image.

For more information contact us or request a free, one-on-one, no obligation consultation!


Better Images. Better Decisions. Better Process Control.

Follow Xiris on social media for regular updates and welding videos!

Instagram LinkedIn FacebookTwitter


Search this Blog

  • There are no suggestions because the search field is empty.

Subscribe Here!

7-2019-11-25-MachineImages edited

Don't miss a single post!

Get expert weld monitoring and inspection info sent straight to your inbox.