| Food safety is related to human health,and foreign object detection(FOD)has important significance in food processing.X-ray is now widely used in FOD,and the accuracy and reliability of X-ray food foreign object detection depends on the recognition of X-ray food foreign object image processing.In this thesis,we build the hardware and software system of X-ray food foreign matter detection image edge detection processing.Firstly,an experimental hardware system composed of X-ray generator,X-ray detector unit,transmission mechanical device,image acquisition card and computer is established.Then,the edge detection technology is explored based on the improved Canny operator.Canny operator to detect the problem is converted to the detection of the maximum value of the unit function,the signal using the Gauss filter to smooth filtering,to filter the noise,and then select the edge of the dual threshold extraction.This thesis based on Canny operator with threshold need the shortcomings of manual selection of a on the basis of the improved edge detection algorithm is proposed.The algorithm can adjust the threshold according to the characteristics of the image itself adaptively,the selected edge to the greatest degree of retained foreign body edge at the same time,reducing the feature extraction work.This thesis also explores the edge detection of the sub pixel level of X-ray image.The Hessian matrix method based on fitting interpolation and the method of orthogonal moments based on surface fitting Zernike are realized,and the two methods are tested.Test results show that the sub pixel level edge detection method can keep more details of the food image than the pixel level operator method.Finally,this thesis also explores the edge detection algorithm based on clustering algorithm,K-means clustering algorithm and the meanshift clustering algorithm.Experimental results show that meanshift algorithm can preserve the edge details and noise have certain anti-interference ability,suitable for application in the X-ray food image edge detection.The application of support vector machine method,realizes the function design of foreign recognition software. |