王粟 朱飛
摘 ?要: 針對中餐宴會臺面人工測量餐具間距離出現(xiàn)的問題,將圖像處理和人工智能技術(shù)引入臺面擺臺效果評判中,提出一種POSIT算法求解中餐宴會臺面上餐具間距離的方法。首先,利用Hough圓檢測算法識別出中餐宴會臺面擺臺上的餐碟、湯碟、味碟、水杯、葡萄酒杯和白酒杯上的圓,通過K?means聚類算法對中餐宴會客人人數(shù)和餐桌中心花瓶進行聚類;其次,在設(shè)計的黑白標定板中選取4個共面點,利用共面POSIT算法估算相機在目標坐標系下的旋轉(zhuǎn)矩陣和平移向量,根據(jù)攝像機模型得出聚類標號為10上各餐具間的實際距離。實驗結(jié)果表明,與人工測量相比,該方法測量精度高、穩(wěn)定性良好。
關(guān)鍵詞: 測距方法; 餐具間距求解; 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
隨著我國經(jīng)濟的不斷發(fā)展和第三產(chǎn)業(yè)所占比重的上升,國內(nèi)對旅游和酒店管理相關(guān)專業(yè)的人才需求量也在增加。中餐宴會臺面擺臺是旅游與酒店管理專業(yè)學生在人才培養(yǎng)過程中必須掌握的基本功,國內(nèi)大多數(shù)職業(yè)技術(shù)學院都有針對該專業(yè)學生開設(shè)的宴會臺面擺臺的實習實訓課程和技能大賽等。然而,目前存在的一個突出問題是:學生擺臺效果的評判都是依靠實訓老師或大賽評委通過目測和工具測量完成的。它存在的弊端包括:費力,工作量大;費時,測量和打分評價耗費時間長,不能立即得到擺臺效果的評分結(jié)果;精度低,人工測量時誤差較大,精度不高;穩(wěn)定性差,容易受人的主觀性影響。
一種可行的解決方案是將圖像處理和人工智能技術(shù)引入旅游與酒店管理專業(yè)的臺面擺臺效果評判中,徹底改變原來完全依靠人工評判的現(xiàn)狀,也克服原來評判方式存在的諸多弊病。要實現(xiàn)中餐宴會擺臺的定位,除了餐具識別之外,另一個重點和難點就是如何根據(jù)不同視角下的臺面擺臺圖像測算餐具間的真實距離問題。視覺定位方法有單目視覺定位和立體視覺定位,其中,立體視覺定位算法理論[1?3]相對復(fù)雜,求解花費的時間比較長,實時性比較差。文獻[4]提出一種采用SoftPOSIT算法對某衛(wèi)星進行位姿估計。文獻[5]中利用單連接聚類算法和SoftPOSIT算法,可以實現(xiàn)相機位姿的三維跟蹤。文獻[6]中采用PnP多點透視結(jié)合POSIT算法對標識物進行跟蹤,得到識別面可達86.67%,它的識別速度快,實時性好。上述單目視覺定位方法都是針對不同的具體問題提出的解決方案,不具有通用性,顯然也不適合中餐宴會臺面擺臺個性化定位的需求。本文提出一種基于POSIT算法求解中餐宴會臺面上餐具間距離問題的方法。
1.1 ?Hough變換檢測圓
Hough變換是從圖像中識別幾何形狀的常見圖像處理方法,其應(yīng)用領(lǐng)域比較廣泛[7]。對于方程[(x-a)2+(y-b)2=r2],該方程中有3個參數(shù),[(a,b)]代表圓心坐標,[r]代表圓的半徑。如點[(xi,yi)]對應(yīng)的輸入空間a?b的參數(shù)方程表達式為[(a-xi)2+(b-yi)2=r2],由參數(shù)方程可知為一個三維的錐面。在圖像空間中圓周上的任意一點坐標[(xi,yi)],它們在參數(shù)空間中都為一個三維錐面[8?9],如圖1所示。
圖2為中餐宴會臺面擺臺,利用Hough找圓算法找出餐碟、湯碟、味碟、水杯、葡萄酒杯和白酒杯共6種餐具的圓以及相應(yīng)的像素坐標。識別圓形餐具是實現(xiàn)定位的最重要一步,為后面測算餐具間的距離做好鋪墊。
在OpenCV中利用HoughCircles函數(shù)通過霍夫變換算法檢測出灰度圖中的圓,在圖3中用淺黑色的圓圈出了找到的圓形餐具。
本文將POSIT算法引入中餐宴會臺面擺臺的定位中,利用共面POSIT算法估計相機在目標坐標系下的旋轉(zhuǎn)矩陣和平移向量,然后根據(jù)攝像機模型計算得出聚類標號為10上餐具間的距離。本文提出的定位方法可以解決從不同視覺測算臺面擺臺圖像中餐具間真實距離的難題,為機器視覺和人工智能等新技術(shù)在該領(lǐng)域的順利應(yīng)用掃清了障礙,進而實現(xiàn)中餐宴會擺臺定位的自動化、快速化、客觀化和智能化,徹底變革該細分領(lǐng)域內(nèi)完全依靠人工評判的現(xiàn)狀。
參考文獻
[1] 沈彤,劉文波,王京.基于雙目立體視覺的目標測距系統(tǒng)[J].電子測量技術(shù),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] 楊景豪,劉巍,劉陽,等.雙目立體視覺測量系統(tǒng)的標定[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] 陳鵬.基于單目視覺的像機位姿估計技術(shù)[D].北京:北京科技大學,2015.
CHEN Peng. Camera position estimation technology based on monocular vision [D]. Beijing: University of Science and Technology Beijing, 2015.
[6] 韓雪.基于三維標識物的醫(yī)用增強現(xiàn)實跟蹤注冊方法研究[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].計算機工程與設(shè)計,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] 焦圣喜,肖德軍,闞一凡.霍夫變換算法在圓心視覺定位中的應(yīng)用研究[J].科學技術(shù)與工程,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] 王改華,李濤,呂朦,等.采用無監(jiān)督學習算法與卷積的圖像分類模型[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].電子設(shè)計工程,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人臉姿態(tài)跟蹤[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] 牛皓.基于單目視覺的非合作目標姿態(tài)測量研究[D].哈爾濱:哈爾濱工業(yè)大學,2014.
NIU Hao. Research on non?cooperative target attitude measurement based on monocular vision [D]. Harbin: Harbin Institute of Technology, 2014.
[16] 張治國.基于單目視覺的定位系統(tǒng)研究[D].武漢:華中科技大學,2009.
ZHANG Zhiguo. Research on positioning system based on monocular vision [D]. Wuhan: Huazhong University of Science and Technology, 2009.