大学化学 >> 2024, Vol. 39 >> Issue (12): 378-384.doi: 10.12461/PKU.DXHX202404036

未来化学家 上一篇    下一篇

基于OpenCV的溶液浓度监测装置的设计与实现

祁皓然1, 雷明晴1, 郭书畅1, 蒋子琦1, 张益恺2, 申子嫣2   

  1. 1 北京化工大学信息科学与技术学院, 北京 102200;
    2 北京化工大学机电工程学院, 北京 102200
  • 收稿日期:2024-04-07 录用日期:2024-07-02 发布日期:2024-12-17
  • 通讯作者: 申子嫣 E-mail:shenzy@buct.edu.cn
  • 基金资助:
    教育部工程创客教育虚拟教研室青年项目;北京市高等教育学会2022年立项课题(MS2022391);北京化工大学2023本科教育教学改革重点研究项目(2023BHDJGZ06)

Design and Implementation of a Solution Concentration Monitoring Device Based on OpenCV

Haoran Qi1, Mingqing Lei1, Shuchang Guo1, Ziqi Jiang1, Yikai Zhang2, Ziyan Shen2   

  1. 1 College of Information Science and Technology, Beijing University of Chemical Technology, Beijing 102200, China;
    2 College of Mechanical and Electrical Engineering, Beijing University of Chemical Technology, Beijing 102200, China
  • Received:2024-04-07 Accepted:2024-07-02 Published:2024-12-17
  • Contact: Ziyan Shen E-mail:shenzy@buct.edu.cn

摘要: 溶液浓度的检测在科研、教学以及工业应用中具有重要意义。为了解决传统溶液检测方法流程复杂、耗时耗材、成本高等问题,本文介绍了基于颜色特征值设计出的有色溶液浓度检测方法。该方法利用一套检测溶液颜色的简易装置,研究出一种基于朗伯-比尔定律和图像比色法相结合的溶液颜色图像识别系统。利用OpenCV (Open Source Computer Vision Library)对系统采集到的不同浓度的溶液的图像进行处理,从而建立溶液的HSV (Hue,Saturation,Value)颜色特征值与其浓度的回归模型以便实现对溶液浓度的准确测量。实验结果表明该方法的线性拟合效果良好,为实验教学与工业生产质量监测提供了新的解决方案。此外,该方法所设计的检测装置进一步改良,还可以应用于测量溶液的包括pH等在内的其他数据。

关键词: 有色溶液浓度, OpenCV, 机器视觉系统, HSV颜色空间

Abstract: Solution concentration detection plays a crucial role in research, education, and industrial applications. To address the complexity, time consumption, and high costs associated with traditional methods, this study introduces a color-based solution concentration detection method. The method employs a simplified device to capture solution color, mitigates the effects of ambient light, and utilizes a system for solution color image recognition based on the Lambert-Beer law and image colorimetry. Using OpenCV (Open Source Computer Vision Library), images of solutions with varying concentrations are processed to establish a regression model correlating HSV (Hue, Saturation, Value) color features with solution concentrations, enabling accurate measurement. Experimental results demonstrate strong linear correlation (R2 = 0.99) between HSV values and concentrations, particularly with copper sulfate solutions ranging from 0 to 50 mg∙mL-1. This method offers a novel solution for quality control in industrial production and enhances educational experiments. Furthermore, the adaptable design of the detection device facilitates measurement of additional solution parameters, including pH, expanding its utility in diverse applications.

Key words: Concentration of colored solution, OpenCV, Machine vision system, HSV color model