采用POSIT算法的中餐宴会台面的测距方法

2019-10-14 03:18王粟朱飞
现代电子技术 2019年19期
关键词:图像处理

王粟 朱飞

摘  要: 针对中餐宴会台面人工测量餐具间距离出现的问题,将图像处理和人工智能技术引入台面摆台效果评判中,提出一种POSIT算法求解中餐宴会台面上餐具间距离的方法。首先,利用Hough圆检测算法识别出中餐宴会台面摆台上的餐碟、汤碟、味碟、水杯、葡萄酒杯和白酒杯上的圆,通过K?means聚类算法对中餐宴会客人人数和餐桌中心花瓶进行聚类;其次,在设计的黑白标定板中选取4个共面点,利用共面POSIT算法估算相机在目标坐标系下的旋转矩阵和平移向量,根据摄像机模型得出聚类标号为10上各餐具间的实际距离。实验结果表明,与人工测量相比,该方法测量精度高、稳定性良好。

关键词: 测距方法; 餐具间距求解; POSIT算法; 图像处理; Hough变换; K?means聚类

中图分类号: TN98?34                         文献标识码: A                            文章编号: 1004?373X(2019)19?0139?05

Abstract: The image processing and artificial intelligence technology are introduced into the evaluation of the table top effect to solve the problem of artificially measuring the distance between table wares in the Chinese banquet table. A method of solving the distance between the table wares on the Chinese banquet table is proposed. The Hough circle detection algorithm is used to identify the circle on the plate, soup plate, saucer, water cup, wine glass and white wine glass on the table of the Chinese banquet table. The number of Chinese banquet guests and the table center vase are clustered by the K?means clustering algorithm. Four coplanar points are selected in the designed black?white calibration plate. The coplanar POSIT algorithm is used to estimate the rotation matrix and translation vector of the camera in the target coordinate system. The actual interval distance of table wares on the clustering label 10 is obtained according to the camera model. The experimental results show that, in comparison with manual measurement, the method has higher measurement accuracy and better stability.

Keywords: ranging method; tableware interval solution; POSIT algorithm; image processing; Hough transform; K?means clustering

0  引  言

随着我国经济的不断发展和第三产业所占比重的上升,国内对旅游和酒店管理相关专业的人才需求量也在增加。中餐宴会台面摆台是旅游与酒店管理专业学生在人才培养过程中必须掌握的基本功,国内大多数职业技术学院都有针对该专业学生开设的宴会台面摆台的实习实训课程和技能大赛等。然而,目前存在的一个突出问题是:学生摆台效果的评判都是依靠实训老师或大赛评委通过目测和工具测量完成的。它存在的弊端包括:费力,工作量大;费时,测量和打分评价耗费时间长,不能立即得到摆台效果的评分结果;精度低,人工测量时误差较大,精度不高;稳定性差,容易受人的主观性影响。

一种可行的解决方案是将图像处理和人工智能技术引入旅游与酒店管理专业的台面摆台效果评判中,彻底改变原来完全依靠人工评判的现状,也克服原来评判方式存在的诸多弊病。要实现中餐宴会摆台的定位,除了餐具识别之外,另一个重点和难点就是如何根据不同视角下的台面摆台图像测算餐具间的真实距离问题。视觉定位方法有单目视觉定位和立体视觉定位,其中,立体视觉定位算法理论[1?3]相对复杂,求解花费的时间比较长,实时性比较差。文献[4]提出一种采用SoftPOSIT算法对某卫星进行位姿估计。文献[5]中利用单连接聚类算法和SoftPOSIT算法,可以实现相机位姿的三维跟踪。文献[6]中采用PnP多点透视结合POSIT算法对标识物进行跟踪,得到识别面可达86.67%,它的识别速度快,实时性好。上述单目视觉定位方法都是针对不同的具体问题提出的解决方案,不具有通用性,显然也不适合中餐宴会台面摆台个性化定位的需求。本文提出一种基于POSIT算法求解中餐宴会台面上餐具间距离问题的方法。

1  图像识别

1.1  Hough变换检测圆

Hough变换是从图像中识别几何形状的常见图像处理方法,其应用领域比较广泛[7]。对于方程[(x-a)2+(y-b)2=r2],该方程中有3个参数,[(a,b)]代表圆心坐标,[r]代表圆的半径。如点[(xi,yi)]对应的输入空间a?b的参数方程表达式为[(a-xi)2+(b-yi)2=r2],由参数方程可知为一个三维的锥面。在图像空间中圆周上的任意一点坐标[(xi,yi)],它们在参数空间中都为一个三维锥面[8?9],如图1所示。

图2为中餐宴会台面摆台,利用Hough找圆算法找出餐碟、汤碟、味碟、水杯、葡萄酒杯和白酒杯共6种餐具的圆以及相应的像素坐标。识别圆形餐具是实现定位的最重要一步,为后面测算餐具间的距离做好铺垫。

在OpenCV中利用HoughCircles函数通过霍夫变换算法检测出灰度图中的圆,在图3中用浅黑色的圆圈出了找到的圆形餐具。

5  结  语

本文将POSIT算法引入中餐宴会台面摆台的定位中,利用共面POSIT算法估计相机在目标坐标系下的旋转矩阵和平移向量,然后根据摄像机模型计算得出聚類标号为10上餐具间的距离。本文提出的定位方法可以解决从不同视觉测算台面摆台图像中餐具间真实距离的难题,为机器视觉和人工智能等新技术在该领域的顺利应用扫清了障碍,进而实现中餐宴会摆台定位的自动化、快速化、客观化和智能化,彻底变革该细分领域内完全依靠人工评判的现状。

参考文献

[1] 沈彤,刘文波,王京.基于双目立体视觉的目标测距系统[J].电子测量技术,2015,38(4):52?54.

SHEN Tong, LIU Wenbo, WANG Jing. Target ranging system based on binocular stereo vision [J]. Electronic measurement technology, 2015, 38(4): 52?54.

[2] 杨景豪,刘巍,刘阳,等.双目立体视觉测量系统的标定[J].光学精密工程,2016,24(2):300?308.

YANG Jinghao, LIU Wei, LIU Yang, et al. Calibration of bi?nocular stereo vision measurement system [J]. Optical precision engineering, 2016, 24(2): 300?308.

[3] 倪章松,顾艺,柳庆林,等.大视场双目立体视觉柔性标定[J].光学精密工程,2017,25(7):1882?1889.

NI Zhangsong, GU Yi, LIU Qinglin, et al. Flexible calibration of binocular stereo vision in large field of view [J]. Optical precision engineering, 2017, 25(7): 1882?1889.

[4] 张鑫,张雅声,程文华,等.基于SoftPOSIT算法的单目视觉非合作目标相对位姿估计[J].上海航天,2016,33(3):124?129.

ZHANG Xin, ZHANG Yasheng, CHENG Wenhua, et al. Relative position estimation of monocular vision non?cooperative target based on SoftPOSIT algorithm [J]. Shanghai aerospace, 2016, 33(3): 124?129.

[5] 陈鹏.基于单目视觉的像机位姿估计技术[D].北京:北京科技大学,2015.

CHEN Peng. Camera position estimation technology based on monocular vision [D]. Beijing: University of Science and Technology Beijing, 2015.

[6] 韩雪.基于三维标识物的医用增强现实跟踪注册方法研究[D].长春:吉林大学,2017.

HAN Xue. Research on medical augmented reality tracking re?gistration method based on three?dimensional markers [D]. Changchun: Jilin University, 2017.

[7] FERNANDESL A F, OLIVEIRA M M. Real?time line detection through an improved hough transform voting scheme [J]. Pattern recognition, 2008, 41(1): 299?314.

[8] 朱桂英,张瑞林.基于Hough变换的圆检测方法[J].计算机工程与设计,2008,29(6):1462?1463.

ZHU Guiying, ZHANG Ruilin. Circle detection method based on hough transform [J]. Computer engineering and design, 2008, 29(6): 1462?1463.

[9] 焦圣喜,肖德军,阚一凡.霍夫变换算法在圆心视觉定位中的应用研究[J].科学技术与工程,2013,13(14):1463.

JIAO Shengxi, XIAO Dejun, KAN Yifan. Application of Hough transform algorithm in center vision positioning [J]. Science technology and engineering, 2013, 13(14): 1463.

[10] 王改华,李涛,吕朦,等.采用无监督学习算法与卷积的图像分类模型[J].华侨大学学报,2018,39(1):148.

WANG Gaihua, LI Tao, L? Meng, et al. Image classification model using unsupervised learning algorithm and convolution [J]. Journal of Huaqiao University, 2018, 39(1): 148.

[11] 王千,王成,馮振元,等.K?means聚类算法研究综述[J].电子设计工程,2012,20(7):21?23.

WANG Qian, WANG Cheng, FENG Zhenyuan, et al. Summary of K?means clustering algorithm research [J]. Electronic design engineering, 2012, 20(7): 21?23.

[12] GRAMEGNA T, VENTURINO L, CICIRELLI G, et al. Optimization of the POSIT algorithm for indoor autonomous navigation [J]. Robotics & autonomous systems, 2004, 48(2): 145?162.

[13] 贺萌.基于机器视觉的无人车跟踪算法研究[D].北京:北京交通大学,2017.

HE Meng. Research on unmanned vehicle tracking algorithm based on machine vision [D]. Beijing: Beijing Jiaotong University, 2017.

[14] 历艳琨,毛建旭,刘仁明.基于特征点的3D人脸姿态跟踪[J].电子测量与仪器学报,2016,30(4):605?612.

LI Yankun, MAO Jianxu, LIU Renming. 3D face pose tracking based on feature points [J]. Journal of electronic measurement and instrument, 2016, 30(4): 605?612.

[15] 牛皓.基于单目视觉的非合作目标姿态测量研究[D].哈尔滨:哈尔滨工业大学,2014.

NIU Hao. Research on non?cooperative target attitude measurement based on monocular vision [D]. Harbin: Harbin Institute of Technology, 2014.

[16] 张治国.基于单目视觉的定位系统研究[D].武汉:华中科技大学,2009.

ZHANG Zhiguo. Research on positioning system based on monocular vision [D]. Wuhan: Huazhong University of Science and Technology, 2009.

猜你喜欢
图像处理
海战场侦察图像处理技术图谱及应用展望
人工智能辅助冠状动脉CTA图像处理和诊断的研究进展
基于ARM嵌入式的关于图像处理的交通信号灯识别
基于图像处理的机器人精确抓取的设计与实现
机器学习在图像处理中的应用
Bayesian-MCMC算法在计算机图像处理中的实践
改进压缩感知算法的图像处理仿真研究
基于图像处理的定位器坡度计算
基于图像处理的晶圆表面缺陷检测
对图像处理中ROF全变分模型的两种算法的比较研究