针对教学与实验,提出一种基于机器视觉的机器人写字方法。以六自由度DENSOVP6242G机器人、信捷机器视觉和PC机为实验平台,通过机器视觉获取字符的图像信息,采用VC++编程,利用机器视觉自定义协议将图像传输给PC机;借助OpenCV库对图像进行阈值化、闭运算、细化和笔画分割等一系列的处理;利用图像处理得到字符坐标信息控制机器人的多轴联动,机器人控制器与PC机之间通过ORiN2连接,从而完成字符的书写。实验表明,在字迹清晰条件下该方法能够使机器人准确地写出机器视觉所看到的字符。
For the purpose of experiment and teaching,the article proposed a method of writing by manipulator based on machine vision.This method,which uses 6-axis robot manipulator of DENSO VP6242g and machine vision of XINJE as the experimental platform,picks up the image information of the characters by machine vision,programs by VC++,and transmits the image to computer by user-defined protocol of machine vision;it also makes a series of image processing by the OpenCV libraries,including threshold,close,thinning and character segmentation.The information of coordinates of character coming from image processing can then be used to control the manipulator's movement,with the manipulator controller connected to the computer via ORiN2,thus completing the writing process.The experimental results prove that this method can drive the manipulator to write the character caught by machine vision correctly.And the writing can be recognized easily.