为了实现油轮油舱液位测量的自动化和数字化,研制了一种基于S3C2440 ARM9平台的视觉自动测量仪器,使用C语言和嵌入式开发工具ADS开发出一种有效的自适应图像处理算法。根据液位测量范围自制了30m长的特殊尺子。提出了以自适应阈值二值化、数学形态学除噪和字符分割为基础的尺子图像预处理算法。在总结尺子数字和刻度特征的基础上,分析了尺子整数数字识别和小数部分读数的算法。实验结果表明:仪器每次自动读数的时间小于0.4S;识别的准确率达98%以上;精度为0.1mm。该算法具有高精度、高速度、稳定性好、自动化程度高等特点,有效解决了传统油位测量中需要人工读数和测量精度低的问题,完全满足油舱液位的实时测量要求。
In order to realize automatic measurement for liquid level of oil tank, a new type of vision automatic measurer is developed based on S3C2440 ARM9 platform. A type of adaptive image processing algorithms are developed by C language and embedded development tool, arm development suite (ADS). According to measuring range,a 30 m long ruler is specially made. Pretreatment algorithms of ruler image are presented on the basis of adaptive threshold binarization,mathematic morphology noise-removing and characters segmentation. After features of ruler characters and scales are summarized, the algorithm of integer recognition and decimal reading is analyzed. Experimental results indicate that it takes no more than 0.4 s averagely in each auto-reading and the recognition accuracy rate is 98 %, and the precision is 0.1 mm. The algorithm has the advantages of high precision, high speed, well stability, high automation, and can effectively solve the problem of low measurement precision of manual measurement methods, thus completely satisfied requirement of real-time measurement for oil tank liquid level.