针对复杂背景下镁熔液第一气泡的图像识别,提出了一种基于自适应的背景预测算法。算法通过判断当前像素点邻域的像素点灰度之差是否大于预先设定的阀值T而自适应的选用不同的背景预测算法。若大于阀值T,采用分块权值背景预测算法;否则,采用固定权值背景预测算法。还将该算法与固定权值背景预测算法和分块权值背景预测算法作了对比试验,结果表明,该算法不但能够较准确地反映第一气泡的真实大小,还能有效地提高图像的峰值信噪比,其运算速度也更快。
A self-adaptive background forecast algorithm was presented aiming at image identification under complex background in magnesium alloy melt.Through judging whether the gray difference of the current pels's neighbor pels is more than the threshold valve preset,different background forecast algorithms were self-adaptively selected.If the gray difference is more than threshold value,blocking weight background forecast algorithm is adopted,while it is less than the threshold value,fixed weight background forecast algorithm is selected.Furthermore,the self-adaptive background forecast algorithm was compared with the fixed weight background forecast algorithm and blocking weight background forecast algorithm.The results show that the algorithm not only can reflect the real size of the first bubble better,but also can effectively improve the PNSR(peak signal and noise ratio) and calculating speed.