The invention belongs to the technical field of image
data processing, and discloses a beverage
package defect
visual detection method and
system, and the method comprises the steps: firstly, shooting a defect-free beverage
package sample under a preset scene, and building a standard image
library; then collecting and preprocessing a to-be-detected
package image, obtaining a package model, and selecting a corresponding
reference image from the standard image
library; the detection image and the
reference image are registered, difference is carried out to obtain a difference image, and enhancement
processing is carried out on the difference image; and performing threshold
processing on the enhanced image to extract an abnormal region, analyzing features of the abnormal region to determine the position and size of a defect, and generating a detection result report. According to the method, the
optical distortion effect of the transparent package on the background pattern is analyzed, invisible defects are converted into detectable background changes, different enhancement strategies are adopted for different types of areas, the defect detection problem of the transparent package is effectively solved, and the detection sensitivity and accuracy are improved.