科技日新月異,電腦運算速度提升,電腦不僅是生活中重要的幫手,更成為工廠生產線上不可或缺的角色。工業上的機械視覺應用廣泛,視覺檢測、影像追蹤、精密定位等等,皆可透過電腦來幫忙完成。機械手臂也為工業中自動化最為便利的設備,它的活動範圍廣、可塑性高,能因應不同的環境,配合不同的設備方便且有效率的達到組裝搬運的功能。 本研究目的是控制機械手臂實現自動鎖M1.4螺絲。以Visual Studio C++建立人機介面,搭配兩台CCD攝影機,建立一個影像視覺系統,以MITSUBISHI型號RV-2SD的六軸機械手臂來完成空間上的定位控制。 第一台攝影機安裝在固定位置拍攝螺孔,影像透過灰階化、濾波、二值化、邊緣化、解重心法和最小外接圓等影像處理步驟,找出螺孔位置。將此位置經過座標轉換,計算出機械手臂目標座標值,並控制機械手臂到達目標位置。第二台攝影機安裝在機械手臂第五軸上,隨著機械手臂移動、近拍螺孔,也透過影像處理找出螺孔位置,再經過座標轉換計算出機械手臂微調量,使機械手臂達到更精確的定位控制。 ;Automation of factory is more and more popular since the microprocessor becomes faster. Manipulators have been used for some manufacturing tasks such as welding, painting, etc. Machine vision is more and more accurate and faster, especially in graph identify and position. The combination of manipulator and machine vision would replace manpower and would be popular in the future. The purpose of the thesis is to lock the M1.4 screw by controlling the manipulator. The whole process is based on the human-machine interface designed by Visual Studio C++, to run the image processing algorithms and the positioning control of the manipulator. Two CCD cameras are used. One is fixed above the screw hole, to take picture of the screw hole. The position of the hole is detected by the image processing algorithms, and it will transform to the coordinate value of the manipulator by coordinate transformation. The other camera, installed on the 5th arm of the manipulator, takes picture of the screw hole closely, in order to fine tune the manipulator, making the positioning control more accurate.