为精准识别镁熔液含氢量检测中镁熔液复杂表面背景下的第一气泡,在基于图像处理的镁熔液第一气泡检测算法的基础上提出了一种基于改进半因果支持域的实时检测算法.该算法首先采用改进半因果支持域模型对4帧原始图像进行估计得到背景预测图像,其次使用原始图像减去背景预测图像得到残差图像;而后利用隔帧差分算法并结合双层流水线算法获取阈值分割后的二值图像;最后对二值图像进行逻辑与运算和形态学开运算,获取真实的第一气泡目标,并在相同实验条件下将该算法对单帧图像的预处理效果、序列图像的检测性能与基于改进背景预测和流水线算法进行比较.仿真结果表明:该算法可达到实时检测的要求,且在单帧图像预处理方面对复杂背景的抑制效果更好,预处理时间减少6.2%,同时在序列图像检测方面,算法的抗干扰能力更强,检测到的目标点更易观察,检测总时间减少17.3%.
On the basis of the existing image processing algorithm for the first bubble detection of magnesium melt,a new real-time detection method based on modified semi-causal support region was presented to accurately recognize the first bubble on the complicated surface of magnesium melt in the detection of hydrogen content in magnesium melt. Firstly,the 4 original images were estimated by using the modified semi-causal support domain model to get the background prediction images. Secondly,the residual images were obtained by subtracting the prediction image from the original image. Then,the residual images were transported into the double-pipeline and disposed by discontinuous frame difference and threshold segmentation. Finally,the real first bubble target was detected combining with the logical and algorithm and open operation of mathematical morphology. The preprocessing effect of single frame and the detection performance of the sequence image for this algorithm were compared with that of the modified background prediction and pipeline algorithm. The simulation results show that the algorithm not only meet the requirements of real-time detection but also had better suppression effect of the complex background in the aspect of single frame image preprocessing,and the pretreatment time was reduced by6. 2%. At the same time in the sequence image detection,anti interference ability of the algorithm was stronger,detected target was more easily to be observed,and total detection time was reduced by 17. 3%. Thus the algorithm laid a foundation for the application of image processing in real-time detection of hydrogen content in magnesium melt.