Machine Vision and Applications (1994) 7:82-92 Machine Vision and Applications 9 Springer-Verlag 1994 An optimization algorithm for shape analysis of regular polygons Jen-Ming Chen 1, Jose A. Ventura 2 and Brian J. Melloy 3. 1 Department of Information Management, The National Central University, Chung-Li, Taiwan 32054 2 Department of Industrial and Management Systems Engineering, 207 Hammond Building, The Pennsylvania State University, University Park, PA 16802, USA 3 Department of Industrial Engineering, 104 Freeman Hall, Clemson University, Clemson, SC 29634--0920, USA Abstract. Machine vision has the potential to impact both quality and productivity significantly in computer integrated manufacturing due to its versatility, flexibility, and relative speed. Unfortunately, algorithm development has not kept pace with the advances in vision-hardware technology, par- ticularly in the areas of analysis and decision making. The specific subject of this investigation is the development of a machine-vision algorithm for the dimensional checking, pose estimation, and overall shape verification of regular polygonal objects (e.g., surface-mounted electronic components and fas- tener heads). Algorithmically, the image boundary data is par- titioned into r~ segments, and then a non-ordinary least squares technique is used to find the best fitting polygon. The algorithm is well-suited for online implementation in an automated en- vironment due to its flexibility and demonstrated speed. Key words: Optimization - Least-squares fitting - Model- based inspection - Vision systems - Regular polygons 1 Introduction Machine vision has the potential to effect significant improve- ments with respect to both quality and productivity in auto- mated manufacture. This is largely due to the versatility of machine vision, which can perform functions such as guidance and control, product identification, inspection, and measure- ment. The successful implementation of a computer integrated manufacturing facility, for example, would not be possible without the reliable real-time performance of these activities (Schaffer 1985). In particular, product identification, inspection, and mea- surement have been the dominant machine vision applica- tions (Schaffer 1984). Historically, inspection activities have been performed by human inspectors. However, it is well documented that human inspectors are unreliable, even when E-mail addresses: J.-M. Chen: jmchen@im.mgt.ncu.edu.tw J.A. Ventura: javie@engr.psu.edu B.J. Melloy: melloyb@coe-nw.clemson.edu Correspondence to: J.A. Ventura multiple inspectors are employed to check one other's work (Schaffer 1984). Moreover, machine vision is often preferable to comparable automated contact systems (e.g., a coordinate measuring machine), due to factors such as its greater relative speed and inherent nondestructive nature (Groover 1983). Fi- nally, an integrated machine vision system not only has the capability to identify a part and subsequently qualify (or clas- sify) it, but can provide timely process feedback as well (Li et al. 1988, Raja and Sheth 1988). Machine vision systems are well-suited to data acquisition from products with complex and diverse geometric features, as they are less restricted (than are contact measuring sys- tems) by the configuration of the part. However, the analysis of these complicated shapes and subsequent decision processes are not straightforward. There are two general methodologies for shape analysis and decision making (Chin 1988): refer~ ential and nonreferential (design-rule) methods. Essentially, referential methods "match" the features of an item's captured image with that of an ideal stored image; a common example is the well-known template matching. Nonreferential meth- ods, in contrast, employ a parametric approach; that is, cer- tain parameters are estimated from the image and compared with ideal values. These parameters are selected such that they completely describe the geometric properties (of the reference shape) and their spatial relationships. The subject of this investigation is the use of a parametric approach for the dimensional checking, pose estimation, and qualification of production parts with regular polygonal pro- files. Polygonal shapes, in general, warrant special attention because of the number of products with this particular pro- file, including keyboard cut-outs, sheet-metal-formed cases and boxes, integrated circuit chips and capacitors, fastener heads, surface mounted electronic components, printed circuit boards, microfilm cards, and labels. The existing approaches regarding the polygonal shape representation, recognition, and analysis are numerous. Among them, the vertex-based approach, or point pattern matching, is one of the most commonly used methods (e.g., Atallah et al. 1991; Cox et al. 1989; Han et al. 1989; Koch and Kashyap 1989; etc.) in which the boundary of a polygon is represented