Getting Started Machine Vision for Industry Version 4.2 for Microsoft® Windows® 9x / NT DS GmbH Information in this document is subject to change without notice. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of DS GmbH. © 1999 DS GmbH. All rights reserved. Version 4.2.99.16 of 06/09/1999 NeuroCheck is a registered trademark of DS GmbH. Microsoft, MS-DOS, Windows, Windows NT, are either registered trademarks or trademarks of Microsoft Corporation. IBM is a registered trademark of International Business Machines Corporation. iii Contents Introduction ..................................................................................................vii What’s New in NeuroCheck........................................................................... 1 New in Version 4.2 ......................................................................................................1 Hardware Support .............................................................................................1 Extensibility ......................................................................................................3 Image Processing Functionality ........................................................................4 New Test Program ............................................................................................4 User Interface....................................................................................................5 Program Structure ........................................................................................................5 Windows Integration.........................................................................................5 Integrated Working Environment......................................................................6 Password Protection..........................................................................................6 Check Routine Structure and Editing ...........................................................................6 Check Routine Control Flow ............................................................................6 Start and End Actions .......................................................................................6 Data Flow Configuration and Visualization......................................................7 Check Routine Overview ..................................................................................7 Editing Tools ....................................................................................................7 Hardware Support ........................................................................................................8 Device Manager................................................................................................8 Frame Grabbers and Cameras ...........................................................................8 Digital I/O and Field-Bus Boards .....................................................................8 Custom Communication....................................................................................8 User Interface...............................................................................................................9 Tabbed Editing Pages .......................................................................................9 Result Display...................................................................................................9 Check Function Selection .................................................................................9 Image Processing Preview ................................................................................9 Context-sensitive Menus and Alternative Controls...........................................9 Clipboard ..........................................................................................................9 Online Help System ........................................................................................10 Image Processing .......................................................................................................10 Regions of Interest ..........................................................................................10 Contents iv Image Tray......................................................................................................10 Template Matching .........................................................................................11 Mark Inspection ..............................................................................................11 Image Preprocessing .......................................................................................11 Object Features and Classification..................................................................11 Position Adjustment........................................................................................12 Gauging...........................................................................................................12 Color Processing .............................................................................................12 Integration into the Manufacturing Line.....................................................................13 Remote Control...............................................................................................13 Configuration and Diagnostic Tools ...............................................................13 Screen Output .................................................................................................13 File Output ......................................................................................................14 Serial Communication.....................................................................................15 Custom Communication..................................................................................15 Extensibility ...............................................................................................................15 Installing NeuroCheck ................................................................................. 17 System Requirements .................................................................................................17 Before Installation......................................................................................................18 Installation Procedure ................................................................................................18 After Installation ........................................................................................................23 Application Folder ..........................................................................................23 Start Menu ......................................................................................................23 A First Test .....................................................................................................24 Executing a Sample Check Routine ................................................................25 Hardware Configuration.............................................................................................25 Installing Special Hardware Components .......................................................25 Setting up Hardware .......................................................................................25 Removing NeuroCheck ..............................................................................................28 NeuroCheck Overview ................................................................................. 29 What is NeuroCheck? ................................................................................................29 Application Areas.......................................................................................................30 C......................................................................................................................30 Presence Verification ......................................................................................31 Object and Image Comparison........................................................................32 Optical Character and Pattern Recognition.....................................................33 Gauging...........................................................................................................35 Contents v Robot Guidance ..............................................................................................36 Basic Structure of NeuroCheck Applications.............................................................37 Check Routine.................................................................................................37 Individual Check.............................................................................................37 Start and End Actions .....................................................................................37 Check Function ...............................................................................................38 Modes of Operation ...................................................................................................38 Manual Mode..................................................................................................38 Live Image Mode............................................................................................38 Automatic Mode .............................................................................................38 Automatic Screen Configuration.....................................................................39 User Interface.............................................................................................................39 “Short Ways” ..................................................................................................39 Context Sensitivity..........................................................................................40 Online Help.....................................................................................................41 Sample Files...............................................................................................................42 Creating a New Check Routine ................................................................... 43 Inspection Task ..........................................................................................................43 Creating the Check Routine .......................................................................................43 Check Routine Description .............................................................................44 Saving the Check Routine...............................................................................44 Creating a Check.............................................................................................45 Image Acquisition ......................................................................................................46 Capturing the Image........................................................................................46 Transferring the Image....................................................................................46 Setting Parameters ..........................................................................................47 Parameters for the Image Transfer ..................................................................48 Executing the Image Transfer .........................................................................48 Image Preprocessing ..................................................................................................49 Unavailable Functions.....................................................................................50 Parameters of “Enhance Image” .....................................................................50 Defining Regions of Interest ......................................................................................50 Using Online Help......................................................................................................52 Function Descriptions .....................................................................................52 Help on Individual Parameters........................................................................52 Help on Graphics Panels.................................................................................52 Determining a Threshold............................................................................................52 Display Options..........................................................................................................53 Contents vi Searching for the Plug ................................................................................................54 Searching for the Pins ................................................................................................55 Objects as Regions Of Interest........................................................................55 Function Names ..............................................................................................56 Search Parameters...........................................................................................56 Check Number of Pins ...............................................................................................57 Automatic Execution..................................................................................................59 Switching to Automatic Mode ........................................................................59 Triggering the Check Routine.........................................................................59 Automatic Mode Screen..................................................................................60 End Automatic Mode......................................................................................61 Check Routine Wizard ...............................................................................................61 Index .............................................................................................................. 62 vii Introduction Welcome to NeuroCheck Version 4.2, the professional machine vision and quality control system for Microsoft Windows 9x/NT. This Getting Started Guide introduces you to NeuroCheck, explains the first steps in NeuroCheck and shows you how to get comprehensive information about the system. It is organized as follows: • Chapter 1 outlines what is new in version 4.2 of NeuroCheck. • Chapter 2 defines the system requirements for NeuroCheck and describes the installation procedure. • Chapter 3 provides an overview of what NeuroCheck is and what you can do with NeuroCheck. • Chapter 4 gives you a quick guide on how to construct visual inspection applications with NeuroCheck. Contents viii 1 CHAPTER 1 What’s New in NeuroCheck True to the NeuroCheck® philosophy, development of version 4.2 focused on incorporating all the ideas derived from the realization of visual inspection systems using version 4.1 into the new version. The field-proven, flexible program structure has been extended with several new image processing and process control functions. The well-established user interface has also been retained and enriched by a multitude of useful details. This chapter starts with the presentation of the most important new features in NeuroCheck 4.2, followed by an overview of the program structure and functionality added for the benefit of first-time users. New in Version 4.2 It is a matter of course, actually, since version 4.1 did already work fine under Windows 98, but we would nevertheless like to mention that as of version 4.2 NeuroCheck officially supports Windows 98. This does, of course, include the hardware drivers. Hardware Support New Frame Grabbers With version 4.2 we have started to extend the range of frame grabber manufacturers supported by NeuroCheck. The first boards we have selected for addition to NeuroCheck are manufactured by Matrix-Vision and answer demands for high-end gauging and surface inspection applications: • PCimage MV-SG/SGVS: this board offers four freely programmable multistandard inputs to be used with a wide variety of analog video inputs, including standard video cameras, shutter cameras, progressive-scan cameras and asynchronous reset cameras for the inspection of fast moving parts. A programmable sampling frequency of up to 40 MHz allows for the operation of high-resolution cameras. The separate pixel clock inputs enable distortion-free image capturing on all four channels for high-precision gauging tasks. Chapter 1 What’s New? 2 • PCimage MV-SDIG: support for this digital frame grabber has been added to NeuroCheck mainly for the purpose of connecting digital line-scan cameras used for surface inspection applications. Both frame grabbers support high-speed DMA transfer over the PCI bus to enable real-time processing. As usual in NeuroCheck, any number of frame grabbers can be operated simultaneously (limited only by the hardware of the PC used, i.e. number of slots and interrupts). It is even possible to use a mix of different frame grabbers from different vendors at once. You can for example connect an MV-SDIG to a digital line-scan camera, a DT3153 to a color camera and a DT3152 or MV-SGVS to an asynchronous progressive-scan camera. The original range of field-proven PCIboards from Data Translation's Mach series is of course still being supported by NeuroCheck and has been supplemented by the new DT3152-LS for analog line-scan cameras: • DT3155 for standard tasks. • DT3152 for high-speed applications and applications requiring pixel synchronized image capture. • DT3152-LS for surface inspection using analog line-scan cameras. • DT3157 for high-precision gauging with digital cameras. • DT3153 for color applications using PAL/NTSC color cameras. Depending on the capabilities of the image processing boards several cameras can be connected to each, all having individual parameters (like image size, sync level...) Hardware Management The renowned ease-of-use of NeuroCheck's hardware management has been improved further by adding a driver information function. During configuration of a new board in NeuroCheck, this functionality checks whether all required drivers are present on the target system and have the correct version. Problems due to outdated or corrupted low-level driver installations from the various hardware vendors are now easily detected. Our download page at http://www.neurocheck.com features links to the web sites of all hardware manufacturers supported by NeuroCheck so that you can easily obtain the most recent drivers directly from there. Camera Management Camera setup parameters can now be simply copied from one camera input to another in NeuroChecks device manager. A camera setup file is no longer needed to transfer camera parameters within one installation of NeuroCheck. Of course, camera setup files are still supported, for exchanging camera descriptions between installations. They have even been enhanced with several new features and are now accompanied by a viewer tool to allow for comparison of different camera setups without starting NeuroCheck. Chapter 1 What’s New? 3 Communication NeuroCheck 4.2 supports digital communication through field-bus devices. They are treated identically to digital I/O boards. The address space for each field-bus card is of course configurable and, as always, different field-bus and digital I/O cards can be used simultaneously and with individual parameters. Extensibility As of version 4.0, NeuroCheck provided an automation interface for remote-control of the program using the Windows communication standard ActiveX / OLE. This interface has undergone extensive revision for version 4.2. Special care has been taken to meet the requirements of Visual Basic programmers, for example with a new image data transfer method which uses the clipboard. This makes it very simple to display images captured by NeuroCheck in a Visual Basic form. The new interface comprises approximately 100 functions for remote-control of NeuroCheck, parameter and target value setting and result retrieval. It is fully documented in the Programmer's Reference, including source code examples for Visual Basic and Visual C++. The potential of this technology can hardly be estimated completely. Possible applications range from specialized input forms for the machine personnel to entire production line control systems. Not surprising that, under the OPC label (OLE for Process Control) it finds increasingly widespread attention in the area of production automation. The figure shows an example for the capabilities of the new interface. This OLE controller retrieves a camera image and several measurement values from NeuroCheck and performs statistical computations on the measurement data. The enhanced Visual Basic awareness of NeuroCheck's OLE interface also allows for direct evaluation of image processing results by Office applications like Microsoft Chapter 1 What’s New? 4 Excel or Access. For example, NeuroCheck's results can be transferred directly into spreadsheets or data bases for evaluation and integration into company wide quality management systems Image Processing Functionality DataMatrix Code Identification In addition to standard bar codes, NeuroCheck 4.2 can also read DataMatrix Codes according to the International Symbology Specification 1.01 of the AIM. This functionality reflects the growing importance of this space-saving two-dimensional extension to traditional bar codes, especially in the international pharmaceutical and transport industry. Nested Binary Search Function Create ROIs by Thresholding has been extended to perform a nested binary search. If you have a sequence of dark and light objects enclosing each other you can now create all objects of the same color at once. This feature can be quite useful, especially if an unknown number of nested levels makes a hierarchical search through the levels very difficult. New Test Program The test program Ncdiag.exe has of course been adapted to the new range of hardware supported by NeuroCheck 4.2. The purpose of this tool is to verify a NeuroCheck installation with respect to hardware and software. For example, it checks presence of drivers, accessibility of frame grabber boards, dongle encoding etc. The installation items to be checked are configurable so that the program ignores Chapter 1 What’s New? 5 missing drivers for boards not installed in your system. The test protocol can be pasted directly into Windows' integrated word processor to be archived or forwarded. Thus you can get a complete overview of the state of an inspection system quickly and conveniently. Both the administrator of the inspection system and the support engineer will benefit greatly from this new tool when searching for possible inconsistencies. User Interface As always, user interface and program frame have been revised for greater flexibility and ease-of-use. Some of the new features: • Since NeuroCheck now supports various line-scan camera interfaces and is widely used for line-scan applications, a 10% zoom factor has been added to all image displays (in the result window pane, live view and in automatic screen windows). This gives an improved overview of the typically very large line-scan camera images. • Administration of identical check routines on various machines has been improved by changes to the management of path information in check routines (e.g. for classifiers, training data, reference bitmaps). • In addition to result images the check routine structure from the left window pane in manual mode can be copied to the clipboard to ease documentation of NeuroCheck applications. • The sequence of individual checks in the check routine can be changed at any time simply by dragging the check in the check routine tree view to its new position (unless this check is part of a conditional branching sequence). • Due to the increased communication functionality (see above, field-bus support) a new check function category "I/O" has been added. Program Structure This section and the following highlight some of NeuroCheck's most remarkable features. They do of course not even come close to a comprehensive description of the program. Windows Integration NeuroCheck Version 3.0 was the first version of NeuroCheck to take full advantage of a 32-bit architecture, such as: • No restrictions on full frame processing • Substantial speed up in many image processing functions Chapter 1 What’s New? 6 • Improved real-time stability because of the preemptive multitasking in Windows 9x / NT Version 4.x takes this a step further by introducing native versions for all current 32bit operating systems by Microsoft together with support for OLE for even closer integration with the Windows environment. Integrated Working Environment The homogeneous 32-bit architecture allows for free combination of image processing functions from all application areas, seamlessly integrating user-defined functions into the working environment. There is no distinction between a configuration and a runtime program in NeuroCheck, allowing for easy editing and optimizing of already installed applications directly on the production line. Password Protection You can protect check routines by a password. This makes it possible to experiment with the parameters of check routines without accidentally losing a version that is important for your manufacturing process. In addition to this check routine protection, system passwords can be used to define different access levels for different groups of users. Check Routine Structure and Editing Check Routine Control Flow Check routines are made up of individual checks which are essentially independent of each other. The sequence of these checks can be freely changed at any time through drag-and-drop within the check routine tree, unless the checks are part of a conditiional branching sequence. Conditional branching between individual checks has been introduced in NeuroCheck 4.0, allowing to decide from the result of one check in a check routine, which check to execute next. This offers for example the possibility to perform type dependent checks without an external control program. The Start and End Actions Two special checks can be added to a check routine. The start actions will always be executed before all other checks, the end actions afterwards. For example, the start actions can be used to quickly capture several images and store them on the image tray to be processed later, when the the test piece may already be on its way out of the inspection station. The main purpose of the end actions is to synchronize NeuroCheck with the manufacturing process after completion of all individual checks, e.g. by exchanging specific digital signals. Chapter 1 What’s New? 7 Data Flow Configuration and Visualization Inputs and outputs of image processing functions are configured automatically, so as a rule, you will only have to select the necessary image processing and communication functions from the function pool one by one, adjust a few parameters, and have NeuroCheck take care of everything else. For the few cases where these connections need to be edited, a separate tabbed edit page visualizes data flow through a check routine and features a clearly structured editing dialog. Check Routine Overview The check routine overview window can be inserted into the check routine tree view. It gives a quick overview of important configuration properties of a check routine, e.g. digital inputs and outputs used, image sources etc. Editing Tools NeuroCheck offers a lot of useful tools to facilitate editing check routines. One of the most useful tools besides rulers and cross-hairs for pinpointing object sizes and locations and a gray level analysis window is a NeuroCheck specific clipboard used to transfer parameter settings from one check function to another, including e.g. custom-made filter kernels – even between different check routines. Check functions in existing check routines can be inserted and deleted without losing parameter settings already adjusted – provided that the check routine maintains a consistent data flow. Hardware Support Device Manager The various hardware devices necessary to integrate an image processing system into an automated manufacturing process are administered using a single unified device manager, closely following the familiar hardware management of Windows 9x / NT 4.0. New devices are added using a convenient hardware wizard. Chapter 1 What’s New? 8 Frame Grabbers and Cameras NeuroCheck supports simultaneous operation of as many frame grabbers as the PC system permits. The frame grabbers can be of different makes and models, for example to use line-scan cameras, analog gray level cameras and color cameras at the same time. Cameras connected to a frame grabber can be individually named. These names are used throughout the software, so there is no need to remember that the camera looking at the right side of the spark plug on the fourth cylinder is connected to input 2 of frame grabber 1; simply name the camera accordingly. Furthermore, a separate reference image can be stored for each camera. These images are used to adjust the system for automatic operation. If the frame grabber allows for the setting of input parameters, these can be stored in a camera setup file to be shared between NeuroCheck installations. Camera setup files can be exported as text files to facilitate archiving camera settings in humanreadable form. Digital I/O and Field-Bus Boards NeuroCheck can use several digital I/O and field-bus boards simultaneously, each giving you 16 freely assignable inputs and outputs per board. All input and output channels can be individually named for easy identification. Custom Communication Through custom communication DLL drivers, NeuroCheck can access practically any communication hardware and use it for remote-control and result output. The DLL driver interface is simple to program and fully documented in the accompanying Programmer's Reference. User Interface Tabbed Editing Pages The main aspects of a check routine (structure, data flow, data output, control flow) are edited on tabbed edit pages in the left window pane; each of those gives a complete overview of the whole check routine structure, so that you’ll always know where you are at the moment. Result Display The result display pane of the main window allows for different zoom levels. Result views can be switched from a list box, so it is easy to see what is being displayed and what alternatives are available. The result image can be saved directly from the window to a bitmap file or copied to the clipboard. Chapter 1 What’s New? 9 Check Function Selection The dialog for selecting check functions to be inserted or appended to the current check has been designed to make all information readily available to the user and to make the use of the software as rapid, easy and transparent as possible. The dialog is clearly structured into different function categories. The dialog displays information on the purpose of each check function as well as hints what can be done with the function or why it cannot be used at this point of the check. Image Processing Preview Apply buttons in many function dialogs allow for a quick full-size preview of the result without leaving the dialog. This makes it very simple to select the most effective filter algorithm or the optimal binary threshold. Context-sensitive Menus and Alternative Controls True to the Windows philosophy NeuroCheck widely supports the intuitive use of the right mouse button. Object properties, parameter settings, online help, clipboard, everything is accessible via the right mouse button. At the same time traditional control elements are used in most functions to give an immediate overview of the present configuration. Clipboard NeuroCheck fully supports the Windows clipboard, i.e. you can paste result images computed by NeuroCheck into every Windows application to document your visual inspection applications. Alternatively you can also drag the image directly from the NeuroCheck window into the other application, provided the other application supports drag & drop. Online Help System The help system of NeuroCheck 3.0 set a new standard for comprehensive reference information, exploiting all features of Windows 9x / NT 4.0, in particular: • Hierarchical table of contents. • Two-level keyword index. • Context-sensitive popup help for control elements: the context help button gives immediate access to explanations for a particular control element or function parameter. Keyword-based cross references to related topics and new navigational structure make accessing relevant information still faster and more intuitive. Chapter 1 What’s New? 10 Image Processing NeuroCheck offers close to 50 check functions. Their flexibility and configurability makes of these functions equivalent to a much larger number of traditional C functions in an image processing library while at the same time being much easier to use through the fully graphical point & click approach. In this section we will highlight some image processing features of NeuroCheck. The User-Manual (and the online-help) of course contains full descriptions of all functions with all parameters and a lot of fundamental algorithmic explanations. Regions of Interest The unrivaled flexibility achieved by the equivalence of manual and automatic regions of interest and the grouping of regions introduced in version 3.0 of course still applies. NeuroCheck 4.2 does not distinguish between manually defined regions of interest and automatically created objects. Therefore user-defined search regions can be measured just like real image objects, whereas an automatically found object can immediately be used as a new region of interest to be searched for other objects. NeuroCheck’s image analysis functions can treat each group of regions with individual parameter settings. Examples are the application of different binary thresholds to each group, specialized classifiers for each group, different sorting and counting operations on each group etc. Furthermore, whole groups can be approximated by model geometries, for example to check how precise the pins of an IC are situated along a straight line. The possibilities are endless. Image Tray The image tray is a storage area where camera images can be buffered prior to processing with NeuroCheck. This enables you to acquire several images in rapid succession, for example during the start actions of a check routine, which can then subsequently be processed, while the test piece has already been removed from the cameras’ field of view. Template Matching One of the most important functions is doubtlessly the object search by Template Matching. It offers all conceivable options: • Searching for a specified number of objects in an arbitrary number of regions of interest. • Several templates for each object class. • Unlimited number of object classes. • Pyramid search for speed-up. • Exclusion of objects not meeting a required degree of similarity to the templates. Chapter 1 What’s New? 11 Versatile as it may be, Template Matching is not always the appropriate function to find objects in an image. In addition to correlation, NeuroCheck offers segmentation of objects by binary thresholding or edge search. Mark Inspection To perform mark inspection a difference image is computed by positioning a reference image with subpixel precision relative to features on the current live image. The difference image can then be analyzed using the full flexibility of all NeuroCheck functions. Image Preprocessing NeuroCheck offers all traditional image preprocessing functions – and some new ones. Function Filter Image alone replaces a score of traditional library functions. In addition to a list of about 50 predefined standard filters, filter kernels can be edited at will to fit arbitrary geometric structures and be combined with any filter algorithm to achieve very specific filter effects. Other preprocessing functions include Smooth Regions, a specialized twodimensional filter for improving edge detection, look-up tables, shading correction and geometrical transformations. Object Features and Classification NeuroCheck can compute more than 50 features for individual image objects, ranging from simple dimensions to complex features like curvature vectors. These features can be used to sort objects and to distinguish between object classes by means of individual threshold values for every single feature and also by neural classifiers. NeuroCheck can identify standard bar codes as well as 2-dimensional DataMatrix codes. Through its trainable classifiers it can identify any type of symbol – of course including characters printed in any font. Position Adjustment NeuroCheck can use reference objects to determine variations in position and orientation between images. Object searches can be executed relative to the new reference position to compensate for these variations. Gauging NeuroCheck can compute more than 50 dimensional measurements relating to one, two or more objects with sub-pixel accuracy. Each of these measurements can be compared to separate nominal values with individual allowances. Comparison to ideal geometric shapes – like lines and circles – is also possible, for example to judge the straightness of an edge or to determine the precise positioning of objects on a circle. Chapter 1 What’s New? 12 Color Processing Components of equal brightness can be distinguished using function "Color Matching". This function converts relevant colors to gray levels. This allows the identification of parts by color with the efficiency of a highly optimized gray level system. The image shows the segmentation of blue capacitors and an orange plug on on a circuit board. Color support also includes saving true color bitmaps, provided a color frame grabber has been installed. Integration into the Manufacturing Line Remote Control NeuroCheck can be remote controlled via digital I/O, serial interface or OLE automation. It is even possible to switch check routines by remote control, achieving a “retooling” of a complete visual inspection systems in a matter of milliseconds. A "System running" signal gives permanent information about the operating status of the machine whereas the "System ready" signal indicates that NeuroCheck is currently waiting for a start signal. This facilitates easy hand-shaking with the controlling instance. Configuration and Diagnostic Tools Each individual check in NeuroCheck can store up to 1000 cyclically numbered error images for tracing and optimizing problems of the inspection system as well as the manufacturing process itself. Reading of digital inputs and image capture from camera can be deactivated separately. This makes NeuroCheck independent of the presence of these signals to simplify editing a check routine already installed on the manufacturing line without having the production process running. Chapter 1 What’s New? 13 Screen Output The screen display of NeuroCheck in automatic mode is freely configurable. You can place windows at will and connect them to check functions individually in order to display live images, result images, measurement values, statistics, decisions of individual checks... Every check routine can manage several different screen layouts for various purposes, e.g. normal operation, debugging or demonstrations. Furthermore, NeuroCheck can display a static background image in automatic mode. You can use this to give your applications an individual look and feel. In the following figure the background image has been used to create a block diagram of the application. It also displays the application title and the company logo. The additional windows at the bottom convey information to the operating personnel. File Output For all appropriate functions, NeuroCheck offers a standardized interface to write result data to file. This includes measurement values as well as image data or check results. The data to be written can be specified for each function separately. Thus NeuroCheck meets the demands of modern quality management systems for a comprehensive test documentation. The protocol file can of course be located on an arbitrary storage device, including networked hard drives. The file format can be adapted interactively for compatibility with widely-used standard software packages (like Microsoft Excel). Chapter 1 What’s New? 14 Serial Communication In addition to writing to file, NeuroCheck can also direct the output of arbitrary result data to the serial interface, using a fully documented communication protocol offering error checking by check sum or CRC32. Custom Communication Even the already highly flexible NeuroCheck communication protocol cannot support all the special features of every PLC on the market. Therefore NeuroCheck now offers a fully documented DLL interface for the integration of user-defined communication protocols. This makes NeuroCheck ideally suited for today’s highly integrated manufacturing processes. Extensibility Last, because it certainly is a feature for advanced users, but definitely not least, because it gives a whole new dimension to the power and flexibility of NeuroCheck: the software offers several fully documented extension interfaces: • Plug-in DLLs containing user-defined image processing functions. These functions are seamlessly integrated into the NeuroCheck environment; this means they can use the complete functionality provided by NeuroCheck for its own functions, including parameter copying, output to various destinations, runtime data visualization... You can thus design your own specific preprocessing functions, support proprietary communication protocols, and generally do things which are much too specialized for a standardized software product without having to buy expensive custom-made software. • Custom communication DLLs supporting arbitrary communication hardware using an interface equivalent to the serial communication driver included with NeuroCheck. • OLE automation for remote-control NeuroCheck from your own Visual C++ or Visual Basic application in order to provide your application with its own custom-made user interface. The OLE automation interface consists of approximately 100 functions giving access to all relevant functions and parameters in NeuroCheck. 15 CHAPTER 2 Installing NeuroCheck System Requirements Installing and using NeuroCheck requires a PC running the operating system Microsoft Windows 9x or Windows NT. That means NeuroCheck’s system requirements are identical to those of the operating systems: • IBM® Personal Computer or fully compatible. • SVGA Monitor and graphics adapter (preferred resolution 1024*768 by 256 colors). • 80486 or later processor (preferably Pentium II or later). • 16 MB of available memory (preferably 64 MB, especially for NT version) • appr. 10 MB of free hard disk space (depending on the amount of installed sample files) • Windows 9x / NT 4.0 This configuration is sufficient for using NeuroCheck as a development system in an image processing laboratory. Applying NeuroCheck as a completely automatic inspection system requires the following additional components: • Frame grabber board with camera. • Digital I/O board or serial interface for communication with PLC or master control computer. Information on how to configure NeuroCheck for using these hardware components is given later in this chapter. Before Installation First you should connect the security key to the parallel interface of your PC. The installation program does not need the key, but if you want to test NeuroCheck immediately after installation you certainly do not want NeuroCheck to start with restricted functionality. Chapter 2 Installing NeuroCheck 16 If the parallel interface of your PC is used by any other device, like a printer, simply insert the security key into the parallel interface, then connect the device to the security key. The security key does not affect these signals. Installation Procedure To install NeuroCheck from diskettes place disk 1 into the disk drive of your PC. Have the Windows Explorer display the contents of the disk and start the program SETUP.EXE. In most cases you will only have to press the return key a few times to install NeuroCheck on your system. To install NeuroCheck from a CD-ROM click ‘NeuroCheck® English' in the CD interface program or change to directory ‘\Ncheck_e\Disk1’ on the CD-ROM and start the program ‘Setup.exe’. The installation program will automatically detect your operating system and install the correct files. The welcome screen of Setup allows you to interrupt the installation by choosing “Cancel” in order to close other Windows applications first. This is recommended, because some shared resources have to be installed into the Windows system directory along with NeuroCheck. If no other programs are running, you can continue by choosing “Next” or pressing the “Return” key. Chapter 2 Installing NeuroCheck 17 Determining User Information Setup reads user information from your system’s registry. If the Windows system has not been installed using your name you may have to change the information in this dialog box. The dialog requires information to be entered in both edit fields. Choosing the Installation Directory In the next step, Setup asks you, if you want to install NeuroCheck into the standard directory ‘\Program Files\NCheckXX’ on the Windows system drive, where 'XX' stands for the NeuroCheck version (to enable several versions running on the same machine). You can select a different directory by choosing “Browse...”, but we recommend that you simply confirm the default selection because it adheres to the Windows setup guidelines. To confirm the default selection, simply choose “Next” or press “Return”. Chapter 2 Installing NeuroCheck 18 Selecting the Setup Type In the following dialog box you can choose from several types of setups by selecting the appropriate button. The “Custom” option lets you decide, which files to install. Selecting Additional Components If you selected the “Custom” setup option, the following dialog box will appear in which you can select the components to be installed. Components with a check mark in front of their name are selected for installation. Clicking on the check mark (or the empty space) in front of the name will toggle the installation state of the component. For all components except “Program Files” the “Change” button will open a second dialog box enabling you to select individual device drivers, samples etc. in detail. We recommend installing all sample files as they can give you valuable hints for creating machine vision applications with NeuroCheck. Among other things, they include all examples used in this guide and in online help. Chapter 2 Installing NeuroCheck 19 After selecting the components to be installed, choose “Next” or press “Return”. Copying Files Setup now starts copying the NeuroCheck files to the destination path. The large progress indicator centered in the bottom area of the screen informs you about the progress of the installation. The information gauges show, from left to right, the progress of copying the current file, the progress of copying all files on the current installation volume and the total disk space still available on the target drive. If you are installing from disks, Setup will ask for further disks sometime during the installation process. Please insert the appropriate disk into your disk drive and press “Return”. Setup will then continue the installation process. Setting up Program Folders When all program files have been copied successfully to the destination path, SETUP displays the following dialog box to ask for the name of a program folder for the NeuroCheck application, uninstallation and info file icons. The folder will be included into the Start Menu. Henceforth you can run NeuroCheck like any other Windows application from a submenu of the Start Menu. Chapter 2 Installing NeuroCheck 20 Completing the installation The final dialog box of the setup program allows you to launch WordPad (or Notepad on minimal installations of Windows) to view the latest information on NeuroCheck. You can also start NeuroCheck directly. Νote: If the setup program was unable to update specific files because they were in use during installation, it will ask for a reboot here and will not allow you to start NeuroCheck or the readme file. This is typically the case when OLE examples are installed. Please note that in order to start NeuroCheck as a licensed version you will have to install the dongle drivers first. The setup program is located in the 'Dongle' directory on the CD-ROM and can be called from the CD user interface directly. Chapter 2 Installing NeuroCheck 21 After Installation Application Folder After Setup has been finished, Windows displays the NeuroCheck application folder. You can start NeuroCheck immediately by double clicking the application icon. First, though, you should take a look at the readme file, containing the latest information on NeuroCheck. Double clicking the icon of the readme file in the application folder will launch Notepad to display the file. Start Menu Now you can run NeuroCheck and the documentation files belonging to NeuroCheck directly from the NeuroCheck submenu in ‘Start\Programs’. Chapter 2 Installing NeuroCheck 22 A First Test Run NeuroCheck from the Start Menu. First the NeuroCheck welcome screen appears, then the application window. From the ‘?’ menu choose the menu item ‘About NeuroCheck’ to display the following info dialog box. If the box displays the message “Lite Version” although you purchased a licensed version, the reason is probably a missing security key or missing dongle drivers. You can easily check the presence of the security key in the NeuroCheck status bar. If the Chapter 2 Installing NeuroCheck 23 security key has been successfully detected, the status bar shows a small green icon in the shape of the key inside the info area: If this icon is missing, exit NeuroCheck and insert the security key into the parallel port of your PC, as described in the Section “Before Installation”. Also install the dongle drivers from the 'Dongle' directory on the NeuroCheck CD-ROM or from the appropriate diskette. After starting NeuroCheck once more, the box should look as above (of course displaying your individual license and serial number and system information). Executing a Sample Check Routine If you installed the sample files, you can now choose the menu item ‘Open’ from the ‘Check Routine’ menu and load the ‘DEMO’ check routine from the ‘EXAMPLES’ directory. Individual checks are opened and closed using the / icons. After selecting one of the check functions in a check by a click with the left mouse button, you can step through the check function by function using the ‘Execute’ and ‘Next’ functions from the ‘Check Function’ menu or the corresponding icons. Hardware Configuration Installing Special Hardware Components Please refer to the manuals supplied by the hardware vendor for information on installing special hardware components, like frame grabber and digital I/O boards, Setting up Hardware Before you can use frame grabber boards, digital I/O boards, video multiplexers or the serial interface from NeuroCheck, you have to tell NeuroCheck, which hardware you have installed. This section demonstrates the setup process for the most common device used with an image processing system: a frame grabber. Start NeuroCheck and choose ‘Device Manager’ from the ‘System’ menu. In the (currently completely empty) device manager choose ‘New’. On the first page of the hardware wizard, which will help you setting up your hardware, select ‘Frame grabber board’ and choose ‘Next’. Chapter 2 Installing NeuroCheck 24 The second page will differ depending on the type of device selected on the first page, but the basic functionality is always identical. Select from the topmost list box the make and model of the hardware you want to install. Additional control elements are used to set up parameters of the hardware, in this case the base port address for an ISA frame grabber (with PCI frame grabbers NeuroCheck can get all the information it needs from the Plug and Play compatible boards). Only in rare cases will it be necessary to change the default settings. Chapter 2 Installing NeuroCheck 25 The final page of the hardware wizard summarizes the setup information. Choosing ‘Finish’ sets up the selected hardware device after checking for its presence. Chapter 2 Installing NeuroCheck 26 Using the "Info" button you can easily check the installation of the required low-level drivers for the selected board. Removing NeuroCheck NeuroCheck supports the standard uninstall procedure of Windows 9x / NT. Like any other Windows application you can remove NeuroCheck from the control panel. In addition to this a direct shortcut to the uninstallation program is installed together with NeuroCheck so that you can launch uninstallation from the NeuroCheck sub menu created during installation. Please refer to the Windows documentation for further information. Uninstall may inform you that it was unable to remove some components. This is due to the fact that NeuroCheck installs shared resources that may be used by other programs and might therefore not be safely removed. Another reason for this message can be the existence of files within the NeuroCheck directory which the installation program did not create and which the uninstall program therefore does not know how to deal with. 27 CHAPTER 3 NeuroCheck Overview This chapter gives an overview of NeuroCheck and its components What is NeuroCheck? NeuroCheck is a universal image processing system designed for use within automatic production processes and quality management systems. It offers an integrated environment for the interactive configuration of visual inspection applications and their automatic execution on the manufacturing line. The following figure depicts the basic setup of a visual inspection system with the required hardware components and communication connections. With its broad selection of image processing functions NeuroCheck can be used in a wide range of application areas. Highly automated check routine configuration and an intuitive graphical user interface help to solve visual inspection problems. NeuroCheck’s communication abilities include using the clipboard for data exchange with other Windows applications and generating complete inspection records by writing results to file or transmitting them via serial interface. NeuroCheck is also able to communicate via OLE, which is fast establishing itself as a new standard in Chapter 3 Overview 28 process automation. This makes NeuroCheck ideally suited for application in today’s highly integrated production processes and modern quality management systems. Application Areas This section introduces typical areas for using NeuroCheck in industrial manufacturing processes. The excerpt from our application database included with the Developer Version of NeuroCheck contains examples from most of these application areas. Code Identification NeuroCheck® can identify standard bar codes as well as the increasingly popular 2dimensional DataMatrix codes according to the symbology specification of the AIM. Examples for bar code identifications abound in all industrial areas, as different types of bar codes are used for the identification of all kinds of products in packaging, logistics, manufacturing control... NeuroCheck reads all common bar codes with contrast levels as low as 5%, forward and backward as well as in horizontal or vertical direction and even rotated. Bar codes are often used for type-dependent checking, i.e. automatic switching of check routines in accordance with a bar code identified first. The example shows that NeuroCheck is able to identify bar codes of very poor quality, in this case a considerably damaged ink-jet bar code on metal. Presence Verification Use NeuroCheck to detect the presence of all required parts easily and reliably. Examples for this type of application are: • Check presence of connector pins. • Check number of tablets in a blister or the completeness of packaging contents in general. • Check circuit board components. • Check correct injection mold of plastic parts. Chapter 3 Overview 29 • Inspect work pieces for damage (using appropriate measurements). • Check presence of screws, contacts, markings, inscriptions etc. • Check fill level and correct closure of bottles. NeuroCheck’s full range of image processing options is available for detailed inspections: • Objects can be screened according to measurements, i.e. you can specify that only objects having a certain minimal size or a certain ratio of height to width or any other combination of the more than 50 features available in NeuroCheck are valid. This enables the check routine to automatically exclude damaged parts (like bent connector pins or broken tablets). • An arbitrary number of inspection windows can be defined. The number of objects as well as the validity criteria can be checked separately for each inspection windows. Thus you can for example detect, which row of contacts contains a bent pin or where a tablet is broken in order to gather information about problems in the production process. • You can define inspection windows of any shape, e.g. for counting objects positioned around a circle, like teeth on a gear wheel or markings on a dial. • If the overall appearance of the objects is important or measurements cannot be compared independently from each other, neural networks can be trained to recognize a deviation from the reference objects. You only need a collection of correct and faulty parts to enable the neural network to learn the difference between the two. The image shows the inspection of clamps on a car air conditioning unit. Chapter 3 Overview 30 Object and Image Comparison This application area is concerned with verifying the correspondence between the current image and a reference image. For mark or print quality inspections a complete image is typically used as the reference; other applications may store a whole set of objects as reference, complete with various feature values. The latter type of application is similar to a presence verification with the added difficulties that the objects have to be laid out in a specific arrangement and may have very different characteristics, making it very complicated to check their presence by simple measuring and screening operations. Typical applications of this kind are: • Checking the shape of injection molded parts. • Verifying correct positioning of components. Mark Inspection / Print Quality Inspection Mark or print quality inspection is often concerned with characters, but it does not aim at reading them. Instead the correspondence of the characters (or logos or any other kind of print) to an ideal template is inspected. After carefully positioning the template in accordance with the content of the current image a difference image is obtained, which can be evaluated subsequently using all the functions within NeuroCheck. This means you are not restricted to a small set of functions or even a single unflexible method of inspecting the quality of a print. In the integrated architecture of the software with its consistent object orientation every function supports all the others so that you can use the full power and flexibility of the object evaluation and presence verification capabilities of NeuroCheck for print quality inspection. This functionality can of course be used equally well in any application where the correspondence of the current image to a reference has to be checked. Typical applications of print quality inspection can be found in: • Food and beverage industry, where the print quality of a package or a label may have significant impact on consumer behavior. • Pharmaceutical industry, where besides its significance for the corporate image the print on a package may be of cricital importance. • Chip industry, where the print on an IC casing may be important for the applicability and quality of the component as well as for production surveillance. • Car industry, where legislation requires the readability of certain labels and marks on engine and chassis. Optical Character and Pattern Recognition Pattern recognition denotes the identification of arbitrary patterns using measurements as well as their overall appearance. It is often used as a tool for presence verification to distinguish between valid and invalid objects. By using neural networks NeuroCheck achieves a high degree of recognition certainty even for Chapter 3 Overview 31 patterns of poor quality. By compiling an individual set of training patterns, you can adapt NeuroCheck to arbitrary pattern sets, including everything from individually shaped technical components to arbitrary character sets and special fonts with company logos etc. Examples for pattern recognition: • Check light sensitivity codes on film rolls. • Distinguis screw heads or any kinds of object having nearly identical dimensions but differ in their optical appearance. • Identify special logos. • Distinguish between a component and its place of assembly. Both are often of identical size and shape and sometimes even similar brightness so that only the comparison of the overall appearance allows to decide, whether the component is present. The example shows the identification of light sensitivity codes on filmrolls also contained in the application database. Optical character recognition is a very common special case of pattern recognition and one of the most demanding tasks in digital image processing. Examples for the application of optical character recognition: • Identify markings on ICs. • Check pull dates on food or medicine packages. • Sort according to charge numbers. • Recognize parts by model numbers. The following example shows an airbag controller IC. For security reasons all characters on each chip have to compared to the required type signature. Chapter 3 Overview 32 NeuroCheck’s integrated architecture lets you exploit its full flexibility in this area, too. A few options: • Any number of inspection windows can be treated individually. You can compare one line of characters with a predefined string to check the type of a part, while simultaneously reading a serial number from another line, reporting it to PLC or a master control computer. At the same time you can perform a pattern recognition of completely different kind in another inspection window, e.g. to distinguish between types of screws or rivets. • Inspection windows of arbitrary shape can be transformed into a line, enabling NeuroCheck to read inscriptions along a circle or even along an object contour. • For each group of characters, e.g. each line, a separate classifier can be used. If one line contains only numbers, the other only a subset of letters, two specialized classifiers can achieve a higher recognition certainty. The classifiers can also be smaller, thereby reducing computation time. • Uncertain recognition can be rejected according to an adjustable threshold. • Result values can be transmitted to a PLC or master computer or via OLE to another application. This enables individual checking of each work piece, e.g. for serial numbers or time stamps. • The training pattern sets can be continuously supplemented with new patterns to adjust to changes in the production process (e.g. due to wear of printing equipment). Gauging You can use NeuroCheck to check every aspect of the geometry of a work piece, e.g. distances between objects, angles between edges, parallelism, concentricity... Special subpixel algorithms yield precision better than one image pixel (depending on the quality of lighting and image capturing equipment a field-precision of 1/10 pixel can reliably be achieved). Chapter 3 Overview 33 Applications of gauging are: • Check rows of connector pins for parallelism. • Check position of IC pins. • Check orientation of SMD pins. • Check position and orientation of labels and inscriptions. • Check assembly precision of complex work pieces. • Check concentricity of coaxial connectors. Again NeuroCheck offers a wide range of options: • Measurements can be calibrated to metric or imperial units. • Tolerances can be set individually for each measurement. • Model geometries can be computed for whole groups of objects, e.g. to fit a straight line to a row of IC pins or a circle to markings on a dial. These model geometries can be measured like normal objects. Measurements can also be taken between real objects and model geometries. • In addition to usual measurements like angles and distances NeuroCheck offers a wide variety of special measuring rules, like straightness of edges, parallelism of straight lines, concentricity and roundness of circles. • Measurements can be transmitted via serial interface to a PLC, e.g. to use the absolute position of an object for direct control of industrial robots. The examle shows an assembly inspection of a filter sieve on a sight-feed nozzle. Robot Guidance The term “Robot guidance” summarizes all applications in which an image processing system is used to determine the position and orientation of an object and outputs this position in order to enable another machine to handle the object. A robot gripper can thus be enabled to grab work pieces from a conveyor belt. Another Chapter 3 Overview 34 application is palletizing or depalletizing of crates containing assembly parts, packages or bottles. Basic Structure of NeuroCheck Applications This sections explains some basics of the structure of visual inspections in NeuroCheck . Check Routine The check routine is the fundamental element in NeuroCheck, comparable to the text document in a word processor. It comprises all steps necessary for the complete visual inspection of one work piece. Usually a check routine consists of several individual checks inspecting different areas of the work piece or performing different types of inspections. The final result of a check routine, i.e. the statement, whether the work piece is good or faulty, is derived from the results of the individual checks. These individual results can be logically combined using conditional branching. Individual Check Individual checks (or simply: checks) inspect different aspects of a work piece. A check might measure a bore hole, verify the presence of a component or read a line of characters. After all checks for a work piece have been carried out, their results are combined to the final result of the check routine. The checks are independent from each other, they do not exchange data. Usually checks are executed in the order in which they appear in the check routine. However, it is also possible to execute a check depending on the result of some other check, i.e. the “O.K.” or “not O.K.” result of a check can be used to decide, which check to perform next. This makes it possible to do type-dependent checks or to use different inspection methods on the same work piece: first a simple, fast method is performed; only if this method fails, a more sophisticated check is executed, in order to achieve a net gain of execution time. Start and End Actions Start and end actions are special types of individual checks which can be included at the beginning or the end of a check routine. The start actions are always executed before all other checks and can be used for example to quickly capture several images and store them on the image tray to be processed later, when the test piece may already be on its way out of the inspection station. The main purpose of the end actions is to synchronize NeuroCheck with the manufacturing process after completion of all individual checks, e.g. by exchanging specific digital signals. Chapter 3 Overview 35 Check Function Check functions are image processing, communication or system functions that can be inserted into a check to fulfill specific task. NeuroCheck provides check functions for various tasks, like filtering entire images, searching and measuring individual objects, reading from or writing to digital I/O connectors etc. The check functions of a check are executed in a predefined sequence. They exchange data via a data pool. Usually a check function gets its input data from the preceding function, but this assignment can be changed manually. The parameters of every check function can be set individually in a parameter dialog, giving extensive visual assistance to the user. Modes of Operation This section explains the different modes of operation in NeuroCheck. Manual Mode Upon start-up NeuroCheck enters manual mode, where you can construct and test check routines. Chapter “Creating a new Check Routine” gives an introduction to the process of building a check routine in manual mode. Live Image Mode “Live image mode” is entered by choosing “Live Image” from the “Operating Modes” menu. In this mode the complete NeuroCheck window is used to display the live camera image with adjustable zoom levels for easy focusing. Automatic Mode The menu item “Operating Modes/Automatic” and the corresponding icon switch to automatic mode. The check routine is then executed automatically allowing for external control by a PLC or a master computer or by OLE automation. Options for automatic mode include: • Start of check by keystroke, timer or external signal. • Check routine switching upon external signal. • Display of adjustment dialog for adjusting camera positions upon external signal. • Report of check result to PLC or master computer. Communication with PLC and master computer can be carried out via digital I/O or serial interface. Those options for automatic mode concerning the basic setup of the production process are global to NeuroCheck, i.e. they are valid for all check routines, because Chapter 3 Overview 36 this setup will change rarely. They are set in the “Remote Control” dialog box displayed upon choosing“Remote Control” from the “System” menu. Another set of options, e.g. the result value output settings, are private to the check routine. Automatic Screen Configuration The menu item “Operating Modes/Configure Automatic Screen” and the icon on the left allow the configuration of the screen display in automatic mode. This configuration is private to the check routine, because it allows windows to be connected to individual check functions for result output. Screen configuration therefore depends on the check functions present in the check routine. User Interface The user interface has been designed with two goals in mind: making the use of digital image processing as easy as possible while giving the experienced user full access to all features. These goals have been achieved by a highly automated configuration system reducing the amount of user intervention necessary, and simplifying the inevitable user interaction by intuitive control elements. “Short Ways” The NeuroCheck user interface adheres closely to the standard set by Windows 9x / NT , supporting e.g. use of the right mouse button, in-place editing and graphical sliders for parameter adjustment. Right mouse button The first and foremost principle in using NeuroCheck is: use the right mouse button anytime and anywhere. All settings for items in NeuroCheck can be reached from the context-sensitive menus opened by clicking the right mouse button, e.g.: • Descriptive texts and communication settings for check routines: right mouse click on the check routine name in the check routine window. • Editing individual checks: click the name of the check. • Adding, deleting and configuring check functions: click the function name. • Graphical parameter settings in dialog boxes: click the graphics panel. Just try what the right mouse button has to offer. It always leads to a context-sensitive menu, never actuates a function, so no harm can be done. Alternative control elements In most cases there are several ways leading to a certain functionality. For example, in the “Device Manager” dialog box, properties for the devices can be set by Chapter 3 Overview 37 choosing the “Properties” button or from the context menu of the device. The same holds for the check function parameter dialogs: standard control elements like list boxes, edit boxes etc. give immediate access to the settings for the active region of interest, whereas the right mouse button opens the context menu for any region. “In-place editing” Changing the name of a check in the edit view or the name of a camera in the “Device Manager” is another example of short ways in NeuroCheck. When the class name has been selected by clicking it once with the left mouse button, simply click it again and you can edit it like a file name in the Windows Explorer. Instead of the general function name "Capture image" you will then, for example, see "Capture image from camera on the right", telling you immediately the purpose of the function in the current context. This does greatly enhance clarity especially in complicated inspection applications. Parameter Sliders Wherever appropriate, parameters of image processing functions can be adjusted by sliders. This gives you an immediate overview of the current settings without having to actually read each setting as a numerical value, thus aiding intuitive access. The exact values are, of course, displayed for the experienced user. Context Sensitivity You do not need to think about whether a check function can be used at a certain point, NeuroCheck indicates functions that cannot be inserted into a check routine at the current step by a red icon and gives a hint as to why the function cannot be used at the moment. Check functions are automatically connected according to the results already available; this guarantees consistent data structures. Many times preset parameters giving good results for a wide range of applications eliminate the need for manual configuration. Online Help No user interface can give the answer to all questions. Especially for a highly specialized field like digital image processing, extensive documentation is indispensable. NeuroCheck spares you the trouble of searching voluminous manuals by providing an online help system giving access to the right information at the right time. Types of help information NeuroCheck offers different types of information: • Basic explanations of the NeuroCheck concepts and the data types used. • Detailed examples for creating check routines. • Complete menu reference. Chapter 3 Overview 38 • Extensive description of each function, explaining all parameters. • Short hints to every single control element. • Explanations of terms specific to digital image processing. Access to online help NeuroCheck provides several ways to access the online help system: • The menu item “?/Help Topics” leads to the hierarchical table of contents and the hierarchical index. From there you can reach all the basic information in the function and menu reference sections. • You can browse each chapter of the online help system like a book using the and buttons. Overview pages build a second structural layer above the reference information to aid you in quickly reaching the required information. • Pressing the ‘F1’ key opens context sensitive help for each menu item and the active control element of a dialog box. • Clicking first the context-sensitive help symbol , then any element of the user interface provides help on the respective element. The probably most important way of getting help, though, is provided by the help button on the right of the title bar of dialog boxes. Clicking this button first, any control element inside the dialog box next, opens a popup window explaining the respective parameter, so you do not need to read the whole function description again to find the meaning of this element. Sample Files If a complete setup was performed, the ‘EXAMPLES’ directory below the installation directory contains sample files of the following types: • BMP: bitmap images of work pieces to be inspected. • CHR: check routines. • TD: training data for classifiers. • CLA: classifiers • CSU: camera setup files, which can be imported into the “Device Manager” to set the properties of camera inputs on PCI frame grabbers. Besides giving you an idea of NeuroCheck’s abilities, you will certainly gain valuable hints from these sample files. In addition to a general demonstration check routine, all tutorial examples from the online help system are included (indicated by names starting with ‘TUTO_:’). 39 CHAPTER 4 Creating a New Check Routine This chapter explains how to solve a visual inspection problem using NeuroCheck. The example is also included as the first tutorial in the online help system. If you installed the sample files with NeuroCheck, you will find the complete check routine as ‘TUTO_1.CHR’ in the ‘EXAMPLES’ directory below the installation directory. Inspection Task Below you see a sub-D connector from a computer cable. The inspection task is to determine, whether all nine pins are present. A check routine comprises the complete solution of a visual inspection task. The check routine can consist of several individual checks, inspecting different aspects of a work piece. In this case only one aspect has to be checked, therefore the check routine will contain only one check. Since checks are independent of each other, more complex tasks can be solved step by step using the approach described here. Creating the Check Routine If you have just started NeuroCheck for the first time, the program is already waiting for a check routine to be created. If a check routine has already been created, the first step is to create a new one by clicking the icon depicted on the left or choosing ‘New’ from the ‘Check Routine’ menu. The edit tab forming the left part of the NeuroCheck window will now contain a single line to the effect that you have just created an empty check routine. Clicking the plus icon in front of this line expands the check routine properties, as in the following image: Chapter 4 Creating a New Check Routine 40 Check Routine Description First you should enter a description for the check routine in order to properly identify it later. Click the first line, which appears in blue and reads “Check routine ...(empty)” with the left mouse button. A cursor appears, allowing you to enter a new name for the check routine. According to the task at hand, you could name it “Connector inspection”. Confirm with the “Return” key. Then click the second line, saying “Description” with the left mouse button once, so that it appears selected. Then click it again and change the description string to “Verify presence of pins”. Proceed in the same way to enter your name in the third line. The lightning icon in the fourth line symbolizes the identification number used to switch check routines in automatic mode and will not be used in this tutorial. Now the edit tab should look as follows (substituting your name in the third line): Saving the Check Routine Before you start working on the inspection task, you should save what has been created so far. From the ‘Check Routine’ menu choose ‘Save’ or click the depicted icon. The familiar Windows file selection dialog appears. Enter a name for the check routine, e.g. “Example 1”. You do not need to enter a file extension, this is done by NeuroCheck. Confirm with “OK”. You will now see the file name appearing in the title bar of the NeuroCheck window. Now click the first line using the right mouse button and choose ‘Properties’ from the context menu: Chapter 4 Creating a New Check Routine 41 The following dialog box will appear, displaying the properties just entered and the date and time when the check routine has been last saved.: You can of course also use this dialog box directly to change these properties, if you do not prefer the in-place editing demonstrated before. Creating a Check As mentioned before, a check routine is made up of individual checks, performed independently of each other. A first check is automatically created together with the new check routine. Additional checks can by created by choosing ‘New Check’ from the ‘Edit’ menu or from the context menu opened by clicking the background of the edit tab with the right mouse button. In the same way as for the check routine as a whole, you can enter a title and an additional description for the check in the same manner as before, i.e. by in-place editing or by choosing ‘Properties’ from the context menu opened by clicking the check title with the right mouse button. The texts entered in these two lines have a special significance. Over time you will repeatedly encounter inspection problems very similar to one you already solved. To relieve you from the need to enter all settings anew, NeuroCheck provides a way to import a complete check from another check routine. The selection dialog displays the description entered here together with the additional explanations. Assigning meaningful names here will simplify finding the appropriate check later. Chapter 4 Creating a New Check Routine 42 Image Acquisition Up to now the whole check routine consists of framework only, it does not do anything useful. All the work in a check routine is done by check functions, therefore it is time to add the first check function. And the first task to be fulfilled is to provide the check with an image to be inspected. Usually this image will be captured by a frame grabber from a camera and transferred to the PC’s main memory. The two functions of capturing and transferring an image are separated for several reasons. One reason is that this division of labor enables NeuroCheck to work without a frame grabber and a camera by reading sections from image files. On the other hand, special properties of certain frame grabbers can be more fully utilized. Capturing the Image Usually, the first step in image acquisition is to capture the image. We will skip this step, so that you can follow the example without the need for a camera, frame grabber or check piece. Transferring the Image The first check function to be added to the check is therefore function “Transfer image”. Choose ‘New Append Check Function’ from the ‘Edit’ menu or the context menu opened by clicking the title of the check with the right mouse button as in the following image. Alternatively you can click the icon on the left. All this will have the same result: the dialog box for check function selection is displayed. The dialog box contains a separate property page for every function category in NeuroCheck. You will find the functions for image acquisition on the page with the camera icon on its tab. The right portion of the dialog box gives information on the function category, the purpose of the function currently selected and useful hints. Chapter 4 Creating a New Check Routine 43 Select function “Transfer image” and confirm with OK. Your check will now look like this: Setting Parameters Now you have to tell NeuroCheck what image to use. This means you have to set parameters for the function “Transfer image” using one of the following three methods: If the function is highlighted like in the screen shot above, you can choose the menu item ‘Check Function/Parameters’ or the icon on the left. The second method is to click the name of the function with the right mouse button and choose ‘Parameters...’ from the context menu. The third method is a double click on the function name in the edit tab. Parameters for the Image Transfer If you do not have a frame grabber installed, NeuroCheck might display an error message, asking if the parameters are to be reset to default values. Simply choose “Yes” in that case. Chapter 4 Creating a New Check Routine 44 Now the following dialog box appears, except that it does not display an image yet: Select the radio button labeled “Bitmap file”, then the “Browse” button. In the Windows file selection dialog select the file ‘TUTO_1.BMP’ from the ‘EXAMPLES’ directory below the installation directory. Confirm your selection with “OK”. The blue frame indicates the image section actually read. It can be moved by dragging it while holding the left mouse button down. Dragging one of the marks on the edges changes the size of the frame. Adjust the frame approximately as displayed in the image and leave the dialog box with “OK”. Executing the Image Transfer You can run the check routine up to this point by selecting the function “Transfer image” with a mouse click and choosing the menu item ‘Check Function/Execute’ or the icon on the left. You can also click the function name in the check routine window with the right mouse button and choose ‘Execute’ from the context menu. NeuroCheck then executes the check routine up to this point and displays the result in the right window pane, i.e. the section loaded from the image. The NeuroCheck window now should look approximately as in the following image: Chapter 4 Creating a New Check Routine 45 Now you should perhaps save the check routine again by choosing ‘Save’ from the ‘Check Routine’ menu or the icon on the left. The check routine is saved under the previously assigned file name. The menu item ‘Check Routine/Save As...’ allows you to save the check routine with a new file name. Image Preprocessing Function group “image preprocessing” contains all functions concerning the whole image, without regard to the objects within the scene. Most preprocessing functions serve to improve image quality. The image of the connector has very poor contrast, therefore we will now append a function for improving image contrast. There is now another method of appending a check function to the check: click the already existing check function “Transfer image” with the right mouse button and choose ‘Append Check Function’ from the context menu. In the “Select New Check Function” dialog box switch to the tab page marked with the preprocessing function icon and the words “Gray level”. Select the function “Enhance image” and confirm with OK. Chapter 4 Creating a New Check Routine 46 Unavailable Functions From time to time you will notice functions in the “Select New Check Function” dialog box marked with the red icon depicted on the left. These functions cannot be appended or inserted into the check in its current state. If you select such a function, the “Hint” area of the dialog box will show an explanation, why the function cannot be used at the moment. For example, function “Combine images” is not available at present, because it requires two images to be in memory. Parameters of “Enhance Image” Now open the function’s parameter dialog like before. You can leave most parameters at their default settings, only the size of the subimages should be adjusted. The function can be used to enhance the image locally, compensating for uneven illumination, but the image of the connector is of a very evenly poor quality. Clicking the “Full image” button will set the subimage size to the size of the complete image. Thus the contrast enhancement will be done evenly for the whole image. If you run the check routine up to this point, you will see that the pins are now much easier to recognize. Defining Regions of Interest The connector pins are objects within the image. All functions dealing with objects belong to the“Image analysis” categories and require a “region of interest”. Therefore, the only function from this group available at the moment is “Define ROIs”. You will find this function on the tab page marked by the object icon on the left and the word “Creation”, because it creates a region of interest. Chapter 4 Creating a New Check Routine 47 Now you can declare the complete image as a region of interest. Open the parameter dialog for the function “Define ROIs” and select the button labeled “Rectangle”. In the graphics panel on the left draw a rectangle by dragging the mouse with the left mouse button pressed. Click the “Select” button on the right and then click the rectangle using the right mouse button. From the context menu choose “Full image”. The region of interest will then comprise the complete image section read into memory. Chapter 4 Creating a New Check Routine 48 Using Online Help Everywhere inside NeuroCheck there are various ways to access helpful information. You can always reach the table of contents and the search index by choosing ‘Help Topics’ from the ‘?’ menu, but in many cases more direct ways to the required information are provided. Function Descriptions If the function appears highlighted in the edit tab, choosing the menu item ‘Check Function/Info’ will open a help window with a full description of the function explaining all its parameters. The same explanation is displayed when you click the function inside the edit tab with the right mouse button and choose the menu item ‘Info’ from the context menu. A third way to this particular help page is the “Help” button in the “Select New Check Function” dialog box. Help on Individual Parameters You will not always want to read the complete function description, e.g. if you are adjusting function parameters and only need some hint on the meaning of a single parameter. You will get more direct information by clicking the question mark on the right of the title bar of the parameter dialog. The mouse pointer changes into a context-sensitive help cursor. Use it to click the control element in question. A small popup window with a short explanation of the control element will appear. Help on Graphics Panels You can also click graphics panels in parameter dialog boxes, like the panel for defining regions of interest, with the context-sensitive help cursor. A standard help window will appear, displaying either the complete function description or a special explanation for this graphics panel. Determining a Threshold The connector pins can be easily distinguished from the background by their brightness. A simple thresholding operation will suffice. First append the function “Determine threshold” to the check. Because this function is a prerequisite to creating regions of interest by a thresholding operation it is found again on the “Creation” page in the“Select New Check Function” dialog box. Open the parameter dialog and leave all parameters on their default values except the result image brightness right on top. This should be set to about 80, because otherwise a lot of dark artefacts appear in the thresholded image. Chapter 4 Creating a New Check Routine 49 Executing the function removes all gray shades from the image, leaving only black and white areas. Display Options A closer look at the right window pane of the NeuroCheck window will reveal a double frame on top. If you drag the lower frame downward, holding down the left mouse button, you will see a histogram of the image in the upper pane, the thresholded black and white image in the lower pane. But function “Determine threshold” offers even more display options. There are several control elements on the top border of each pane, from which you can select the display option to be presented in the corresponding pane and the zoom level. From the leftmost combo box of the upper pane select “Source image”. Now the NeuroCheck window should appear as in the following image, allowing you to compare the original (contrastenhanced) gray level image to the thresholded binary image. Chapter 4 Creating a New Check Routine 50 . In addition to these options each pane has a context menu opened by clicking the right mouse button within this pane. From this menu you can transfer the image displayed in the respective pane to the Windows clipboard, from where you can paste it to any Windows application, e.g. to document your check routine. Searching for the Plug The connector pins are clearly separated from the background in the thresholded image. It is recommendable, though, to search for the dark area around the pins first. This ensures a stable detection, if the position of the connector inside the image varies. Append the function “Create ROIs by thresholding” to your check routine (again found on the “Creation” page in the “Select New Check Function” dialog box; note how the number of functions with the icon diminishes as more and more functions are added to the check, because more and more of the required data objects are available) and open its parameter dialog. Set the options as in the following image in order to create the largest dark object. You can do so by clicking the graphics panel with the right mouse button and choose ‘Object Selection Largest Object’ from the context menu or by using the list boxes on the right of the dialog box. Chapter 4 Creating a New Check Routine 51 Leave the parameter dialog with “OK” and execute the function. NeuroCheck now finds the largest dark object present, the plug (if another object is found here, you may have to change the settings in function “Determine threshold”; for performance reasons, size is defined here in terms of perimeter, not area; the borders of image degradations are notoriously ragged, therefore they may have large perimeters, as can be seen on the bottom border of the plug. Changing the thresholding parameters as mentioned above will lift these degradations above the threshold so that they do not appear as dark objects in the binary image.). Searching for the Pins Objects as Regions Of Interest Now you will get to know one of the most important features of NeuroCheck, which is the basis of its flexibility. Any object found or computed by NeuroCheck immediately forms a new region of interest. Here NeuroCheck can use the dark plug as the region, in which to search for the connector pins. This linkage of one function’s output to the next function’s input is done automatically, you only have to tell NeuroCheck that you want to search for light objects next. Append the function “Create ROIs by thresholding” to the check routine once more. Function Names Now you have two functions “Create ROIs by thresholding” in succession. To avoid confusion you may want to rename one or both. For example, select the first one by a Chapter 4 Creating a New Check Routine 52 single left mouse click and enter the in-place editing mode by another left mouse click (do not click too fast, or Windows will consider this a double-click and open the parameter dialog). Type “Search for plug” and confirm with Return. Proceed in the same way with the second one, this time typing “Search for pins”. Now your edit tab should look as in the following image: You can reset the names to the original function designations at any time by choosing ‘Reset Description’ from the ‘Check Function’ menu or the context menu of the respective check function. Search Parameters Now some parameters have to be set for the second search function. Open the parameter dialog of the most recently appended function “Create ROIs by thresholding”, now named “Search for pins”. Set the 'Object color' list box to ‘Light’ (by the way: you can also set these options from a context menu in the graphics panel of the functions, which is very convenient if you have several regions of interest, for which you want to enter different parameters). Finally choose ‘Parameters... ’ from the context menu in the graphics panel or click the ‘Options’ button. In the “Search Parameters” dialog box set the distance of search rays to 1. The pins are rather small objects, and because of the slight horizontal slant of the connector in the image, NeuroCheck might miss some of them, if the search rays are spread farther apart. Chapter 4 Creating a New Check Routine 53 Running the check routine up to this point separates all nine pins as individual objects from the background. Now their number has to be checked to complete the solution of this inspection task. Check Number of Pins Append the function “Count ROIs” to the check routine. You will find this function on the “Evaluation” page of the “Select New Check Function” dialog box, because it is one of the functions for evaluating the compliance of an existing object configuration with prescribed values. Accordingly this function has a target value dialog instead of a parameter dialog (though there are functions having both). Open the target value dialog by double-clicking the function or by clicking the icon on the left or by choosing ‘Target Values’ from the ‘Check Function’ menu or the context menu. Activate the “Verify” check box (the function can be used simply to count objects, without deciding, whether the number is correct or not). Enter “9” for the minimum as well as for the maximum value, because there have to be exactly nine pins present. Confirm with “OK” and execute the check routine. NeuroCheck informs you that the work piece is ‘OK’, since it contains the required number of objects. The screen shot below shows the default display appearing automatically, if the right window pane was horizontally divided, as explained above in section “Determining a Threshold”. Chapter 4 Creating a New Check Routine 54 With this final step the inspection task has been solved. Again, you should save the check routine. Automatic Execution Switching to Automatic Mode Immediately after saving the completed check routine you can have it executed automatically. On the other hand, this means that you can reconfigure an automated visual inspection anytime, having all the features of the manual mode user interface at your command. Choose the menu item ‘Operation Modes/Automatic’ or click the depicted icon in the mode bar to switch to automatic mode. Triggering the Check Routine After switching to automatic mode, NeuroCheck’s default behavior after installation is to wait for the ENTER key to trigger the check routine. In a real application integrated into an automatic production process, triggering would usually be done by an external signal, i.e. via digital inputs or serial interface. These options are set in the “Remote Control” dialog box, opened from the menu item ‘System/Remote Control’. Chapter 4 Creating a New Check Routine 55 These settings influence the system as a whole and should never be changed while a check routine is running. Automatic Mode Screen After switching to automatic mode, NeuroCheck displays a default screen layout. Upon pressing the ENTER key NeuroCheck executes the check routine once and displays some information in the windows on the automatic mode screen. The rightmost window in this standard automatic screen layout is a check function visualization window. It is empty, because NeuroCheck does not yet know which check function’s output should be displayed in the window. Choosing the menu item ‘Operating Modes/Configure Automatic Screen’ or the corresponding icon switches to the definition for the layout of the automatic mode display. Here you can add, resize or delete windows on the automatic screen and set window properties. Click the Check function window with the right mouse button and choose ‘Parameters’ from the context menu. In the parameter dialog box first select function ‘Count ROIs’ in the tree view on the left, then ‘region(s) of interest’ from the ‘Result’ list box on the right and finally ‘50%’ from the ‘Zoom’ box. Now click the depicted icon on the screen configuration toolbar and draw a new window on the screen (the window needs to have a certain minimum size). Alternatively you can select ‘Check function visualization’ from the dialog box, which will appear upon choosing ‘New Automatic Mode Output Window’ from the ‘Edit’ menu. In that case the window will be created with a default size. Again click the window with the right mouse button and choose ‘Parameters’. Select ‘Count ROIs’ from the tree view and ‘Result’ from the list box. Save your check routine, return to automatic mode and press the ENTER key. NeuroCheck will execute the check routine once more and display the result table and result image of function ‘Count ROIs’ in the two check function windows. Chapter 4 Creating a New Check Routine 56 End Automatic Mode Automatic mode is ended by choosing ‘Manual’ (or any other mode) from the ‘Operating Modes’ menu. Check Routine Wizard To relieve you from entering the basic structure of a check routine step by step every time, NeuroCheck provides a check routine wizard. The wizard asks you a few questions and creates a basic sequence of check functions according to your answers. You find it in the ‘Check Routine’ menu or by clicking the icon on the left Index 57 Index 3 D 32-bit application 5 DataMatrix 4 DataMatrix code identification See Application, DataMatrix identification Demo 22, 38 Digital I/O board 8, 23 A Application bar code identification 28 DataMatrix code identification 28 gauging 32, 33 object comparison 30 optical character recognition 31 pattern recognition 30 presence verification 28 robot guidance 33 B Bar code identification See Application, bar code identification E End actions 34 Extensibility 3 F Frame grabber 23, 42, 43 Frame grabber board 15 Full frame processing 5 G C Camera 2, 8, 15, 35, 42 Character Recognition See Application, optical character recognition Check function 35, 36, 37, 42, 43, 44, 45, 46, 48, 56 Check routine 6, 7, 23, 29, 34, 35, 36, 37, 38, 39, 40, 41, 44, 45, 46, 50, 51, 53, 54, 55, 56 Classifier 32, 38 Clipboard 9, 27, 50 Color processing 12 Context-sensitive menu 9, 36, 50, 52 Gauging See Application, gauging Group 10, 32, 33 H Help 9, 18, 37, 38, 39, 48 context-sensitive 38, 48 Index file 13 screen 13 serial interface 14 I Image acquisition 42 Image analysis 10, 46 Image preprocessing 45 Image processing board 2 Image quality 45 Individual check 7, 34, 36, 39 Inspection window 29, 32 Installation components 18 directory 17 previous 17 readme file 21 58 P Password 6 Pattern recognition See Application, pattern recognition PLC 15, 32, 33, 35 Positioning See also Application, robot guidance Presence Verification See Application, presence verification Print quality inspection See Application, object comparison M Mark inspection See Application, object comparison Master control computer 15, 32, 35 Measurements 13, 29, 33 Measuring 33, 35 See also Application, gauging Modes of operation 35 automatic mode 35, 54, 56 automatic screen configuration 36, 55 live image mode 35 manual mode 35 Q Quality management 13, 27, 28 R Region of interest 10, 46, 47, 48, 51 Remote control 12, 54 Robot guidance See Application, robot guidance Multitasking 6 S N Neural network 29, 30 O Object comparison See Application, object comparison OLE 3 Operating system 15 Optical Character Recognition See Application, optical character recognition Output Custom communication 14 Sample files 15, 18, 23, 38, 39 Security key 15, 16, 22, 23 Serial interface 14, 15, 23, 27, 33, 35, 54 Setup 16, 17, 19, 21 Start actions 34 Start Menu 19, 21, 22 System requirements 15 T Test program 4 Index U Uninstall 26 59