Skip to content

Fast algorithm for Quality Control using heat maps or greyscale images of products on a factory floor that is invariant under translation, rotation, scaling and optical focus loss

License

Notifications You must be signed in to change notification settings

souvik1982/QCHeatMaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QCHeatMaps

Souvik Das, 2022
souvik1982@gmail.com

This is a fast algorithm for Quality Control using heatmaps or greyscale images of products on a factory floor. It reports the similarity between a product's reference heatmap and the heatmap of a particular product as a number between 0 (bad) and 1 (good). It disregards image rotations, image scale, temperature offsets and scale, and small variations of optical focusing.

The algorithm is being developed in the context of Quality Control for silicon detector readout chips in the Inner Tracker of the Compact Muon Solenoid Detector (Phase II) at the Large Hadron Collider. It relies on an application of the Kolmogorov-Smirnov Goodness of Fit test on heatmap data. Outlined below are the steps.

  • Detect the foreground and eliminate the background
    • Histogram the heatmap's temperature data
    • Use k-means clustering to identify and set the largest cluster to zero
    • Normalize the heatmap such that the sum of all pixels = 1
  • Find the center of mass and scale of the image
    • Find the image center $\vec{r_c}$ using the first moment: $M\vec{r_c} = \int{\vec{r} dm}$
    • Find the image scale $r_s$ using the second moment: $Mr_s^2 = \int{r^2 dm}$
  • Scan rings of radius $r$ and thickness $\delta r$ from center to boundary
    • Add temperatures of all pixels falling within the ring and call it $T$
    • This can be done fast by scanning only over pixels with an outer boundary box of $(-r-\delta r, -r-\delta r, r+\delta r, r+\delta r)$ and an inner boundary box of $(-r/\sqrt{2}, -r/\sqrt{2}, r/\sqrt{2}, r/\sqrt{2})$ around the image center $\vec{r_c}$, and finding pixels that fall within the ring.
  • Plot a graph of $T$ vs $r/r_s$
  • Given these graphs for two images, use the Kolmogorov-Smirnov test to find the similarity between them from 0 to 1.

Normalizing the temperatures disregards temperature offsets and scale. Scanning radially from the center of mass eliminates variations from rotation. Dividing the radius by the scale eliminates the scale of the image. Since the KS-statistic works on the cumulative distribution function, it does not penalize bin migrations between adjacent bins twice as a $\chi^2$ test would, thus developing an immunity against a lack of perfect optical focus.

ID = 202 ID = 203 KS-statistic = 0.999
ID = 202 ID = 204 KS-statistic = 0.999
ID = 202 ID = 205 KS-statistic = 1.000
ID = 203 ID = 204 KS-statistic = 0.978
ID = 203 ID = 205 KS-statistic = 1.000
ID = 204 ID = 205 KS-statistic = 0.998
ID = 202 ID = 205_messUp KS-statistic = 0.318
ID = 203 ID = 205_messUp KS-statistic = 0.204
ID = 204 ID = 205_messUp KS-statistic = 0.384
ID = 205 ID = 205_messUp KS-statistic = 0.294

About

Fast algorithm for Quality Control using heat maps or greyscale images of products on a factory floor that is invariant under translation, rotation, scaling and optical focus loss

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages