1990
A microcomputer based combined machine vision
and expert system for irregular object classification
Syed Azhar Saeed Zaidi
Iowa State University
Follow this and additional works at:
https://lib.dr.iastate.edu/rtd
Part of the
Artificial Intelligence and Robotics Commons
, and the
Industrial Engineering
Commons
This Dissertation is brought to you for free and open access by the Iowa State University Capstones, Theses and Dissertations at Iowa State University Digital Repository. It has been accepted for inclusion in Retrospective Theses and Dissertations by an authorized administrator of Iowa State University Digital Repository. For more information, please [email protected].
Recommended Citation
Zaidi, Syed Azhar Saeed, "A microcomputer based combined machine vision and expert system for irregular object classification " (1990). Retrospective Theses and Dissertations. 11234.
The most advanced technology has been used to photograph and
reproduce this manuscript from the microfilm master. UMI films the
text directly from the original or copy submitted. Thus, some thesis and
dissertation copies are in typewriter face, while others may be from any
type of computer printer.
The quality of this reproduction is dependent upon the quality of the
copy submitted. Broken or indistinct print, colored or poor quality
illustrations and photographs, print bleedthrough, substandard margins,
and improper alignment can adversely affect reproduction.
In the unlikely event that the author did not send UMI a complete
manuscript and there are missing pages, these will be noted. Also, if
unauthorized copyright material had to be removed, a note will indicate
the deletion.
Oversize materials (e.g., maps, drawings, charts) are reproduced by
sectioning the original, beginning at the upper left-hand corner and
continuing from left to right in equal sections with small overlaps. Each
original is also photographed in one exposure and is included in
reduced form at the back of the book.
Photographs included in the original manuscript have been reproduced
xerographically in this copy. Higher quality 6" x 9" black and white
photographic prints are available for any photographs or illustrations
appearing in this copy for an additional charge. Contact UMI directly
to order.
University Microfilms International A Bell & Howell Information Company 300 North Zeeb Road, Ann Arbor. Ivll 48106-1346 USA
A microcomputer-based combined machine vision and expert
system for irregular object classification
Zaidi, Syed Azhar Saeed, Ph.D.
Iowa State University, 1990U M I
300N.ZecbRA Ann Arbor, MI 48106
THE ORIGINAL DOCUMENT RECEIVED BY U.M.I. CONTAINED PAGES WITH
PHOTOGRAPHS WHICH MAY NOT REPRODUCE PROPERLY.
expert system for irregular object classification
by
Syed Azhar Saeed Zaidi
A Dissertation Submitted to the
Graduate Faculty in Partial Fulfillment of the Requirements for the Degree of
DOCTOR OF PHILOSOPHY
Department: Industrial and Manufacturing Systems Engineering Major: Industrial Engineering
Approved:
m Charge of Major Work
For the Major Department
For/tM^raduate College
Iowa State University Ames, Iowa
1990
Copyright © Syed Azhar Saeed Zaidi, 1990. Ail rights reserved.
Signature was redacted for privacy.
Signature was redacted for privacy.
TABLE OF CONTENTS
CHAPTER 1. INTRODUCTION 1
Need for the Research 1
Objectives of the Research 3
Scope and Impact of the Research 4
Outline of Subsequent Chapters 4
CHAPTER 2. LITERATURE REVIEW 7
Applications of Machine Vision 7
Grading Requirements for Nursery Tree Seedlings 9
Use of Machine Vision in Grading of Seedlings 14
CHAPTER 3. SYSTEM CONCEPTS 17
Machine Vision Methodology 17
Image acquisition and restoration 17
Feature extraction 19
Image analysis 20
Machine vision applications 21
Machine Vision Equipment 25
Expert System Techniques 30
Expert System Applications 36
Expert System Software Characterization 37
CHAPTER 4. DESIGN METHODOLOGY 39
Image Processing Considerations for Processing Irregular Objects 39
Features of Line Segment Search Routine 41
Clamping Point Identification 45
Processing of Root Area 56
Processing of Stem Area 63
CHAPTER 5. FUNCTIONAL SPECIFICATIONS FOR THE GRAD
ING SYSTEM 67
Screen Layout of the Seedling Segregation System 67
Changing Grading Parameters at Run-Time 70
Changing the System Parameters at Run Time 73
Changing the Horizontal and Vertical Conversion Parameters 74
Examining the System Processing Time 77
CHAPTER 6. SAMPLE SESSIONS AND RESULTS OF THE
TEST RUNS 79
Setting Conversion Parameters 82
Defining a New Batch 82
Processing a Pine Seedling with Noise 85
Processing of an Oak Seedling 88
CHAPTER 7. SUMMARY AND CONCLUSIONS 92
CHAPTER 9. ACKNOWLEDGEMENTS
98
APPENDIX A. PROMPTS FROM THE USER INTERFACE ... 100
APPENDIX B. FLOW CHARTS OF THE MENU SYSTEMS ... 103
Flow Chart of The Main Program Loop 103
The Main Menu Flow Chart 105
The Conversion Factor Flow Chart 107
APPENDIX C. FLOW CHART OF THE CLAMPING POINT
IDENTIFICATION
109
APPENDIX D. FLOW CHART OF THE ROOT AREA PROC
ESSING
118
APPENDIX E. FLOW CHART OF THE STEM AREA PROC
ESSING
126
LIST OF TABLES
Table 2.1: Morphological classification based on seedling size 11
Table 3.1: Machine vision camera specifications 26
Table 6.1: Lighting characteristics of laboratory environment 80 Table 6.2: Processing time required for various seedling samples .... 91
LIST OF FIGURES
Figure 2.1: Morphological conditions for long seedlings 12 Figure 2.2: Morphological conditions for short seedlings 13
Figure 3.1: Basic components of a machine vision process 18 Figure 3.2: Process of resolution in a rule base by refutation 34
Figure 4.1: Line segment search and masking examples 42 Figure 4.2: Panel processing by the segment search routine 44 Figure 4.3: Results of initial clamp identification process 51 Figure 4.4: Examples of on_segment processing operations .52 Figure 4.5: Completed clamp identification and elimination process ... 56 Figure 4.6: Seedling grading based on the root mass only 58 Figure 4.7: Results of the tap root identification process 63 Figure 4.8: Results of the stem area identification process 66
Figure 5.1: Layout of the Seedling Segregation System display 68
Figure 5.2: Symbols for the nominal output window 70
Figure 5.3: Example of a BATCH.REC file 72
Figure 5.4: Example of a SYSTEM.REC file 74
Figure 5.6: Example of a poorly placed template 76
Figure 5.7: Example of a properly placed template 77
Figure 6.1: Equipment setup for seedling segregation system 81 Figure 6.2: Results of processing a pre-stored image 83
Figure 6.3: Input image for the Pine sample 85
Figure 6.4: Successful clamp identification process 86 Figure 6.5: Results of complete processing of Pine sample 87 Figure 6.6: Results of clamp identification for the Oak sample 89 Figure 6.7: Results of complete processing of Oak sample 90
CHAPTER 1. INTRODUCTION
Need for the Research
In recent years much work has been reported on the development of micro computer based machine vision systems [40,68]. A substantial portion of this research assumes most of the items subjected for machine vision inspection, can be categorized by a regular geometrical shape [53, 54, 72]. A few microcomputer-based vision sys tems have been marketed: for example, the OPTO-SENSE MENTOR (Copperweld Robotics, Troy, Michigan, $50,000), Charger (Rhino Robots Inc., Champaign, 111., $40,000), and the 100 Series (Unimation Inc., Danbury, Conn., $24,000) [24]. Most of the vision systems, and microcomputer-based vision systems in particular, are de signed to perform singular tasks, they are niche oriented and designed to be used in an inflexible environment [77]. These systems are primarily suited for processing regular objects. The assumption of regular objects works well in the case of most mechanical parts and machine tools, but there are manufacturing situations in which the handling of irregular objects is required [81]. The non-destructive evaluation of industrial parts, and evaluation of non-metallic inclusions in steel, are a couple of many such applications. The commercial machine vision systems to handle such applications are multi-processor based and are, generally, prohibitively expensive for low budget applications. One such system is Perceptron Inc.'s MV-600 system which
costs over $80,000 for the basic unit. The cost of a turn key system is several times this amount [7].
The Iowa Conservation Commission's State Forest Nursery (in Ames, Iowa) produces about 6 to 10 million seedlings every year. These seedlings have to be segregated according to their survival expectancy before they can be stored for final shipment. The time constraints are such that the grading process has to be completed in about eight weeks. This means that about 13,000 have to be processed every hour. As a result, several grading lines have to be arranged in parallel.
It is hoped that the following problems identified in the manual grading process would be resolved if the process can be automated through a machine vision system.
• Grading is done by minimum wage, seasonal workers, who have little or no working experience with tree seedlings.
• An initial training period is required to teach the desired quality constraints. • Lack of working knowledge often results in acceptance of bad seedlings and
rejection of good seedlings.
• Inconsistent rejection rates result in a lack of control over the supply volumes.
• The grading operations have to be performed under low temperature and high humidity, and these conditions also affect the worker performance.
The economic feasibility of an automated grading process has been established by research [18, 72]. The segregation operations were observed and the data were collected from the forest nursery in Ames by the research conducted by Mark Ti tus at Iowa State University [72]. Titus showed that an automated vision system
would mean improved seedling quality for the customers, due to consistent grading processes, and would reduce production costs. Various options for handling of plant seedlings in an automated grading system were also studied in the research. A cable conveyor, moving around a circular path and holding the seedlings in specially de signed clamps was shown to be the best option for proper seedling handler for the seedling segregation system [72].
Objectives of the Research
The irregular-object application dealing with the segregation of plant seedlings at a forest nursery is the focus and the stimulus for this research. The main objective of this research is show the functional viability of machine vision process by optimizing the processing speed and by providing means for noise tolerance, by developing an expert system to identify and isolate root and stem areas of the seedling image and to apply the grading criteria on these regions. We also want to provide a facility, for dynamic adjustments to the grading criteria, to facilitate the use of numerous species. Another important objective of the research is to make use of the cost effective computer technology such as a microcomputer-based image processing system, to keep the total system cost down. It is hoped that the development of such low cost systems would generate an interest in small industry for quality improvement through machine regulated quality control systems. Our target is to design a system with a throughput of one seedling per second. Under the current production volume, this would mean that five grading lines in parallel would be sufficient to handle the production capacity.
Scope and Impact of the Research
The research has been endorsed by the Iowa Conservation Commission's State
Forest Nursery from its inception. There has been a continued contact with the
nursery officials to get information on the criteria for quality judgements in the in spection process. The nursery provided the tree seedlings to test the prototype which was developed in a lab environment. The nursery officials believe that automating the grading process will bring improvements in the segregation process and would result in a supply of better quality products, and greater customer satisfaction.
Further applications of this research may be found in areas of detection of solder corrosion on the Printed Circuit Board surfaces, detections of risers to assure proper filling of industrial castings, quantitative evaluation of metallographic measurements, segregation of laminate and decorative tiles, and scene evaluation.
The research may also be applied in vegetable, fruit, egg grading, plus industries involved in the production of consumer products like leather, clothing, furniture and toys. It is anticipated that this research will contribute in developing applications for vision based irregular object identification and process control, where the capability of a low cost system is feasible and desired.
Outline of Subsequent Chapters
The first section of Chapter 2 provides an overview of the research in using ma chine vision in agriculture and food processing industry. The next section provides detailed account of the grading criteria for the nursery tree seedlings. The opera tion of the grading process is briefly described and various grading alternatives have
been explored. The section ends with outlining the specific grading parameters used in this research. The third section reviews a project at Oklahoma State University (OSU) in which a hardware based seedling segregation system was designed. Com parisons between the OSU research and our research are made. Chapter 3 provides some fundamental information about the machine vision concepts and procedures. Various concepts dealing with expert systems and current trends are also discussed. The first section reviews various techniques used in image retrieval, restoration and processing. It also identifies various application areas for machine vision. The sec ond section provides a brief survey of the equipment involved in a machine vision system. The section ends by describing the equipment involved in this research, and its limitations. In subsequent sections a brief introduction to expert systems, its composition, application areas, and the software characterization are presented. The problems in having a full blown expert system for the seedling grading process have also been identified.
Chapter 4 provides a detailed account of the processing decisions involved in various phases of the seedling segregation system. The chapter has been broken into three sections describing the process of clamping point identification, root area isola tion and measurement, and stem area isolation and measurement. Specific references are made to the set of images acquired by the system developed for the laboratory environment.
Chapter 5 describes the function of the program and various information param eters required/supplied by the system. It also serves as a reference for the program usage. The results obtained by actual laboratory runs are provided in Chapter 6.
enhance and/or expand this research, is provided in Chapter 7 and Chapter 8. Ap pendixes contain detailed program flow charts for various segments of the program.
CHAPTER 2. LITERATURE REVIEW
Applications of Machine Vision
The automotive industry, by far, has been the largest beneficiary of the vision technology. In the automotive industry, machine vision is used to identify parts on the conveyor belt for proper routing, it is used to continuously monitor the production processes for machining and workmanship defects, and it is used on robot arms for guidance and routing. The second large user of machine vision is the electronic industry, where vision systems are used to identify routing errors in printed circuit boards (PCB). They are used on part assembly lines to supply control information to the part placement robots for proper alignment of surface mounted parts. Vision systems are used for PCB quality control, to identify wrong or missing parts, and parts placed in the reverse orientation, resulting in wrong polarity. Finally, they are used to identify solder defects. It is estimated that the average yield in the first pass tests of PCB's is about 75%. About half of the defects are because of workmanship and missing or wrong components, and depending on the yield and supply volume, it is estimated that any where from 250,000 to several million dollars can be saved if these problems are rectified using automated part placement and inspection systems which incorporate machine vision techniques [9].
is predicted that by 1990 the market share of vision systems in food and beverage industry would increase to 11%, from $3.5 million in 1985 to $50.2 million in 1990, thus, maintaining its third position [25]. Vision systems in food and beverage industry are used during production for process control and sorting, and after production for inspection and gaging [25].
A large number of applications in machine vision for processing agricultural products have been reported in the literature. Sites and Delwiche [66] describe a system to identify and estimate number of fruits on a tree using grey scale threshold ing techniques. Another application in the area of agricultural botany is described by Draper [19]. Computer vision is used to identify various leaves and seed shapes. The discrimination is obtained by computing the shape factor and aspect ratio of specimens. Shape factor is defined by; 4TT(aTeafperimeter'^). The above formula used 47r to result in a theoretical shape factor of unity for a perfectly circular object. Gunasekaran [30] reports various methods for quality evaluation of agricultural and biological materials.
Many authors have reported various pattern recognition applications in agricul ture and agricultural products. Jaffe [38] reported the image analysis of plant growth. Heyne [34] worked on computerized image analysis of simulated pizza to check the regularity of the crust. Taylor and Rehkugler [70] developed an image analysis system to detect apple bruises. Sarkar and Wolfe [58] presented image processing techniques for sorting tomatoes, where the vision system made it possible to classify tomatoes by shape, size, and color. Parrish and Goksel [52] presented a pattern recognition application for apple harvesting. Wright [80] described a method to measure the size and shape of sweet potatoes. The size and area statistics of liquid chemicals used
on crops were determined by Kranzler et al. [42]. The chemicals under investigation were mixed with different fluorescent dyes, which were picked up by the imaging equipment. Connectivity analysis was used for calculating the order statistics [42]. A process control application of machine vision in the food processing industry pro vides a continuous monitoring and detection of foreign matter in a de-greaser tank to prevent undesirable chemical reaction and possible degreaser spill [20]. De-greasing is used in food industry between batches, for cleaning process equipment and piping. Another such application uses process control in the produce industry in the develop ment of an automated citrus packing house in Japan [36]. Ottman [51] reports on the measurement of plant roots by machine vision. A microcomputer-based prototype of an opto-electronic system has been developed by Oklahoma State University (OSU) for in-field counting of plant seedlings. The procedure is based on the interruptions recorded by infrared detectors mounted on the tractor's tool-carrier platform [16,41].
Grading Requirements for Nursery Tree Seedlings
There are various stages where the seedling quality must be measured, in or der to ensure a good chance of survival after the final plantation. The yield for plantable seedlings can be optimized by improving the storage and lifting operations and by providing deterrents to environmental variability in storage, which is poten tially harmful. Seedling quality should be measured at three phases: (1) during the growing season, (2) prior to lifting, and (3) prior to field planting [64]. Environmental conditions prior to lifting, length of storage, conditions of storage, and the handling methods are of great importance for good seedling quality [10, 21]. Generally ev ery nursery has to go through the following six steps before the seedlings leave the
nursery for final planting [72, 82]. • In-field grading/inventorying • Lifting process • Grading process • Storing process • Retrieving process • Shipping
The manual classification operations prevalent in the nurseries are highly subjec tive; the human operators work under low temperature and high humidity and lack the experience and vigor and, hence, are susceptible to human error. Moreover, it is not possible to have a 100% inspection in any manual grading system. Therefore, researchers have been looking at ways to automate this process.
The proposed seedling segregation system would be utilized after the seedlings are lifted from the nursery beds. After this segregation process the seedlings would be ready to be stored in a cool environment in special bags to hold their moisture. The extraction of good seedlings at this point would ensure that no extra overhead would be spent for non-plantable (cuU) seedlings. Morphological attributes of a seedling have been found to be important for final grading operation [75]. These attributes include the height, diameter, dry weight, shoot-to-root ratio, and the bud height [49, 56]. Stroempl [67] described root-collar diameter, stem length, and bud number of large and small seedlings to be important measures for the grading of red oak seedlings. His classification into small and large seedlings is shown in Table 2.1.
Table 2.1: Morphological classification based on seedling size
Root-Collar
Seedling Size Diameter (in.) Stem Length (in.)
Large 0.30 to 0.34 22 to 30
Small 0.18 to 0.26 12 to 18
Reject 0.18
The morphological conditions desirable for a plant able seedling are shown in Figure 2.1 and Figure 2.2. Stroempl [67] categorized large and small seedlings sepa rately. Four grades were assigned to the seedlings in each category, based on various morphological attributes.
The height of seedling is a measure of its photo-synthetic capacity and transpi-rational area. Initial height of a seedling is also positively correlated to the future growth of the plant [49]. However, the shoot diameter is a better measure of seedling growth for estimating the probability of survival. Larger diameter ensures more struc tural support [49] and protection against forking to the ground [67]. A longer and thicker tap root has also been shown helpful for structural support [49]. The root-collar diameter and stem length are also found to be reliable indicators of relative growth potential, regardless of age of the stock [75]. Also, a survivable seedling must have buds on the shoot. The seedlings having buds at the apex of the shoot have a high probability of survival [67]. Buds at the lower middle of the stem and branches ensure high dormancy requirements for future plant growth.
4 5 6 7
V
Grade_1 (1&2): Well defined, sturdy, and straight leading shoot, with buds on most of stem. Branches relatively short. Grade_2 (3): Leading shoot less defined with fewer buds.
More prominent branches.
Grade_3 (4&5): Leading shoot thin or forked. Large root-collar diameter. Grade_4 (Reject; 6&7): Stem is very thin. Tendency to forking prominent.
Fewer buds on the shoot. Roots: Tap root length: 20 to 25 cm.
Lateral root length: 10 to 15 cm.
12 13
Grade_1 (l): Leading shoot sturdy and straight, with buds on most of stem. No branches.
Grade_2 (2&3): Leading shoot less sturdy. Branches sometimes too long.
Grade_3 (4 to 6): Stem with 2 to 3 leading shoots. Terminal buds should be present.
Grade_4 (Reject; 7 to 13): Stem is very thin. Tendency to forking prominent. Roots: Tap root length: 15 cm.
Lateral root length: 10 cm.
Based on the above observations, it is evident that an ideal seedling segregation system should support the following features:
• Clamping point discrimination • Seedling category (long or short)
• Shoot discrimination and measurement of length • Branch count
• Branch length
• Caliper point identification • Caliper diameter measurement • Tap or lateral root discrimination • Bud identification
• Shoot-to-root ratio
• Forking probability estimation
Use of Machine Vision in Grading of Seedlings
A dedicated machine vision system has been designed at Oklahoma State to grade southern pine seedlings [56]. The system uses the International Roboma-tion/Intelligence (IRI) D256 machine vision development system. This system sup ports 256 gray levels at a resolution of 256x240 pixels. The primitive image proc essing functions like image convolution, run-length coding, and moments calculations
are implemented in hardware. The IRI system with two cameras, a systolic array processor and a user programming environment costs over $100,000. The system computes the caliper diameter, and estimates the root area, and the length of the shoot. Two Hitachi KP-120U cameras providing a resolution of 320x244 are used for image capture. One camera is used to obtain the seedling root collar, and uses a field of view (FOV) of five inches. The other camera is used to capture the whole seedling with a FOV of 20 inches. Variable thresholding technique is used to high light the areas of interest in the image and to suppress noise. Initially, the high FOV camera operates in a loop until it finds an image at a lower threshold. Then both cameras are used to capture the seedling using xenon strobe lighting. The whole image is run length encoded. The caliper is identified by looking for six continuous lines of minimum transitions, starting from the top of the image using a medium gray level threshold of 90. A higher threshold (140) is used to suppress stray roots and/or needles around the seedling caliper. A Laplacian edge detector is used to get the stem edges. The image is then run-length encoded and the caliper diameter computed. The root volume (projected area) is determined at a threshold of 48. The shoot height is computed from the root collar position to the top of the seedling. The system results in an average classification error rate of 5.7 percent, and does so at a speed of approximately 0.25 seconds [56].
The OSU research uses dedicated hardware for image processing. It uses grey scale images and uses thresholding as a mean to capture regions of interest. This research in contrast, relies on a microcomputer based software solution. We use binary images, and a purely stochastic approach for processing. We use edge tracking on the seedling shoot to compute its length. Furthermore, an additional process is
incorporated in the root area processing by identifying the tap root and providing estimate of the lateral root count, attached to the tap root.
CHAPTER 3. SYSTEM CONCEPTS
Machine Vision Methodology
Image acquisition and restoration
The basic components of a machine vision process are shown in Figure 3.1 [45]. The image is captured by an analog or a digital camera. If the input is analog, it is passed through an Analog to digital converter.
The image is then stored in a memory buffer by a frame grabber. The frame is then processed by a set of image processing routines by the computer according to a set criterion. The results from this routine declare the seedling to be good or bad and at that point control signals from the computer may be generated for proper disposition of the seedling. An automatic update of the inventory data base can also be incorporated at this point.
Several researchers have observed that the varying nature and complexity of the work environment such as varying light intensity, varying reflectivity of surrounding objects, pose limitations over the practicality of a machine vision system [3, 4, 6, 13, 31, 55, 79]. Some of these problems can be overcome by certain image enhancement techniques like brightness control, image stretching, and Fourier-domain processing
INFORMATION OUTPUT • ILLUMINATION • SENSING • IMAGING CAMERA PARTS - VIDICON - CCD - CID - INCANDESCENT - LASER - FIBER OPTICS • DIGITIZING • WINDOWING • ENHANCEMENT IMAGE PROCESSOR - CAMERA CONTROL UNIT TV MONITOR • POSITION • GEOMETRIC CONFIG • LIGHT INTENSITY DIST
STORAGE MEMORY (FRAME STORE) • MODEL MATCHING • DECISION MAKING CONTROLLER (MICRO) FINAL DEVICE - CAD/CAM - ROBOT VOLTAGE SIGNAL DIGITIZED IMAGE CONTROL COMMAND IMAGE SPECIFICATIONS
Feature extraction
Global feature method Once the image is enhanced to the required level, it
has to go through the feature extraction phase. There are several approaches one can take in perceiving what is seen by the camera. One is the connectivity analysis approach, in which the binary image is broken into its connected components, from which the deterministic components and the shape features are derived. This method is best suited when there are a limited number of regular objects in the domain [57]. In the case of low contrast images, the above approach sometimes yields incomplete blobs [29]. The connectivity analysis also does not work for overlapped parts. Hence, we classify this method as a Global Feature Method. The Stanford Research Institute (SRI) vision module is based on the global feature method [27]. Specifications such as perimeter, cent roi d, area, and moment of inertia can be determined by algorithms based on the above method.
Local feature method A second approach is an algorithm based on what is
called the Local Feature Method, which can measure the defining pieces of an object boundary, the line segments, the arc segments, and the curvature [13, 62]. This method can be successfully applied on randomly oriented regular parts. An extension to the Local Feature Method is what is called the Relational Feature Method in which the interrelationship of two local features of an object is used for part recognition. Again this method is good for a limited domain of regular objects.
Morphological method A third approach for feature extraction is the mor
as opposed to connected blobs. The operations performed on the image are set oper ations such as union, intersection and set difference. The set operations are carried out by using certain structuring elements. The set operations in morphology are destructive in nature. Hence, the image after such operations is essentially destroyed and backtracking from an operation is generally not possible without image reload. Therefore, it is very important to make an intelligent use of the structuring elements to assure a sufficiently high speed image analysis system by minimizing the image reloads. The structuring elements can either be regular in shape such as squares, cir cles, disks, lines, vectors of particular orientations or they can be irregular in shape [61]. Therefore, this method can be utilized for processing irregular objects for which a certain degree of information about the shape,size, and position, is known.
Image analysis
The next phase in image processing is the interpretation phase. The interpreta tion requires a domain on which the judgment can be based. Brady [6] presents two generally acceptable methods that are used for image interpretation.
Feature weighting method The feature weighting method in which we look for special features in the image, like an object having a hole in the middle, or an object having a rounded top left corner. A more precise requirement might ask for quantitative measurements of the image features. As in our application, we might like to see if the stem diameter is within acceptable limits. In the grading application like ours, there might be varying aspiration levels and combinations of features for an object to be acceptable. When there are several combinations of features required to
reach a proper conclusion, then we can best code the decision rules in what is called an expert system [8, 22, 33, 35].
Template matching method The template matching method, in which rep
resentative object models are kept in an object library and the features of the image in question are matched with these models [5, 13]. This method is most commonly used where the domain of objects is fixed. Industrial parts generally fall into this classification [5]. This method is generally used in part finding/sorting applications with no occlusion or overlap.
Machine vision applications
The applications of machine vision in a production environment can be broken down into five categories.
Inspection This area of vision application deals with monitoring quality of
a part on a production line. It can be subcategorized as binary and analog. In binary inspection, the part is either declared as a good part or as a bad part. Typi cal manufacturing applications include blank (stamping) verification and component verification. In analog inspection, the degree of deviation from the desired limits is also monitored and reported [3]. Applications with this classification include isolating objects of a particular attribute, monitoring of dimensional accuracy, hole location, surface flaws, and surface contour accuracy [45]. It is important to discriminate be tween a good and a bad part as early as possible in the manufacturing cycle, because as we move through the production cycle the bad component results in a bad part, which results in a bad system, and so on. Chang [12] sites a specific example: an
electronic component if defective costs $.05 and its identification and removal before assembly costs $.50. When it is assembled on the component board, the cost to fix it increases to $5.0, and when it becomes a part of the system, the cost of removal jumps to $50.0. Finally, when this system is marketed and the customer requests service, the cost to repair increases to $500. All this emphasizes that inspection is advisable at the earliest stages of the production process. The same principle applies to natural products, as the elimination of bad tree stock or produce saves the ex penses of unnecessarily storing and maintaining them. Also, about 10% of the total labor cost of all manufactured durable goods is accrued in quantitative and qualita tive visual inspection even when statistical sampling is used [45]. These costs can be significantly reduced if machine vision is employed. Moreover, if 100% inspection is desired, only using machine inspection makes sense.
A machine vision system to inspect the quality of glass tubing at a GE manufac turing facility has been reported [65]. The edge of the tube is identified by capturing the image with 256 gray levels, and thresholding it to make the edges as distinct as possible. The system then determines the quality of cut at the tube edges by mea suring the height of the edge points. Sudden change in thickness signifies a chip from a bad cut. The system also looks at the body of the tube to identify cracks. Since the system was installed, significant reduction in machine downtime, and a significant increase in material efficiency have been reported. Another application examines and identifies baby food jars for glass particles at a rate of 10 jars/sec [43].
Pattern recognition This application differs from inspection in that the pur
Pattern recognition techniques are widely used in automatic inventory control ap plications and in flexible manufacturing systems (FMS), especially in the field of automotive production. In a flexible manufacturing environment, there is push for a greater variety in the product range, delivery times are important, and there is a need for frequent product updates. In such case large machining centers serving a variety of parts, and subsequently, requiring a range of tooling, are needed [1]. Vision systems are used to discriminate between different parts by comparing incident parts with the part features pre-stored in a part library. These operations include part sorting, palletizing, conveyor picking, and bin picking [44].
The problems of processing satellite imagery data and identifying various com ponents of the scene by image enhancement and segmentation would also be classified as pattern recognition. Satellite imagery is used for estimating crop yield and vege tation estimates. It is also used for remote sensing and surveillance. Our application can also be classified as a pattern recognition application as we use stochastic means to categorize the incoming seèdlings into three classes; good, bad, and un-identified.
Measurement This area of vision is very similar to the analog inspection, except that rather than monitoring the deviation from the desired specifications of an object, the specifications of the object itself are monitored and reported. This idea can be utilized in applications where numerous parts are to be produced with minimal variation in size and shape [17]. Relational methods are used to identify the parts, in such applications, by identifying clusters of unique relationships among the local features in each part, and keeping this information in a part library. These ideas are also applied where the parts are partially occluded.
In manufacturing situations where the part has to satisfy rigid limits of tolerance, vision systems provide physical measurements of the parameters of interest.
Process control The above categories of vision application essentially deal
with open loop (non-feedback) systems. The process control applications can be viewed as an analog inspection system with a feedback loop. The integration of the vision system into the feedback control system allows a direct influence over the manufacturing process [11]. Once the system recognizes a deviation from the desired specifications, it sends the signal to the processing machine for corrective action. The machine temporarily suspends the manufacturing process until the problem is resolved [17]. Industry is especially interested in vision-based process control in the areas of assembly operations in a flexible manufacturing environment and in control of chemical processes in hazardous environments. Use of a vision system in such applications ensures a reduction in departmental downtime and disruptions in production, as the process is stopped only when the vision system detects and reports irregularities in the system. The vision system also provides a continuous monitoring environment as opposed to the occasional monitoring by manual systems.
Guidance and robot control This is the most rapidly growing application
area of machine vision. Guidance for autonomous vehicles, orientation devices, and industrial robots, are classified into this application area. Use of robots without a vision system requires that the objects must be presented in exact position, which is a very serious limitation in a work environment. The vision system, when associated with the robot, eliminates this problem, because the vision system monitors the positional accuracy of the incoming objects and reports the deviation to the robot
operating system, which sends remedial signals to the robot [8, 74]. Shoup and Macchio [63] developed a model to evaluate the potential use of robotics and machine vision in food processing. A fairly recent approach uses vision cameras mounted directly on the robot arm which provides the robot with what is called active vision or animate vision. These robots have been programmed to play a simple version of the badminton game [78].
Study of these vision system categories emphasizes the fact that successful pat tern recognition is a common denominator in all vision applications. Such a system should have a fast response time in order to keep the system running without delays. Thus, the development of a low cost, real time vision system is an active area of machine vision research. The literature survey has identified a few real time systems that utilize the computer power of mainframe and miniframe machines and which are being utilized in agriculture and other industries [2]. These systems are very ex pensive; for example, the hardware for the GE Optomation visual inspection system (Syracuse, N.Y.) sells for approximately $60,000.
Machine Vision Equipment
A vision system encompasses three elements: a digital camera, a frame grabber, and a digital image processor (computer). The digital cameras used for image proc essing applications generally use Charge Transfer Devices (CTD), which are superior to the conventional VIDICON systems as they provide higher sensitivity, operate at low power, are light weight, and provide lag free, and burn free images. The CTD cameras are either the Charge Coupled Device (CCD), or the Charge Injection Device (CID) type, the CID type cameras have the advantage over the CCD type
Table 3.1: Machine vision camera specifications
Source Model Pixel Resolution Device
V H V H
Fairchild CCAID 488 488 380 488 284 CCD
Fairchild CCD 211 244 190 244 142 CCD
RCA SID 52501 512 320 480 240 CCD
Hughes HCCI lOOA 100 100 100 100 CCD
Sony SiCCD Color 492 245 350 280 CCD
Javelin JE 7362 490 610 450 CCD
Javelin JE 2362A 485 576 380 CCD
GE TN 2500 244 248 244 191 CID
GE TN 2200 128 128 128 128 CID
MicronTech IS256 512 128 200 640 OpticRAM
cameras, as they support random access addressing, and superior anti-smearing and anti-blooming control. The CCD devices, however, are more responsive to low-light-levels [23]. Table 3.1 lists a few cameras suitable for machine vision applications.
The GE TN2500 camera listed in the table is a fast camera with a data trans mission rate of up to 4.5 MHz per byte and standard video rate of 30 frames per second. It has high resolution with 488 lines of scanned video on a 525 line standard TV display in interlaced mode. It has Automatic Gain Control (AGC) capability for performance in low level lighting conditions [73]. This is a typical example of a good choice for capturing images in an industrial environment allowing for random access to the image areas which is certainly of advantage for irregular object applications. This camera and the control unit were available in the Manufacturing Automation Laboratory.
Once the image is captured by the camera, it has to be loaded on the computer memory. A frame grabber (memory buffer) is needed for synchronization between the camera (transmitting end) and the computer (receiving end). There are numerous vendors who make frame grabbers for vision applications. Most of the frame grabbers allow standard NTSC analog input. A substantial number of such boards are designed for desktop publishing and media applications, which generally are not suited for machine vision applications. One such board is the AT&T Image Capture Board which is available in our automation laboratory, supports color input, and is primarily meant for presentation graphics applications. The board is plug compatible with any IBM PC compatible microcomputer and has a fast capturing speed (30 frames per second). The only problem with the board is that it provides discrimination for 32 levels and supports a lot of features for image enhancement which are primarily meant for media applications. As a result, a single image is about 416,000 bytes in size. In our application, we are deaUng with a binary image which would only be about 16,000 bytes for a 640x200 (CGA) resolution. Hence extensive pre-processing would be required if we use the AT&T board. This would add significant overhead to the overall processing time. The time constraints in our application are such that we have to keep the processing overheads to a minimum, therefore, the board is not suitable for our application.
The camera selected for this research was Micron Technology Inc.'s IDETIX IS256 digital vision system camera. The PC bus compatible frame grabber board for this camera is readily available. This camera is based on the OpticRam module placed in the camera head. The camera is relatively inexpensive because of the optic RAM as opposed to the CCD (Charge Coupled Device) or CID (Charge Injection
Device), but is less sensitive to minor variations to light. It has a slower response time, and needs relatively higher soak time to capture an image. Optic RAM cameras are strictly a binary image type device (i.e., they do not lend themselves to respond to shades of gray). However, shades of gray can be generated by capturing multiple images by varying capture/soak time, by changing the camera F-stop, or by actually varying the light on the target image. The first method is generally easier to use and provides a better control. The camera does support the strobe action, however, due to hardware limitations, this is only practical if the image has a high contrast and has fewer or preferably no shades of gray. The image at any rate, is required to have a high contrast [37]. We used this camera system, as all the system components were readily available.
Since this camera was used in our system, we will attempt to describe its features in a bit more detail [37]. The Optic RAM used by the camera is organized in four arrays of 512x128 electrically addressable elements, or 262,144 pixels. The architec ture of the IS232 (the Optic RAM) is such that it has three dead zones between each array of elements. This imposes the limitation on the camera to be strictly level with respect to the target image. If not, then relative shifts in certain segments of the image are evident. Logic level of 0 is associated to a bright pixel, while, black pixel has a logic level 1. Initially, all the elements are charged to a logic level 1. When these elements are subjected to light, they are discharged. If the light intensity is high enough to discharge a particular element past the threshold, its logic level drops to zero. Another parameter which affects the logic level of an element is the amount of time the element is exposed to light. The longer the elements are exposed to light, the greater is the extent of discharge. Hence the combination of intensity and
duration determines the shape of the image which is supplied by the camera. To minimize the size of the optic RAM, the image sensors are arranged in an interleaved fashion, rather than linear fashion. Hence, the array of sensors is much longer than wide, resulting in space between cells in the column direction. The above topology suggests that straight linear read of the cells will result in a scrambled image. The camera is supplied with a library to implement de-scramble logics to provide images in a variety of formats. The format used for this research was a resolution of 640x192 pixels. It was later observed that 144 rows were enough to get a complete image, hence the image in the system was clipped to 144 rows. The last 56 rows were used to display status and feedback information on the monitor.
The MicronEye image capture board features a high speed data transfer rate us ing Direct Memory Access (DMA), which provides data transfer without intervention from the central processor unit. The data transfer rate is 6.4;fsec per data point, for an IBM/XT computer [71].
The microcomputer desired for our application was the IBM compatible personal computer. The code was designed to operate under any machine from the PC family. However, the computer having higher processing power and a higher level of proc essor (word size), would result in faster processing speeds. The computer used for this research was Zenith 248 computer, as this machine was readily available in the laboratory and met the requirements. The memory requirements for the final version of the program required at least 640K of Random Access Memory (RAM), which is incidentally, the higher limit supported by MSDOS, the disk operating system used by the above computer. The PC family of computers support Direct Memory Access (DMA) capability and have a large number of data Input/Output ports, which are
required to interface the computer with external control devices like a frame grabber board [71].
Expert System Techniques
Expert systems fall into the broad umbrella of artificial intelligence applications, as the efforts supported by these systems require some degree of intelligence. Intelli gence, as defined by Henry Bergson in early 1907 is .. the ability to create artificial objects, in particular, tools to make tools" [60]. We can see how valid this statement is by observing the enormous research activity in the present age to take the object oriented approach to computer problem solving. The domains of artificial intelligence research can be classified into the following categories:
• Knowledge-based systems
• Natural language processing (understanding) • Intelligent robots
• Scene and signal analysis • Information Retrieval
• Intelligent tutoring/training systems • Automatic theorem proving
• Automatic programming
Since expert systems are bound to emulate the logic and reasoning of a human expert, based on the knowledge provided to the system, they fall in the category of
the knowledge-based system. Expert systems are tools for solving problems from a specific domain of knowledge [15]. An inherent characteristic of expert systems is their ability to answer questions that are not in their knowledge-base by performing what is called plausible reasoning, by making judgements on what might be true, given certain assumptions about the domain [14]. If this characteristic is missing from a system, we term the system, merely, a knowledge-based system. Examples of knowledge-based systems which would not be classified as an expert system, would be an automated system for auditing an undergraduate program of study or an income tax return preparation system. Our seedling segregation system employs plausible reasoning to resolve the ambiguities incorporated by the undesirable interaction of the environment and the highly random nature of the image constructs. It is particularly used in the clamp identification and removal stage of the system. The difficulty with heuristics and intelligent defaults is that they can not be guaranteed to work, even though they may appear plausible [59].
Expert System Composition
Expert systems are the computer programs which attempt to predict, advise, and solve, problems by using the approach of the human expert in that area. Primary components of a knowledge-based expert system are composed of the knowledge base, inference mechanism, user interface, and an explanation facility. The advantage of having the knowledge-base separated from the rest of the components, is that several applications can be developed by just changing the knowledge base while keeping the rest of the components. This approach results in the availability of what are called the expert system shells. This compartmentalization approach in developing expert
systems reduces the cost of developing and maintaining expert systems [35].
The expert system knowledge-base is developed by so called knowledge engineers through a knowledge acquisition procedure. The human experts are interview^ed and are asked to answer a pre-designed set of questions. It is this information in the from of knowledge-base which is is used to resolve user inquiries. Therefore, the importance of having an accurate representation of the knowledge-base can not be over-emphasized. This information is commonly entered as a set of production rules, which are a set of IF-THEN constructs. These rules can either be prepositional, in which case all the variables used in the expressions have their values pre-assigned, or they can be predicate compositions, which permit qualifiers like (for all..., there exists... ). The later can contain un-assigned or free variables [76].
The inference engine (mechanism) is the process of applying the user query against the knowledge-base to search and reason. When a user queries the data base by requesting advice, his query is transformed into goal clauses. The inference engine resolves the queries by what is called resolution refutation, which is the process of negating the goal clauses, and adding them in the set of rules which exist in the knowledge-base.
As an example, let's consider the following facts from a rule base.
1. John likes all kinds of food.
2. Anything one eats and isn't killed by, is food.
3. Bill eats peanuts and is still alive.
The first step in the process of setting up a knowledge base is to represent the rules in predicate logic. The facts when properly transformed look like:
1. {FOOD(x) => LIKES(John,x)}
2. V,Vy {EATS(x,y) A ~ KILLED-BY(x,y) => FOOD(y)}
3. EATS(Bill,Peanuts) A ~ KILLED_BY(Bill,Peanuts)
The statements are then transformed into clausal form by applying a set of steps. These steps are outlined in reference [50]. The results of these operations, are the rules which form the knowledge base for the expert system.
The translation results in the following rules:
Rl> ~ FOOD(Xl) V LIKES(John,Xl)
R2> ~ EATS(X2,Y2) V KILLED_BY(X2,Y2) V FOOD(Y2)
R3> EATS(Bill,Peanuts)
R4> ~ KILLED_BY(Bill,Peanuts)
Now, we can make the following query from the knowledge base:
Name a food, John likes?
In the process of resolution refutation, we add the goal clause and its conjunction with the negation of itself in the set of rules. Hence, the new rule in the rule-base after transforming the above query into clausal form and its conjunction with the negation becomes:
R5> LIKES(John,X4) V - LIKES(John,X4)
The last step is to apply the rules and try to reach a conclusion by getting a
The process of applying these rules is shown in Figure 3.2, which shows the result that .John likes Peanuts.
L[KE5(JcKn,:'5)v '^LIK[S(JchnJ<5l
FOOD'Xl I V UKESim,Xl!
LlHiiiQ'-n,'''!! V '-Fui'Di/l!
EHTblX2,Y2ij.' KILLEDjYiy2,Y2i" F0CDiV2i
LIKES I John ;V21 v ''EAT5IX2,Y2I v I:ILLED.BVIX2,V2I
EftbiBlll.Piinyt LINES'John ILLEO.BViB111 ,Fe:r.uL- !
Haiiij>iMiiaBai
LIKES I John,Peanuts I
Figure 3.2: Process of resolution in a rule base by refutation
The process of resolution is used to show that negation of the goal clause results in a contradiction with the knowledge base, hence, the name resolution refutation 50]. The internal (low level) representation of the knowledge-base is in the form of a decision tree. This makes the order of the rule entry irrelevant. One great advantage of expert systems is their ability to back-track from a branch of the search tree if that branch does not result in a solution. There are two common strategies: the depth first strategy, and the breadth first strategy. The former traverses one branch of the tree until it is exhausted, while the later, computes all of the first level resolvents. The depth first strategy is more efficient in most of the cases.
The program keeps track of the rules applied to reach the decision. The user can invoke the explanation facility in order to examine the validity of the results. The component by which the user interacts with the system is the user interface. It must be noted that it is not necessary for the user querying the system to be human. As in our case the system is queried by the image captured by the system and the characteristics derived from the image. The ultimate user for the grading information, however, is the human user. It is important to be aware of end user needs in determining the output format and the format of the knowledge-base. The later is important in facilitating maintenance and house-keeping of the expert system. In our system, we generate a data base of the system status. This data base is duly time stamped and reflects any change made in the system status, the specie being used, the number of good, bad, and total for that specie, and the system-wide totals of good and bad seedlings, at the time system status was changed.
In an application like ours, where it is difficult to identify the components of interest from the environmental factors or noise, we use the approach of qualitative prediction. This approach is inductive in nature as we build our identification or resolution process in terms of the causal relationships, and dependencies. The type of induction is classified as instance-to-class generalization, if we formulate our rules from a large set of known instances [48]. For example, in our system the rules to identify and eliminate the clamp, the rules to track the stem path, and the rules to provide special processing in the needle area (in case of Pine), we subjected numerous seedlings to our system, identified various constraints and formulated the rules from those constraints. The other type of induction involves the part-to-whole general ization, in which knowledge about the system is fragmented and we have to satisfy
a goal based on that knowledge by a process of reconstruction [47]. The tap root identification and the identification and counting of lateral roots by our segregation system uses part-to-whole generalization, in which we use a stochastic approach to discriminate between lateral root, noise pixels, and inflecting portions of the tap root. The detailed description of the segregation methodology is presented in Chapter 4.
In order to establish baseline criteria for a broad based expert system and to in stitute sufficient segregation rules to accommodate the variety of soils, environments, and species in different planting regions, a greater knowledge base is needed. The nursery experts have varied opinions on this issue, therefore, it is difficult to have a generally acceptable expert system. We relied on the Ames Nursery experts for our grading rules.
Expert System Applications
As noted earlier, the availability of expert system shells and special computer environments for expert system development have greatly increased the rate at which the expert systems are being produced. Another factor in this rapid growth is the use of microcomputers in expert system development. Use of expert system shells is feasible, where the number of rules is large, and where processing time is not of primary concern. Both of these conditions do not apply to our system. The systems developed before the expert system tools were available were difficult to construct, required long lead times, and were very expensive. The classical examples from this era of expert systems are MYCIN (1974) for medical diagnosis and therapy, DEN-DRAL (1978) for searching chemical structures, PROSPECTOR (1979) for molecular genetics, MACSYMA (1971) for mathematical formula manipulation, and the geog
raphy teaching system SCHOLAR (1970). Often, new expert systems are developed as an extension to the previous expert systems after learning from the pitfalls and discrepancies or success from the previous generation. For example, WHY (1980) was developed following SCHOLAR which added causal reasoning to the purely factual reasoning of SCHOLAR. Generalization of MYCIN to EMYCIN (1979); GUIDON (1979) the tutorial system designed to be compatible with any EMYCIN knowledge base; and reformulation of MYCIN explanations in NEOMYCIN (1983).
Expert System Software Characterization
As discussed in the previous section, since the number of rules in our rule base is limited, and since we are designing the system for an application where processing time is of primary importance, we did not use special expert system shells, or special expert system languages. The discussion in this section about expert system shells and logic programming languages has been included for the sake of completeness. The expert system languages are specially designed to code symbolic logic. The most common expert system languages are LISP and Prolog; 0PS5 being among the less common ones. LISP developed at MIT has the advantage that it is the most widely used AI language, has a high application base, and is highly modular. Among the disadvantages; it runs inefficiently on conventional hardware, and requires a high amount of real and virtual memory. Prolog's greatest strength is its automatic and full support for backtracking, a fundamental operation in AI applications, and its ability to provide a direct and natural translation of predicate logic. It too can be quite inefficient for certain applications requiring a large number of backtracking operations. Prolog was adopted as a basis for Japan's fifth generation project [39].
The first microcomputer based AI shell is reported to be the Micro Expert [60]. Other systems include the ES/P Advisor, Expert Ease, and Personal Consultant Plus. MicroExpert and ES/P Advisor are Prolog based systems, while Personal Consultant Plus is LISP based. Another major expert system shell TWAICE was introduced in Prolog in 1985 [46].
Developing expert systems, quite often, is an involved task. A small expert system project might need one scientific-year effort, while, larger projects need as long as 10 or more scientific-years and can cost as much as $70,000 in equipment [32]. A new trend in languages for writing expert systems is to use object-oriented languages, since they provide a natural way to represent expert system entities [69]. SMALLTALK-80 is the most widely known general purpose object oriented language. New expert system object oriented languages include FLAVORS, LOOPS, and KEE [69]. The ES/P is also based on objects. Modern programming languages like Pascal and C are taking an object oriented restructuring. Object oriented Pascal has been introduced and a new version of C called C++ is gaining popularity. (It will be interesting to see the impact of these new transitions in using these languages for expert system applications.)
CHAPTER 4. DESIGN METHODOLOGY
Image Processing Considerations for Processing Irregular Objects
There are added restrictions when dealing with irregular objects. The image processing tools developed for processing irregular objects must accommodate such restrictions. When dealing with regular objects, noise (undesirable reflection from surrounding environment) can usually be suppressed without degrading the quality of the image of interest. This is accomplished by masking off isolated and unconnected pixels in the image, as they have no relationship to the object of interest. In the case of irregular objects, the isolated pixels, or isolated streaks of pixels, can not be ignored as they might be part of the object itself. Also, the defining elements like edges and holes in a regular objects can be discriminated from the object surface by adjusting the threshold of the gray scale. For example in a 256 level gray scale image one might specify a threshold of 100. This would mean that all the pixels which have a gray scale value of less than 100 would be treated as dark while the rest would be treated as bright. In case of irregular objects, we do not have this luxury. In case of regular objects, we can store the template of objects, or the definitions of objects, in a part library and compare the incident image with this library to identify an object. Object definition include such deterministic features as perimeter, centroid, moment of inertia, coordinate information of a particular feature.
and triangulation parameters which are generally stored in a parts library. In the case of irregular objects these values are of less significance and are very inefficient to determine. With regular objects, mathematical morphology (the process of applying mathematical treatments to the image by set operations) can be applied. While, with irregular objects this is usually not possible, as generally there are no mathematical models to represent the image or image parts.
In case of irregular objects we rely on the stochastic information at hand. For example, in our application, once we have identified the starting point of the needle area, we know that in the stem area, it is unlikely for the image of the tree seedlings to have a blob of pixels as high and as wide as the clamp on which they are mounted. This emphasizes the fact that the routines to process irregular objects must have dynamic windowing features. The preceding discussion also portrays the fact that in order to have an efficient system the processing speed of the routines is very important as they have to be utilized very heavily.
Also, with regular objects the point where the image processing task should start, is of less significance. This is because the object in general has some degree of similarity around its centroid. It does not usually matter if the analysis begins from the top left corner of the screen, or the bottom right corner of the screen, for example. This, in most of the cases, is not true with irregular objects. In our application, if we are to process the stem area, it would be impractical to start from the left edge of the screen, as we know that the stem area is closer to the right edge. We will show in the next section that it is to our advantage, if we process the clamp in right to left fashion as well.