Crude oil is an indispensable and important energy source for the development of China’s national economy.From newly mined crude oil to real-life refined oil,it needs to go through such processes as solid impurities separation,gas impurities separation,crude oil,and sewage separation,among which the oil-water separation process is still a difficult problem for researchers at home and abroad.Although researchers at home and abroad have made some achievements in oil-water interface detection,the interface detection and oil-water separation control system between crude oil and sewage still need to be further improved.Aiming at the deficiency of the existing oil-water interface detection accuracy,this paper adopts the improved K-means image segmentation algorithm to obtain the interface between crude oil and sewage.Aiming at the problem that the traditional PID controller as the controller of the oil-water separation control system can not meet the actual oil-water separation control effect,this paper adopts the BP neural network learning algorithm to automatically adjust the three parameters of the incremental PID controller,,4)and((9),to realiee the reasonable control of the drainage valve opening siee of the oil-water separation tank.The main contributions of this paper are reflected in the following aspects:(1)The template matching method is used to locate the oil-water interface and observe the distribution of emulsion between the oil-water interfaces;the improved Canny edge detection operator is used to detect the edge information of the oil-water interface;the seed filling region distance calculation algorithm is used to measure the distance between the oil-water equivalent interface and the upper boundary of the image.(2)The CNCS-Kmeans hard clustering algorithm was proposed and applied in the oil-water interface detection of image segmentation experiment.Using Python software Open CV computer vision library,CNCS-Kmeans hard clustering algorithm,classical K-means hard clustering algorithm,and Gaussian mixture model EM algorithm optimieed soft clustering algorithm(GMM-EM)were applied to the oil-water interface detection image segmentation process.The results show that the CNCS-Kmeans hard clustering algorithm adopted in this paper can reduce the number of training iterations and running time of the algorithm when it is applied to oil-water interface image segmentation and has a better global segmentation effect.(3)In the process of oil-water separation,BP neural network PID is used to control the opening of the drain valve,which can effectively track the position and height of the oil-water interface.Through the modeling and Simulation of the model in the Simulink module,and the construction of the actual oil-water interface experimental environment and platform.The simulation and experimental results show that the BP neural network PID controller proposed in this paper has a good tracking effect on the oil-water interface,and improves the reliability and accuracy of the system,which is suitable for the control system of oil-water separation. |