隨著醫療器材品質標準日益嚴格,注射針(Injection Needle)作為侵入性醫療耗材,其針孔暢通性與品質至關重要。現行業界多採用接觸式壓力檢測法或人工目視檢測,然而壓力檢測受限於充氣與穩定時間,難以滿足高速生產;人工檢測則易受主觀疲勞影響,導致漏判或誤判。為解決上述問題,本研究旨在開發一套基於機器視覺(Machine Vision)的自動化檢測系統,用於即時判別注射針之堵針(Clog)缺陷。 本研究首先針對光學取像架構進行最佳化設計,經實驗證實,採用背光照明 (Backlight)模式能使中空的針孔呈現高亮度圓形光斑,與不透光的針體形成極高對比,有效解決金屬表面反光干擾問題。在影像處理演算法方面,系統依序採用中間值濾波去除雜訊、霍夫圓轉換(Hough Circle Transform)進行精確定位與感興趣區域(ROI)裁切,並利用 OTSU 大津演算法自動選取最佳閥值進行二值化分割。隨後,應用形態學運算修補輪廓,並提取針孔之「等效直徑」與「真圓度」作為特徵值。 實驗結果顯示,本系統能有效量化針孔特徵,準確區分良品與堵塞瑕疵。在模擬自 動化產線定位誤差的測試中,即使針頭發生 0° 至 1° 的微小傾斜,系統仍能維持穩定的檢測能力。相較於傳統檢測方式,本研究提出之光學檢測方案具有非接觸、高速度與高穩定性等優勢,為實現注射針生產線的自動化全檢(100% Inspection)提供了具體可行的技術解決方案。;With increasingly stringent quality standards for medical devices, the patency and quality ofinjection needles, as invasive medical consumables, are of paramount importance. Currently,the industry relies primarily on contact-based pressure decay tests or manual visual inspection.However, pressure testing is limited by inflation and stabilization times, making it difficult to meet the demands of high-speed production; while manual inspection is susceptible tosubjective fatigue, leading to missed or false detections. To address these issues, this study aimsto develop an automated inspection system based on Machine Vision for the real-timeidentification of clog defects in injection needles. This study first optimized the optical imaging architecture. Experimental results confirmed thatthe Backlight illumination mode allows the hollow needle bore to present a high-brightnesscircular spot, creating an extremely high contrast with the opaque needle body, which effectively solves the interference problem caused by metal surface reflections. Regarding image processing algorithms, the system sequentially applies median filtering for noise removal,the Hough Circle Transform for precise positioning and region of interest (ROI) cropping, and the OTSU algorithm for automatic threshold selection to perform binarization segmentation. Subsequently, morphological operations are applied to repair the contours, and the "equivalent diameter" and "circularity" of the needle bore are extracted as feature values. Experimental results show that this system can effectively quantify the features of the needle bore and accurately distinguish between acceptable products and clog defects. In tests simulating positioning errors on an automated production line, the system maintained stable detection capabilities even when the needle experienced a slight tilt of 0° to 1°. Compared to traditional inspection methods, the optical inspection scheme proposed in this study possesses advantages such as non-contact operation, high speed, and high stability, providing a specific and feasible technical solution to achieve 100% automated inspection in injection needle production lines.