Basics of Position Detection

Position measurement (Search mode)

One of the common applications of machine vision is position/angle measurement.
Glass substrates need more accurate position information. Inspection of ICs requires processing capability that can keep up with high-speed production lines. Position/angle measurement is also used generally as a position correction function to correct the misalignment of a target before stain or edge inspection described in previous topics. This page mainly introduces the most generally used Pattern search mode and explains details of method for stable detection based on its principle.

Pattern search mode algorithm

What is Pattern search?

Pattern search finds one or more patterns that are similar to a reference image (pattern) in the entire image and output the located position, angle and correlation value (degree of coincidence).

The Pattern search mode of KEYENCE CV-X Series uses the following algorithm.

Process 1Compress the pattern image and search image to reduce the amount of data.
Input image pattern window

Input image pattern window

Decimated pattern window(illustration)

Decimated pattern window(illustration)

Pattern matching (normalized correlation) involves an enormous amount of processing and calculating all the information for an input image requires a tremendous amount of time. Consequently, limit the number of pixels used for the calculation to reduce the amount of data and save processing time. This process is called decimation or compression.

Process 2First search

Move the window within the search area at a specific interval to find the position where the correlation value is the highest. This interval is called step width or skip. When rotation correction has been set, the window is rotated by the necessary angle to search for the position in the same way.

Process 3Second search

Search a narrower area around the position found in the first search by using a pattern compressed at lower ratio to find the position where the correlation value is the highest. * Sometimes this process may be repeated using several lower compression ratios.

Process 4Final detection

Search the area around the position found in Process 3 using a non-compressed pattern and then perform sub-pixel processing.

Typical examples of inspection using search mode

Positioning of glass substrates

Before glass substrates are laminated, the positions of the markings at the diagonal points of the substrates are measured for alignment.

Positioning of glass substrates

Inspection for misaligned labels on bottles

Misalignment of labels pasted on bottles is measured. Since 100% inspection is possible even on high-speed production lines, this prevents defective workpieces from being sent to the next process.

Checking IC orientation

The orientations of ICs on an index table are determined based on the angle detected by the search for the marking on the ICs. This requires processing capability that can keep up with high-speed production lines.

Points to prevent search failure

Cause of search failure

As explained in the algorithm section, the first search detects the approximate position by using a compressed image of the reference pattern for faster processing.

The major cause of search failure is that a pattern that should not be detected (candidate 2 in the figure below) is detected as a candidate in the first search when a compressed image is used.

Points on preventing search failure (Changing the compression ratio)

With the KEYENCE CV-X Series, you can set various search parameters (such as compression ratio), which previously required expert knowledge, by selecting a group of items predefined for each purpose. Compression ratio is defined through the setting item Search sensitivity. It can be set to seven levels from Low to High.

Search sensitivity Hight

Search sensitivity Low

In the terminal example, the image looks like those on the right depending on the search sensitivity (compression ratio). Using an image closer to the reference image for the first search prevents incorrect detection of a similar image.

Points on stabilizing search (improving result accuracy)

You can prevent most search failures by taking the measures described in Points on preventing search failure. Sometimes one additional factor is required for search: Accuracy. You need to suppress variations in the values. In terms of the algorithm described above, accuracy is the level of precision which can be achieved in the final process. This section explains methods for improving the accuracy of final results.

What measures are effective in improving the accuracy of results?
  1. Increase the number of times the final process is repeated (fine search).
  2. Use the continuous capture function.
  3. Use the image enhance filters.

(1) Increase the number of times the final process is repeated (fine search).

In addition to using search sensitivity to change the compression ratio, there is another parameter called search accuracy. This parameter sets the number of steps in the search, which can be set from Coarse to Fine (five levels).

If you want to obtain more accurate measurement results, set a finer Search accuracy to increase the number of times that the processes for the second and final searches are repeated. This can improve the accuracy of the final result.

(2) Use the continuous capture function.

The continuous capture function is a function that repeats an image capture and image processing several times for a single trigger input and measures the average, maximum and minimum values of the results. It can suppress variations in measured values compared to the values obtained with a single capture.

Next generation search: Geometry search

In addition to the Pattern search that uses a normalized correlation method, there is the Geometry search that searches for targets based on profile information. The KEYENCE CV-X Series has PatternTrax for this purpose.

Since PatternTrax uses profile information, even when a part of the target is missing, it ensures accurate search based on the remaining shape information. This function can also address size fluctuations or black/white inversion of targets. Detection is stable regardless of the change in surface treatment conditions.

Positioning for glass substrates lamination

Detection is stable even when the frame covers the mark and the shape of the mark looks different.

Cases where detection was difficult with conventional Pattern search

  • [Partially missing pattern (overlaid)]
  • [Size/focus fluctuation]
  • [Black/white inversion (negative image)]

Solved by PatternTrax

  • [Partially missing pattern (overlaid)]
  • [Size/focus fluctuation]
  • [Black/white inversion (negative image)]

Detection using PatternTrax

  • Search by using an extracted edge shape
    Edge information of the registered image
    Edge information of the registered image
  • Search for a similar edge shape from the edges of the input image

Summary of position measurement (search mode)

Remember the following points to ensure stable search with machine vision.

  • Knowledge of the search detection principle helps select the optimum mode and detailed settings.
  • Changing the Search sensitivity is effective when the search deviates from the target.
  • Changing the Search accuracy increases the accuracy of the final detection.
  • Geometry search uses profile information according to the condition and shape of the target.

The next topic is the method to inspect moving targets properly by understanding position correction.

A position correction function is necessary for inspection of targets moving on lines.

Key points for understanding position correction are: correction source inspection, correction target inspection, coordinate axes, and rotation angle. Let's look at these points in detail.