A technique is described for detecting misformed clips in hermetically scal
ed packages. The technique involves use of a machine vision system incorpor
ating an image processing algorithm, that calculates the directions of cont
ours of intensity in grey-scale images of clips. The algorithm approximatel
y locates the clip by scanning a box over the contour direction transformed
image, and finding the position of the box such that the standard deviatio
n of the directions in the box is a minimum. The clip is accurately located
by scanning a rectangular template over the contour direction transformed
image in the vicinity of the approximate location of the clip, and determin
ing, the best-fit position of the template. Accurate location of the clip e
nables the critical clip dimensions to be calculated and used for assessmen
t of clip integrity. The clip integrity is considered acceptable if all of
the critical dimensions lie within an acceptable range, as defined by prede
termined upper and lower thresholds.