摘要
运用Python语言在Open CV上完成魔方色块图像采集与处理算法设计,利用ROI掩模处理将色块最佳区域的像素坐标值进行采集计算,减小边缘杂色的影响,提升了色彩坐标的真实性与稳定性;图像滤波采用7×7的滤波核进行中值滤波,降低了图像噪声点和环境光线亮度对识别的影响,更便于机器视觉的识别与处理。在聚类算法编写上,通过采集色块数据分析,利用改进后的加权欧氏距离算法对魔方色块进行聚类,通过计算每个色块与6面中心色块二维HS坐标的欧氏距离来分类,与传统三维距离分类算法相比,距离分散,更易于聚类。本算法适用于识别任意颜色的魔方,并保证极高的色块识别与聚类准确度。
In this design,the Python language is used to complete the design of the image acquisition and processing algorithm of the Rubik’s Cube color block on Open CV,and the pixel coordinate value of the best area of the color block is collected and calculated by ROI mask processing,which reduces the influence of edge noise and improves the authenticity and stability of the color coordinates.The image filtering uses a 7×7 filter core for median filtering,which reduces the influence of image noise points and ambient light brightness on recognition,and is more convenient for machine vision recognition and processing.In the compilation of the clustering algorithm,the Rubik’s Cube color blocks are clustered by collecting color block data analysis,using the improved weighted Euclidean distance algorithm,and the Euclidean distance between each color block and the two-dimensional HS coordinates of the 6-sided center color block is calculated,which is more convenient for clustering than the traditional three-dimensional distance classification algorithm.This algorithm is suitable for identifying Rubik’s cubes of any color,and ensures extremely high accuracy of color block recognition and clustering.
作者
王波
王霞琴
周齐
马鑫山
洪鸽
WANG Bo;WANG Xia-qin;ZHOU Qi;MA Xin-shan;HONG Ge(Mechanical Engineering School,Lanzhou Petrochemical University of Vocational Technology,Lanzhou 730060,China)
出处
《兰州石化职业技术大学学报》
2024年第2期28-31,共4页
Journal of Lanzhou Petrochemical University of Vocational Technology
关键词
魔方机器人
机器视觉
图像滤波
聚类算法
Rubik’s cube robot
machine vision
image filtering
clustering algorithms