How can x-ray detect metal contaminants in a product packaged in metal?
The fact that the contaminant is metal and the packaging is also metal is irrelevant. The X-ray looks for inappropriate shapes. For example, in a tin of tuna, a small metal fragment in the meat would present an X-ray image of a small, dense, object in a field of gray (due to the tin) and it is this object recognition that is the key. Thus, detection of metal-in-metal and glass-in-glass contaminants are achievable.