#### 期刊菜单

Real-Time Detection of Tube Position Based on Image Processing
DOI: 10.12677/SEA.2022.113045, PDF, HTML, XML, 下载: 107  浏览: 189  国家自然科学基金支持

Abstract: In order to solve the problem of low efficiency and error-prone manual identification of test tube positions, a method for automatic real-time detection and identification of test tube positions on medical refrigerator boxes was designed by using image processing technology. The video stream is read through the USB camera. The USB camera needs to be calibrated and de-distorted, and each frame of image obtained is read by OpenCV, and the first frame of image is retained. Determine the ROI rectangular range of the detected refrigerated box, the four vertices of each test tube grid on the refrigerated box and the center point of the four vertices on the image, and convert each frame image and the first frame image into a grayscale image after differential operation. Set the threshold and obtain the exact relative coordinate position of the test tube on the refrigerated box according to this center point position index. The test results show that the method can effectively and real-time complete the detection and recognition of the position of the test tube, and the accuracy rate can reach almost 100%, which has great practical value.

1. 引言

2019年由一种新型冠状病毒引发的新型冠状病毒肺炎，给我国人民以及世界人民的身体健康带来了很大影响。疫苗等需要使用大量的试管试剂，大量的试管试剂如果通过人工识别标记，不仅效率低而且容易因疲劳出错，对人民健康带来不良影响 [1] [2]。

2. 摄像机标定

$\begin{array}{l}{x}_{corrected}=x\left(1+{k}_{1}{r}^{2}+{k}_{2}{r}^{4}+{k}_{3}{r}^{6}\right)\\ {y}_{corrected}=y\left(1+{k}_{1}{r}^{2}+{k}_{2}{r}^{4}+{k}_{3}{r}^{6}\right)\end{array}$ (1)

$\begin{array}{l}{x}_{corrected}=x+\left[2{p}_{1}xy+{p}_{2}\left({r}^{2}+2{x}^{2}\right)\right]\\ {y}_{corrected}=y+\left[2{p}_{2}xy+{p}_{1}\left({r}^{2}+2{y}^{2}\right)\right]\end{array}$ (2)

Figure 1. A sample checkerboard

3. 获取视频流读取帧图像

$NRMSE=\frac{{{\sum }_{m=0}^{M-1}{\sum }_{n=0}^{N-1}|y\left[m,n\right]-x\left[m,n\right]|}^{2}}{{\sum }_{m=0}^{M-1}{\sum }_{n=0}^{N-1}x{\left[m,n\right]}^{2}}$ (3)

4. 图像处理技术

4.1. RGB彩色图像灰度化

$f\left(x,y\right)=0.299\text{R}\left(x,y\right)+0.578\text{G}\left(x,y\right)+0.114\text{B}\left(x,y\right)$ (4)

Figure 2. RGB color image

Figure 3. Grayscale image

4.2. 图像去噪与自适应阈值化

$G\left(x,y\right)=\frac{1}{2\text{π}{\sigma }^{2}}{\text{e}}^{-\frac{{x}^{2}+{y}^{2}}{2{\sigma }^{2}}}$ (5)

Figure 4. Gaussian filtered image

Figure 5. Image after adaptive thresholding

4.3. ROI区域选取

Figure 6. ROI area

4.4. 试管格坐标点确定

Figure 7. Test tube grid coordinate points

5. 试管位置检测

Figure 8. After differential processing

Figure 9. Live tube position coordinates obtained in real time

6. 测试

Figure 10. Test tube refrigeration box

Figure 11. TW-T503 and USB camera (camera left, TW-T503 right)

Figure 12. Product drawing (① where the USB camera is placed, ② is a test tube refrigerated box)

Figure 13. The position of the tube detected on the platform

Figure 14. Test case

7. 结论

8. 结语

NOTES

*通讯作者。

 [1] 郭宽. 数字图像处理技术在医学领域的应用[J]. 科技与创新, 2016(13): 106. [2] 朱晓萌, 姜峰, 庞嘉楠. 数字图像处理技术在中医眼诊方面的应用[J]. 科技创新导报, 2020, 17(16): 148-149+151. [3] 徐天宇. 基于霍夫变换及卷积神经网络的试管数目识别[J]. 电子技术与软件工程, 2020(2): 135-136. [4] 陆秦江. 基于图像处理的试管识别系统的设计与实现[D]: [硕士学位论文]. 苏州: 苏州大学, 2017. [5] 赵真宗. 血标本试管架及试管识别报警系统的临床应用及效果评价[J]. 中国卫生标准管理, 2017, 8(2): 123-125. [6] 宋美萍. 数字图像处理中的图像分割技术应用研究[J]. 电子技术及软件工程, 2017(1): 75. [7] Luo, X. and Cai, G. (2021) Computer Image Processing System Based on Feature Extraction Technology. Journal of Physics: Conference Series, 1952, Article ID: 022046. https://doi.org/10.1088/1742-6596/1952/2/022046 [8] Shelke, S.K., Sinna, S.K. and Singh Patel, G. (2021) Study of End to End Image Processing System Including Image De-noising, Image Conpression & Image Secu-rity. Wireless Personal Communications, 121, 209-220. https://doi.org/10.1007/s11277-021-08631-9 [9] 叶一帆. 基于计算机视觉算法的图像处理技术研究[J]. 长江信息通信, 2021, 34(10): 73-75. [10] 李德伟, 裴震宇. 数字图像处理的关键技术及应用[J]. 电子技术及软件工程, 2018(6): 65. [11] Shi, Z.C., Shang, Y., Zhang, X.F. and Wang, G. (2021) DLT-Lines Based Camera Calibration with Lens Radial and Tangential Distortion. Experimental Mechanics, 61, 1237-1247. https://doi.org/10.1007/s11340-021-00726-5 [12] Kim, J., Bae, H. and Lee, S.G. (2021) Image Distortion and Rectification Calibration Algorithms and Validation Technique for a Stereo Camera. Electronics, 10, Article No. 339. https://doi.org/10.3390/electronics10030339 [13] 张伟, 程鸿, 韦穗. 摄像机标定系统的设计与实现[J]. 计算机工程, 2007(2): 255-256+276. [14] 喻夏琼, 秦晓东, 高超, 孙韬. 基于矩特征和鲁棒性估计的摄像机标定方法[J]. 测绘工程, 2021, 30(6): 16-20+26. [15] 赖文敬, 周延周, 朱文卓, 鲍鸿. 一种基于棋盘格模板单目摄像机高精度标定方法[J]. 广东工业大学学报, 2015, 32(3): 79-84. [16] Sivkov, S., Novikov, L., Romanova, G., Romanova, A., Vaganov, D., Valitov, M., et al. (2020) The Algorithm Development for Operation of a Computer Vision System via the OpenCV Library. Procedia Computer Science, 169, 662-667. https://doi.org/10.1016/j.procs.2020.02.193 [17] Gao, F., Luo, D. and Ma, X. (2020) Research on Facial Expres-sion Recognition of Video Stream Based on OpenCV. International Journal of Biometrics, 13, 114-129. https://doi.org/10.1504/IJBM.2021.112219 [18] 夏帮贵. OpenCV计算机视觉基础教程[M]. 北京: 中国工信出版集团, 人民邮电出版社, 2021. [19] Wei, H. and Peng, Q. (2018) A Block-Wise Frame Difference Method for Real-Time Video Motion Detection. International Journal of Advanced Robotic Systems, 15, Article ID: 172988141878363. https://doi.org/10.1177/1729881418783633 [20] Cheng, Y.H. and Wang, J. (2014) A Motion Image Detection Method Based on the Inter-Frame Difference Method. Applied Mechanics and Materials, 490-491, 1283-1286. https://doi.org/10.4028/www.scientific.net/AMM.490-491.1283 [21] 胡东红, 汪浩, 艾君, 张玲, 张胜兰. 两种图像校正算法在实际应用中的比较[J]. 计算机工程与应用, 2009, 45(13): 191-193+226. [22] 许宏. 基于图像差分的关键帧检测技术[J]. 计算机工程与设计, 2010, 21(12): 2849-2852.