| In the chemistry,pharmacy manufacturing and other related fields,the crystallization reaction process of crystal is a key part of determining the quality of final products.Therefore,making crystallization process reaction under real-time monitoring can largely improve the qualification rate,which requires us to make reasonable use of image analysis to monitor it so as to control the process.In this paper,in order to obtain more clear images,an intrusive image acquisition system is exploited,but at the same time a large number of interference factors are introduced accordingly,such as shadows caused by uneven illumination,water drop interference,impurities,etc.These factors will cause traditional image segmentation methods to obtain inaccurate crystal sizes and shape judgments.The use of deep learning-based segmentation algorithms not only requires a large number of training samples but also is limited in time when training,therefore it can not meet the needs of real-time monitoring.In order to resolve the problems mentioned above,this article has carried out a series of researches and processing on the crystal image in term of computer vision:(1)The use of invasive imaging brings water drop interference and the complexity of the reaction process introduces impurity interference.In response to the above two problems,this article firstly employs a multi-scale retinal enhancement algorithm with color restoration(MSRCR)to eliminate uneven illumination interference,highlighting the difference among the shaded area,the crystal area and background.Through exploiting difference frame based on background modeling is proposed in this paper.By observing the captured images,the background of the crystal does not fluctuate dramatically during the production.The background model is constructed in the form of video segments by photographing continuously and multitudely.At the same time,in order to reduce the time complexity,the frame difference method is introduced to extract the crystal to remove background interference.Finally,for noise problems existed in the result,two image preprocessing methods,guided filtering and edge sharpening,are used to filter the image,as well as crystal edge sharpening respectively.(2)For shadow interference,this paper proposes a shadow removal algorithm based on saliency detection.By calculating the saliency value of each area in the image,the contrast between the shadow and the crystal is extremely differentiated.Through the research and analysis on the shadow characteristics,from a statistical point of view,the shading feature is summarized as a quantifiable index-variance,and the algorithm uses the characteristics of the large difference between the variance value of the shadow area and the variance value of the crystal area to eliminate the shadow.In order to prove the effectiveness of the method,the connected region algorithm is employed to construct the smallest circumscribed rectangle to quantitatively calculate the crystal size.In order to smooth the edge of the crystal and eliminate internal loopholes,the morphological opening operation and the seed filling method are adopted to process the crystal image after removing the shadow.(3)Under the interference existing in shooting environment,the captured images appear out of focus and agglomeration,which makes it more difficult to calculate the morphological characteristics of crystals.In order to obtain clear single crystal image,this paper proposes an improved classification network based on Reg Net to classify crystal images.Calculating the cross-entropy loss value for different types of input images,and then calculating the similarity of different types of images through the improved KL joint loss function proposed in this paper,as explicit supervision at the feature map level,eliminate the interference of the background color on the feature recognition,so that the crystal crystallization process can be accurately monitored.In this paper,through observation and comparison of the experimental results obtained by the above methods,the analysis of morphological characteristics of crystals and the classification of crystals have good accuracy and fast algorithm efficiency,and ensure real-time monitoring of the crystal crystallization process. |