The invention discloses an X-
ray-based pickled kohlrabi defect detection method, which comprises the following steps of: firstly, constructing a three-dimensional
database as a basic data support for attenuation compensation calculation; accurate gray value correction is performed on the collected X-
ray original image, and the gray difference between the
foreign matter and the vegetable body is highlighted; adaptive filtering,
edge enhancement and threshold segmentation
processing are sequentially carried out on the compensated image, 12-dimensional feature parameters of a target area are extracted, a
convolutional neural network model is adopted, the 12-dimensional feature parameters serve as input, and accurate classification and recognition are carried out on internal defects through deep
feature learning of a convolutional layer, a
pooling layer and a full connection layer. Through cooperation of the X-
ray source and the
image acquisition module and combination of a salted vegetable body attenuation
compensation algorithm, accurate identification of
metal foreign matters, glass, plastics and other
nonmetal foreign matters is improved, detection sensitivity is greatly improved,
foreign matter and defect characteristics are clearly highlighted, and industrial high-precision detection requirements are met.