Spinneret Image Region of Interest Segmentation Algorithm

In order to improve the accuracy of spinneret defect detection, a spinneret image region of interest segmentation algorithm is proposed for the problem that the complex background of spinneret image interferes seriously with the subsequent detection. The mask image is obtained by separating the fixed plate area and the spinneret wall area using the diffuse water filling method, and the minimum external circle and the maximum internal circle in the mask image are found using contour detection to obtain the mask image of the spinneret area, and then the spinneret area, i.e. the Region of Interest (ROI), is extracted. The experimental results show that this method can effectively separate the spinneret region and reduce the background interference.


Introduction
Spinneret, also known as spinning cap, is an indispensable precision part of the spinning machine in the chemical fiber industry, and its state is an important condition to ensure the quality of finished fiber and good spinning process. [1][2] The main process of polyester fiber production is the formation of raw materials through high temperature melt, the melt will be sent into the spinning equipment, accurate measurement and filtration, from the spinneret micro-hole spray, after cooling device to form a silk thread, and then through a series of spinning process processing to get the final product. [3] After the production of raw materials (polyethylene terephthalate and ethylene glycol) to generate the melt through the spinning device, the spinneret area is prone to polyester fiber melt accumulation phenomenon, after a long time to form yellow spots, crystalline lumps, black lumps and other different defective points, these defective points will move with the silk strip to the post-spinning production, which will eventually affect the quality of the finished product. The spinneret image is shown in Figure 1, the spinneret image consists of three areas, respectively, the spinneret wall area, the spinneret area and the fixed plate area, the spinneret defect detection is for the detection of defects generated by the spinneret area, it can be seen by looking at the image, the spinneret wall area and the fixed plate area has a lot of stains, these stains will produce great interference with the accuracy of defect detection. At present, there is no mature equipment and methods for the detection of defects on the surface of the spinneret due to melt accumulation without removing the spinneret, and most domestic companies still use the manual visual observation method, which can only roughly determine whether there is melt accumulation on the spinneret, which will inevitably lead to is judgement and low efficiency, and cannot meet the intelligent needs of enterprises. The main purpose of this paper is to discover the spinnerets that need to be cleaned, but the methods proposed so far are almost always to determine whether the holes are clean or not. We know that dirt in the hole can lead to abnormal indicator values. But the question of which spinnerets on the production line need cleaning remains an unsolved problem. [4][5][6][7]  The literature [8] proposes the use of Gabor filter for spinneret defect detection, through the Gabor filter after edge detection to extract the edge of the defect to achieve defect detection, but the disadvantage is that for the overall image of the spinneret, the detection effect is not obvious, because the spinneret image background is complex, the detection of serious interference. In order to improve the accuracy of spinneret defect detection and solve the problem of spinneret image background interference, this paper makes improvements based on it and proposes a spinneret image region of interest segmentation method to segment the spinneret image and obtain the region of interest (ROI) with spinneret region in the spinneret image to eliminate the useless image background in order to improve the detection accuracy.

Region Segmentation Algorithm
For the characteristics of the spinneret image, first Gaussian filtering of the original image to remove the random noise in the image, in preparation for the next step to extract the region of interest (ROI), and then use the diffuse water filling method for image segmentation, respectively, the fixed plate area and the spinneret area in the image, and then the mask image for contour detection, respectively, to find the minimum outer circle and maximum inner circle of the contour, and to get the mask image of the region of interest, and finally through the mask image of the complete segmentation of the region of interest image, the algorithm flow is shown in Figure 2:

Gaussian Filtering
Gaussian noise is a common noise that is easily generated during the numerous processes of image acquisition. In order to reduce the impact of random noise on subsequent image processing, Gaussian filtering is first applied to the image. A two-dimensional Gaussian filter is required to filter a twodimensional image. A two-dimensional Gaussian filter can be obtained by multiplying a onedimensional Gaussian filter in the X-direction and a one-dimensional Gaussian filter in the Y-direction: Gaussian filtering has a good effect on Gaussian noise removal, but also causes blurring of the figure object, and the larger the filter size, the more blurred the filtered image becomes, so choose the minimum 3 × 3 size Gaussian filter for filtering, the results are shown in Figure 3.

Flood Fill
The flood fill algorithm is a very useful method that is often used to mark or isolate portions of an image for further processing or analysis. The diffuse fill algorithm can also be used to derive masks from the input image that can be used by subsequent algorithms. [9] The flood fill method is a kind of region fill method, which is essentially a seed fill method, and this method is applicable to the filling of internally defined regions. An internally defined region means that all pixels inside the region have the same color or luminance value, while pixels outside the region have another color or luminance value. The diffuse fill method can set all the pixels in the region to new values and determine a set of seed points (the seed points are intra-region points) by certain rules, and then decide whether to fill them by judging whether the neighboring pixels of the seed points and the seeds form a connected domain or not, until all the pixels in the region are found or the boundary of the contour line is reached. [10] But the traditional flood filling method does not directly divide the spinneret area, by the light angle, the spinneret image brightness is not uniform, which will make the division of the spinneret area picture is incomplete or over-segmentation, in order to solve this problem, this paper first fixed plate area and spinneret cylinder area for segmentation.

Image segmentation.
The flood filling method is divided into 3 main steps: selecting the seed point (x,y); using the seed point as the center, judging the difference between the pixel value of the 4field or 8-field and the pixel value of the seed point, adding the pixel point whose difference is less than the threshold into the region; using the newly added pixel point as the new seed point, and executing the second step repeatedly until no pixel point is added into the region. [9] According to the characteristics of the spinneret image, this paper selects the seed point at the center and edge position of the image, and fills the image with the pixel at that point, and this paper selects the diffuse water filling method in eight fields. In the segmentation of the image, the size of the threshold value directly affects the integrity and accuracy of the segmentation. The flood filling method has two thresholds, the lower bound difference value (loDiff) and the upper bound difference value (upDiff) added into the seed point region condition, which are abbreviated as L and U in this paper. when the L value is set too small, it will lead to incomplete image segmentation; when U is set too large, it will segment other regions. In order to achieve the best segmentation effect, this paper determines the optimal L and U by extensive experimental comparison. the results are shown in Figure 4:  Figure 4. Mask image after segmentation. Through the above experimental results can be found, when L is 80, U is 30, the fixed plate area segmentation effect is better; when L is 30, U is 30, the spinneret wall segmentation effect is better.

Contour Detection
The masked image after the flood filling method can be seen that the flood filling method does not completely segment the fixed plate area and the spinneret wall area, and the unsegmented part still interferes with the subsequent spinneret defect detection. In order to reduce the interference of the unsegmented part of the image and improve the accuracy of the subsequent spinneret defect detection, the mask image obtained in this paper is further processed. Specifically, firstly, the mask image of the separated fixed plate area and the mask image of the spinneret area are examined separately for contours, and the contour with the largest area is selected as the target contour, then the contour of the detected fixed area is searched for the smallest external circle of its contour, and the contour of the detected spinneret area is searched for the largest internal circle of its contour. The resulting two circles are combined to obtain the mask image of the spinneret region to lock the spinneret region and segment the ROI image with the spinneret region. The result is shown in Figure 5: Figure 5. Contour detection results. The principle of finding the minimum external circle is as follows: after contour detection of the fixed plate area mask image, multiple contour point sets will be obtained, and the area of each contour will be found, and the maximum area contour will be found to get the corresponding point set, and the minimum The principle of finding the maximum inner connection circle is as follows: Invert the spinneret wall mask image, find the maximum connected domain in the inverted image and set it as a point set A. find the nearest distance R from each element in the point set A to the contour in turn, find the maximum value max R of R and the corresponding pixel coordinates   , M x y , and draw a circle on the original mask image with the point as the center and max R as the radius to get the maximum inner connection circle of the contour. The maximum inline circle of the contour is obtained. This paper locks the spinneret area of the mask image by finding the minimum external circle and the maximum internal circle of the mask image and segmenting it, which is an innovative point of this paper. It can completely segment the spinneret area image and avoid the interference of other areas in the image to the subsequent detection, which improves the accuracy of spinneret defect detection.

Defect Detection
After segmenting the image of the region of interest with the spinneret area, the image can be detected for defects. Without the complex background interference, only the filament interference in the image is considered for defect detection. In this paper, after grayscale processing, the image is filtered by wavelet mode maximization algorithm and wavelet thresholding algorithm to reduce the filament interference, and the filtered image is analyzed by SURF descriptor to determine the defect sector and identify the defect location. Since the defect detection algorithm is not the focus of this paper, it is not described in detail here. Since the generation of defects is random, a spinneret image with defects is selected for detection in this paper, and the results are shown in Figure 6 below.

Experimental Results and Analysis
The computer configuration for this experiment: Intel(R) Core(TM) i5-10400F CPU @ 2.90 GHz 2.90 GHz, 16 GB RAM, experimental environment: Visual Studio 2017 and OpenCV 4.5.1. The selected sample images are a set of spinneret images collected at the factory site. Objective: To segment the spinneret region in the spinneret working image completely and effectively. Since there are few related studies and no related algorithms for comparison, in order to verify the effectiveness of the algorithm in this paper, the algorithm in this paper is compared with the commonly used flood filling method, watershed algorithm, and Grabcut algorithm, and the segmentation results are shown in Figure 7. The experimental results in Figure 7 show that the spinneret area segmented by the flood filling algorithm and the watershed algorithm are incompletely segmented or over-segmented and the edges are rough, which makes it difficult to identify the defects in the image in the next step. The Grabcut algorithm can completely segment the spinneret region, but it needs to artificially frame the region to be segmented, and does not segment the fixed plate region still affects the subsequent detection results. The advantage of this algorithm is that it can accurately and completely segment the region of interest with the spinneret region, and the segmented target edge is smooth.