Home

ActivView User's Manual

image

Contents

1. OOG ActivView 2008 04 23 At the left side of AVTViewStatus an icon indicates the current execution mode of the application In the mode oft the application does not perform any processing and waits for your interaction If you start the continuous mode the cogwheels rotate any interaction on your part is stored in the event queue and processed after the current cycle is finished If the cursor gets busy ActivVisionTools has started a particularly time consuming operation e g connecting to an image acquisition device Any interaction on your part is then deferred to the end of this operation In the next field AVTViewStatus shows the number of processed cycles Next to it AVITViewStatus shows the time needed for the last processing cycle You can change this to the number of processing cycles per second via a property Open AVTViewProperties by clicking on AVTView with the right mouse button and selecting Properties in the appearing context menu Then select the properties of AVTView Status Beside the mode of displaying processing time or speed the properties also allow to modify which of the fields described above are shown To the right AVIViewStatus displays ActivVisionTools messages There are two types of messages Informative messages describe what the application is doing while it is busy e g connecting to an image acquisition device or warn you if the image pro cessing failed e g why a
2. Histogram a 2083 7 o 3 0 64 128 192 255 Gray Values Pixel Number Min Max Peak Absolute Relative Rol 0 206 0 Inside l 581 3 90 Selection 128 139 Outside 14299 J 96 10 Display Inside g Peak J 2083 J 14 00 Figure 4 2 Histograms of well balanced over saturated and under saturated images If you are grabbing from a camera please experiment with different apertures and illuminations If your camera provides features like an automatic gain or automatic iris please switch them off in order to get repeatable settings Furthermore switch off any on camera gamma correction because it reduces the accuracies when using ActivMeasure or ActivFeatureCalc ActivVisionTools 3 2 Your Fast Track to Solutions 44 Tips amp Tricks 4 1 3 Analyzing Sharpness Using 4 The sharpness of an image can be estimated from looking at image edges i e discontinuities in gray values In a sharp image the gray values change abruptly at an edge This can be analyzed easily using AVTLineProfile Rane Preparation for the following example Example Please continue with the previous example Execute the application and load the image sequence misc sharpness1 seq Place an ROI across the characters as shown in figure 4 3 The following steps are visualized in figure 4 3 not shown AVTHistogram O In the sharp image gray values change abruptly at edges the gray value profile shows stee
3. Preparation for the following example Example You can use an arbitrary ActivVisionTools project Execute the application open AVTViewFG via the context menu of AVTView and connect to your image acquisition device The following steps are visualized in figure A 1 D To open AVTViewFGParameter click the button More Parameters in AVTViewFG Q If you have already connected to your image acquisition device signaled by the check box v Connected which can be used to disconnect and connect again information about the underlying HALCON image acquisition interface see section 1 3 1 on page 8 is displayed in the text box Interface DLL For certain image acquisition interfaces the parameters may be classified by Category and by Visibility Selecting different categories from these combo boxes confines the selection of parameters displayed in the frame Acquisition Interface Parameters If no classification is available the combo boxes are grayed out and all available param eters are displayed 4 The parameters can be edited in the frame Acquisition Interface Parameters Depending on the parameter type additional elements are added e g a slider for integer parameters or an editable combo box for strings For some parameters an additional check box appears via which you can select the value auto Action parameters those commencing with do appear as buttons We continue with the e
4. With Activ View you can input images both from image acquisition devices and from files Up to now interfaces to about 50 image acquisition devices are integrated in ActivView With the help of these interfaces you can grab an image within a few mouse clicks If supported by the image acquisition device itself you can easily couple the grabbing of an image to an external trigger signal Images can also be read from files in various formats see section 2 2 on page 18 for a complete list Furthermore you can create and read sequences of images Activ View will automatically send acquired images to all connected ActivVisionTools you do not need to write a single line of code Regions of Interest ROIs In order to speed up image processing it is useful to restrict it to so called regions of interest ROIs in the image With Activ View you can specify such ROIs for each subsequent vision tool and primary vision tool interactively You select the tool choose a shape ellipse rectangle etc and place the ROI with the mouse on the image ActivView will then automatically send only the corresponding part of the acquired images to the selected ActivVisionTool It is possible to assign different ROIs to different ActivVisionTools furthermore you can create multiple ROIs for one tool Display of Images ROIs and Results Activ View provides a central display for the visualization of images ROIs and results All connected ActivVi
5. execute all tools 6 AVTViewStatus displays error messages on the current image and the currently loaded image file Figure 2 1 Loading images from files We recommend to adapt the size of the display to the size of the image as described in sec tion 2 3 on page 20 ActivVisionTools 3 2 Your Fast Track to Solutions 18 Using ActivView 2 2 Grabbing Images Using M Besides image input from files AVTViewFG provides interfaces to more than 50 image acquisi tion devices see section A 1 on page 53 for a complete list Before accessing an image acqui sition device from within Activ VisionTools we recommend to check that it s working correctly Suitable test programs should be provided by the manufacturer of the device Visual Basic Preparation for the following example Example If you worked on the previous example you may continue using this project Otherwise open the project framegrabber view_framegrabber vbp or create a new project and place AVTView AVITViewFG and AVIViewStatus on the form by double clicking the icons Ci SA and Ai respectively with the left mouse button Execute the application Run gt Start or via the corresponding button The following steps are visualized in figure 2 2 ActivView 2008 04 23 Click Detect to update the list of available image acquisition devices Select your image acquisition devic
6. gt J Locked lt x hecksurr F Composite Detect r Result Options Display Results M dode V Code I Elements IV Fosition I Region I Candidates edit the ROI by dragging the pick points D lock the selected ROI copy paste and delete selected or all ROIs step through the ROIs of the tool Figure 3 1 Creating and editing regions of interest To create another ROI repeat step GB You can also copy paste and delete the selected ROI or delete all ROIs D By checking v Locked you can lock the selected ROI and thus prevent it from acci dental editing ROIs can be selected by clicking into the vicinity of its pick points in the image Al ternatively use the two arrow buttons 4 to step through all the ROIs of the selected tool To read the bar codes click Detect in AVTBarcode1D To visualize results check the boxes in the frame Display Results ActivVisionTools 3 2 Your Fast Track to Solutions 30 Combining ActivView with other ActivVisionTools 3 2 Displaying ROIs and Results Using li In the previous section you already got a glimpse of image processing results How results and ROIs are displayed can be adapted via AVTViewDisplayModes Visual Basic Preparation for the following example Example If you worked on the previous example you may continue using this project Otherwise open the project displaymo
7. limiting the remaining parameterization to the absolute necessary However Activ View cannot determine all parameters automatically especially if you are using a more complex image acquisition device with more capabilities To facilitate the remaining parameterization effort the following sections give a quick overview on how images get from the camera into Activ View describe the different types of images and take a look at the question when exactly an image is acquired 1 3 1 From the Camera into ActivView For the acquisition of images multiple components have to interact and cooperate see fig ure 1 3 A camera in many cases a frame grabber and the host computer or more exactly software running on it T The Camera Besides offering a different performance or functionality cameras may differ significantly re garding their output In the case of an analog output a small number of standards predominates e g NTSC or PAL Typical digital output standards are IEEE 1394 FireWire and Camer aLink with Gigabit Ethernet GigE in the coming 2 The Frame Grabber The main task of a frame grabber is to get the acquired images into the computer in a form which can be understood by the software Besides this a frame grabber can also be used to control the camera with possible activities ranging from starting the next grab to more complex ones like reconfiguring the camera to grab only a certain part of the image Most fram
8. which introduces the basic concepts of ActivVisionTools For each example in this manual there is a corresponding Visual Basic project these projects can be found in the subdirectory examples manuals activview of the ActivVisionTools base directory you selected during the installation default C Program Files MVTec ActivVisionTools Of course you can also create your own Visual Basic projects from scratch Note that the screenshots in the manual may differ slightly from the corresponding Visual Basic projects To follow the examples actively first install and configure ActivVisionTools as described in the manual Getting Started with Activ VisionTools We recommend to create a private copy of the example projects because by experimenting with the projects you also change their state which is then automatically stored in the so called description files extension dsc by ActivVisionTools Of course you can restore the state of a project by retrieving the corresponding description file from the CD _ Contents 1 About ActivView 1 LI Introducing ACHP VIEW oos cga o ee he eA ee ee Re 2 1 2 The Sub Tools of AchvView 2 ee A eb ee bee 4 1 3 A Closer Look at Image Acquisition 24 bee ee ee es 8 2 Using ActivView 15 21 Reading Images From Piles gt s lt s occ ee PR ee REE 16 2a Grabbing Images 2 o eca emi eea a a eee a ai ee 18 2 3 Inspecting and Modifying Properties of ActivVisionTools 20 24 Inspe
9. 2 lt Accessing Your Image Acquisition Device Company Type Family Name Universal interface for IDC 1394 compliant IEEE 1394a b FireWire cameras 13941IDC Universal DirectFile interface DirectFile Universal DirectShow interface DirectShow Universal interface for GigE Vision compliant cameras GigEVision Universal TWAIN interface TWAIN Virtual acquisition interface File interface File ABS UK1000 3000 cameras ABS Basler eXcite smart camera eXcite Basler GigE Vision and IEEE 1394 cameras via pylon library pylon Baumer FWX FWXC cameras BaumerFCAM BitFlow Raven RoadRunner R3 R64 and R64e BitFlow Daheng USB 2 0 cameras DahengCAM DALSA boards and Genie cameras via Sapera LT library SaperaLT Data Translation DT3152 DT3153 and DT3155 DT315x Data Translation DT3162 DT3162 dPict Imaging Aexeon and Nexeon dPict Eltec p3i2 p3i2 Eltec p3i4 p3i4 Euresys DOMINO GRABLINK PICOLO and QUICKPACK MultiCam IDS FALCON and EAGLE FALCON IDS uEye USB 2 0 cameras uEye Imagenation PX510 PX610 and PX610A PX Imagenation PXC200 and PXC200A PXC Imagenation PXD1000 PXD Imagenation PXR800 PXR Integral Technologies FlashBus MV FlashBusMV Integral Technologies FlashBus MX FlashBusMX Leutron PicPort PicPortPro PicProdigy and PicSight Leutron LinX Ginga Ginga LinX Ginga digital GingaDG LinX GINGA digital CL1le CL2e CL4e and G
10. DSC file of your application Instead of typing the name in each application you can also add it to list of combo box items by modifying the file AVTView nls which resides in the subdirectory nls of the folder where you installed ActivVisionTools see section A 4 on page 56 In this file add a line like for example AVTView FGSelection A File TWAIN MyDevice Instead of MyDevice insert the name of your HALCON image acquisition interface as you would specify it in a call to the HALCON operator open_framegrabber If the line already exists in the file modify it accordingly ActivView 2008 04 23 A 6 How to Access an Unsupported Image Acquisition Device 65 2 Content of AVTViewFG When an image acquisition device more exactly the corresponding HALCON image acquisition interface is selected in the combo box Name AVTViewFG adapts its lay out and the content of the combo boxes automatically to the device ActivVisionTools obtains the necessary information about the HALCON image acquisition interface by calling the HALCON operator info_framegrabber Thus to achieve that AVTView FG adapts itself to your image acquisition interface you must assure that your fimage acquisition interface returns the necessary information in info_framegrabber Table A 3 shows which query via info_framegrabber influences which element of AVTViewFG Note that if the call to info_framegrabber returns an empty list or an error the corresponding element
11. S all parameters are reset to their default values 2 2 Grabbing Images 19 detect and select image acquisition device 2 specify information about device 3 specify information about camera and image enable disable external trigger reset parameters connect to the image acquisition device errors are displayed here Getting Images From an Image Acquisition Device _ on Hep v Name Detect Refresh ee OO0F31 0000005619 Frame v Board 2 gt 2 lt default Full Size vj Size v CamType Gray 8 x Color Progressive v Field zo Soa J 2855 amp gt Be r Grabbing 5 ty Execute L Stp M Connected More Parameters l Save Image Save Window T grab single images or 7 save image or window to disk start stop continuous grabbing Figure 2 2 Grabbing images from a camera Connect to your image acquisition device by checking v Connected Depending on the device connecting may take some time In case of problems AVTViewStatus dis plays an error message for troubleshooting see section 4 2 on page 48 After connecting you can set additional parameters by clicking More Parameters see section A 5 on page 57 Grab single images by clicking Re execute the tools on the current image by Stop
12. bar code could not be read as in figure 3 3 In contrast error messages indicate errors that prevent the application from working correctly e g the failure to connect to an image acquisition device To display the history of messages double click into the message field If AVTViewStatus is not added to an application error messages are displayed in popup dialogs If an error occurs while the application is running continuously the dialog 3 3 Inspecting the Status of an Application 33 Inspecting the Status of an ActivVisionTools Application 0 x Code Type Code 39 hd iV Checksum I Composite Detect Result Options Display Results gt IV Code c Code T Elements IV Position Region Candidates x amp Status History 2 Region not found AVTBarcode1D 1 Loading file code39_01 AVTView 0 Region not found AVTBarcode1D 2 gt 2 lt ActivVisionT ool JAVTViewStatust Fi ShowE xecutionT ime True ShowNumCycles True ShowRunMode True al TimeDisplayMode x rime 1 Determines if the xecution time or the number of cycles per seconds displayed rfs 2 41 7 ms Region not found O current execution mode configure AVTViewStatus via properties number of executed cycles space for messages 3 processing time or speed open history by double clicking message field Activ isionTools Error x CE x Activ
13. blue parts the word BLUE All other colors can be created by mixing the three principal colors For example the color cyan is composed by adding green and blue in the example the word CYAN therefore appears both in the green and in the blue channel Please note that in the current version of Activ VisionTools color images are displayed including color but image proccessing is performed only on the red channel Via the programming interface however you can let the tools process on of the other channels instead see the Ad vanced User s Guide for Activ VisionTools section 3 4 2 1 on page 76 or section 3 6 1 3 on page 96 for examples _ 2 3 Frames vs Fields 4 Interlacing vs Progressive Scan relevant only for analog cameras A frame corresponds to one image out of a sequence of images In analog standards PAL and NTSC a frame is divided into two fields The even field contains all lines with even numbers 0 2 the odd field those with odd numbers 1 3 Instead of the frames only fields are grabbed and transmitted alternatingly and then merged interlaced to form a full frame again If a fast moving object is imaged interlacing leads to artefacts which degrade image quality significantly as shown in figure 1 4 Therefore the so called progressive scan mode is more appropriate Here frames are grabbed and transmitted without dividing them into fields Note that if a camera
14. from arbitrary sources First we describe the simplest way to integrate and process gray value images After this we briefly describe alternative methods Integrating Images With ExecuteExternImagePtr To feed your own gray value images to an ActivVisionTools application the control AVT View provides the method ExecuteExternImagePtr which is invoked within Visual Basic as follows Call AVTViewInstance ExecuteExternImagePtr pointer type width height copy Ue i ee name of the instance of pointer to the type of image image width Boolean stat the control AVTView image matrix e g byte and height in ing whether to e g AVTView1 pixels copy the data Some words about the parameters The parameter type specifies how a pixel is represented in memory for a standard 8 bit gray value image specify byte if more than 8 bits are used for each pixel specify uint2 With the parameter copy you can influence whether ActivVisionTools creates a copy of the image matrix or not Choosing True is the somewhat slower but definitively safer method By choosing False you can speed up the application a bit but now you must guarantee the validity of images i e you must guarantee that the memory area pointed to contains the image throughout its use within the ActivVisionTools application If you want to use external images when calibrating your vision system using ActivGeoCalib please note that all calibration images must be avail
15. illustrate the process of modifying properties in AVIViewProperties and the Property Window with the task of adapting the display to the image size Preparation for the following example If you worked on one of the previous examples you may continue using this project Otherwise create a project containing AVTView The following steps are visualized in figure 2 3 O At run time open AVTViewProperties by clicking on AVTView with the right mouse button and selecting Properties in the appearing context menu Q Select the Activ VisionTool whose properties you want to inspect in the combo box Ac tivVisionTool Below you can then inspect and modify the properties At the bottom of the dialog a short help text describes the currently selected property Please note that AVTViewProperties displays the actual name of the properties and not the possibly translated text that appears beside the corresponding GUI element To adapt the size of the display to the size of the image first you must query the size of the image For this select AVTView in the combo box and inspect the value of the properties Last ImageWidth and LastImageHeight Then stop the application At design time select AVTView by clicking on it Its design time properties are displayed in the Property Window The size of the display is controlled by the properties HeightImageWindow and WidthImageWindow To speed up the display we recommen
16. is disabled Thus info_framegrabber should at least return a single value to enable the element It is not necessary to return a complete list of values for combo box elements because you can enter new values by typing them into the text field The first list element becomes the default value gt 2 lt For information about how to extend your HALCON image acquisition interface so that it returns the necessary information info_framegrabber please consult the HALCON Image Acquisition Interface Programmer s Manual or contact your distributor G Additional parameters For a list of available parameters please refer to the online documenta tion of the HALCON image acquisition interfaces which can be found under http www halcon com image acquisition Parameters listed in the section Parameters for open_framegrabber are set in AVTViewFG those listed in the section Parameters for set_framegrabber_param in AVTViewFGParameter Note that Activ VisionTools and the HALCON image acquisition interfaces use a slightly different ter minology ActivVisionTools 3 2 Your Fast Track to Solutions 66 Accessing Your Image Acquisition Device query parameter in element of additional information info_framegrabber AVTIViewFG device Board port Port gt camera_type CamType If a file selection box is to appear return CAM FILE in the first tuple entry a
17. modify parameters some words of warning Please keep in mind that parameters should be modified with care after reading the online documentation Other wise you might cause your Activ VisionTools application to hang or crash _ Another warning regards the so called volatile grabbing which is offered by some image ac quisition devices If you select this mode images are not stored in memory but overwritten continuously using two buffers This speeds up image grabbing significantly However volatile grabbing must not be used when working with ActivGeoCalib _ We continue with the example of the last double page The following steps are visualized in figure A 2 If the box v Update Image is checked an image is grabbed when a parameter is changed Therefore the result can be judged immediately You can uncheck this option if you want to make a series of changes or if parameters must be set together and turn it on again to check the result Individual parameters can be reset to their default values by clicking the corre sponding reset button The default values set by the HALCON image acquisi tion interface or the SDK of the image acquisition device are used which can be found in the HTML documentation of HALCON image acquisition interfaces http www halcon com image acquisition To reset all parameters at once click the button Reset A11 D You can update
18. of figure 1 5 on page 13 This feature is typically called asynchronously resettable If a camera does not have this feature the system must wait for the camera to finish its current frame before starting the desired grab This means that there will be a delay between the external trigger and the start of the grabbing which may lie between zero and the time needed for one frame 1 3 4 Using Multiple Cameras You can acquire images from multiple cameras by using multiple instances of AVTView For detailed information please refer to the Advanced User s Guide for Activ VisionTools section 3 6 on page 88 ActivView 2008 04 23 Chapter 2 Using ActivView 3 gt z lt This chapter will explain those parts of ActivView that can be used stand alone i e without other ActivVisionTools how to acquire and inspect images and how to calibrate image coordi nates Furthermore it describes how to modify properties of Activ VisionTools 2 1 Reading Images From Files 0 0020 e ee ecces 16 2 2 Grabbing Images 2 2 2 eee eee ee ee ee ee ee ees 18 2 3 Inspecting and Modifying Properties of ActivVisionTools 20 24 Inspecting Imares os sse ws Se we Ht Ee eS ew 22 2 5 Calibrating Image Coordinates 022 2202 e eee 24 15 16 Using ActivView 2 1 Reading Images From Files Using M Using AVTViewFG you can input images that have been stored as files Currently the following forma
19. of fundamental importance to all machine vision applications 1 1 Introducing ActivView 2 0 2 cc eee eee eee ee ee ee 2 1 2 The Sub Tools of ActivView 2 0 2 eee ew ee we ee es 4 1 3 A Closer Look at Image Acquisition 2 2020 0000 8 1 3 1 From the Camera into ActivView 2 0000 8 1 3 2 About Images Themselves o o coc 5 bea ee eee y ress 10 13 3 The Queshon ot Tene Sa opaa ai a p E 12 134 Using Multiple Cameras co coo cerio eee bee 14 3 gt z lt 2 About ActivView 1 1 Introducing ActivView Activ View is a basic tool of the ActivVisionTools family i e this tool is part of every Activ VisionTools application Furthermore it is the only ActivVisionTool that can be used stand alone It provides the basic functionality necessary in each machine vision task input of images monochrome and color management of regions of interest and display of images and results Furthermore ActivView includes components for calibrating the size of a pixel Besides machine vision functionality ActivView provides components for switching between the two execution modes the configuration mode and the application mode for customizing the appearance of an ActivVisionTools application in the two modes and for displaying the current status of an application Furthermore it allows to inspect and modify the connections between ActivVisionTools and their properties interactively Image Input
20. the maximum interval i e 0 255 Thus the variations of the gray values appear more prominently Note that AVTHistogram just displays the scaled gray values overlaid on the image it does not change the gray values themselves If you are grabbing from a camera take a look at the noise it is producing Furthermore you can test whether your vision system produces the so called dark current noise Make sure that no light enters the camera e g by closing the aperture now all pixels should have the gray value 0 If this is not the case you can visualize the noise by placing the threshold bars around the peak and selecting Scale Image 4 1 Analyzing Image Quality 47 Inspecting Image Quality Using ActivHistogram and ActivLineProfile ioj x X 0 128 0 192 255 r Gray Values Min Max Peak ROI 0 255 228 Selection 159 178 Display Inside fed Pixel Number Absolute Relative Inside 640 4 30 Outside 14240 95 70 Peak 1801 12 10 Inspecting Image Quality Using ActivHistogram and ActivLineProfile X 0 128 0 192 255 r Gray Values Min Max Peak Rol 189 216 196 Selection 181 225 Display Scale Image 7 Pixel Number Absolute Relative Inside 693 J 100 00 Outside 0 0 00 Peak 118 17 03 Figure 4 4 Other aspects of image quality scaled gray values noise
21. timeout after which to abort a pending grab or to grab only parts of the image cropping Moreover some image acquisition devices allow to influence camera settings e g modify the brightness of images or switch the camera to asynchronous reset mode This functionality can be accessed interactively using the support tool AVTViewFGParameter which can be opened via AVTViewFG This method is described in the following sections while section A 5 4 on page 62 describes how to achieve this via the programming interface A 5 1 Which Parameters Can Be Set for an Image Acquisition De vice Which parameters can be influenced depends on your image acquisition device and the cor responding HALCON image acquisition interface see section 1 3 1 on page 8 The image acquisition interfaces query the available parameters dynamically Detailed information about each parameter can be obtained from the documentation of the HALCON image acquisition interfaces which can be found via the Start Menu entry of ActivVisionTools or under http www halcon com image acquisition For each in terface a separate HTML page exists Scroll down this page to the section Parameters for set_framegrabber_param where all available parameters are listed and described ActivVisionTools 3 2 Your Fast Track to Solutions 2 gt 2 lt 58 Accessing Your Image Acquisition Device A 5 2 How to Set Parameters Interactively Using io Visual Basic
22. 55 gt 2 lt r Gray Values r Pixel Nuper Min Max Peak ROI 0 255 239 Selection 159 178 Display Inside f Absolute Relative fside 645 433 Dutside 14235 9567 x Peak 2 337 x 73 98 122 Gray Values Row Col 203 77 Gray Value E Average 106 756 Min Gray j Deviation 103 196 Max Gray 242 create an ROI for AVTLineProfile1 the gray 6 you can position a cursor by dragging value profile is displayed automatically the vertical line Figure 4 1 Inspecting the image using ActivHistogram and ActivLineProfile 6 For an easier inspection ActivLineProfile provides a cursor which can be moved along the line The position of this cursor is marked by vertical lines in AVTLineProfile and on the corresponding ROI in the image The position itself is displayed in the text box Row Col the gray value in the text box Gray Value You can move the cursor by dragging the line in AVTLineProfile with the left mouse button ActivVisionTools 3 2 Your Fast Track to Solutions 42 Tips amp Tricks Visual Basic Example 4 1 2 Analyzing Saturation Using if Within a vision system the intensity of light sensed by the camera is mapped to the available gray values e g 256 in an 8 bit image Because the range of gray values has two boundaries e g 0 and 255 the mapping is not continuous i e all intensities above a certain limit are assigned the value 2
23. 55 and those below a second limit are assigned to 0 If e g the illumination is too bright or the aperture of the lens too wide the intensity of parts of the image may lie above the upper saturation limit i e 255 in an 8 bit image In this case all these parts appear with the value 255 in the image thus they cannot be distinguished by their gray value even if their intensity differs in the real world This effect is called saturation it can be analyzed easily using AVTHistogram Preparation for the following example Please continue with the previous example Execute the application and load the image sequence misc saturation1 seq Place an ROI around the logo as shown in figure 4 2 The following steps are visualized in figure 4 2 not shown AVTLineProfile D The well balanced image shows three distinctive histogram peaks for the bright back ground the dark characters and the lighter character marked with the two threshold bars Q The second and the third image of the sequence were acquired with a too wide aperture both are saturated at high gray levels over saturated The peak corresponding to the bright background has melted into the right boundary the peak value is 255 Activ Histogram indicates this state by highlighting the two markers for the maximum and the peak value in red As a consequence the peaks corresponding to the characters have shrunk Even worse the are
24. 57 A 5 2 Howto Set Parameters Interactively gt lt lt s ss cecco eson trees 58 ASJ When Are Parameters S60 o cie ey e eap e d ea eee a 62 A 5 4 How to Set and Read Parameters Via the Programming Interface 62 A 6 How to Access an Unsupported Image Acquisition Device 64 A 6 1 Accessing Your Own HALCON Image Acquisition Interface 64 51 3 gt z lt 52 Accessing Your Image Acquisition Device A 6 2 Integrating Images Directly 1 2 2 8 6054444 wee 67 ActivView 2008 04 23 A 1 Supported Image Acquisition Devices 53 A 1 Supported Image Acquisition Devices Table A 1 lists the currently supported image acquisition devices The column Name corre sponds to the entry which appears in the the combo box Name in AVTViewFG In the Start Menu entry for ActivVisionTools you can find an overview page with links to the HTML documenta tion of the interfaces If the image acquisition device you want to use is not in the list it is nevertheless possible to use it together with ActivVisionTools Please refer to section A 6 on page 64 for more details Please refer to http www mvtec com halcon image acquisition for the latest infor mation about the image acquisition devices supported by ActivVisionTools Note that if you download a new interface you must adapt the list of image acquisition devices as described in section A 4 on page 56 A 2 More Information About the Supported Image Ac quisit
25. 64 48 True DoEvents oop While bDoRun True Sub vate Sub StopButton_Click bDoRun False End Sub The example project contains additional code which in the continuous mode waits half a second after each execution cycle Other Methods for Integrating Images The programming interface of Activ VisionTools provides additional methods for integrating and accessing images They are listed and described briefly below please refer to the Reference Manual for details about their signatures ActivView 2008 04 23 Integrate and process a HALCON image ExecuteExternImage This method has the same behavior as ExecuteExternImagePtr but expects a HALCON image which can also be a color image as input Integrate an image without processing SetHalconImagePtr This method allows you to integrate gray value images from arbitrary sources by passing a pointer to it similarly to ExecuteExternImagePtr To process it call ExecuteAll ToolsOnce passing FALSE for the parameter that controls whether a new image is grabbed HalconImage This method lets you integrate a HALCON image which can also be a color image into your Activ VisionTools application To process the image call ExecuteAl1ToolsOnce as descibed above A 6 How to Access an Unsupported Image Acquisition Device 71 e Integrate an RGB image without processing SetHalconImageRGBPtr This method works similar to SetHalconImagePtr but allows to inte
26. INGA M 1e M4e Linx Lumenera USB 2 0 cameras LuCam MATRIX VISION mvBlueFOX mvDELTA mnvGAMMA mvSIGMA and mvTITAN Matrix VisionAcquire Matrox Meteor II Helios Solios and Odyssey MILLite Mikrotron INSPECTA 3 and INSPECTA 4 INSPECTA Mikrotron INSPECTA 5 INSPECTAS5 Opteon imaging systems Opteon Pleora iPORT IP Engine iPORT SICKITVP Ranger C RangerC SICKIIVP Ranger E RangerE Silicon Software microEnable II mEnablelII Silicon Software microEnable IV mEnableIV Silicon Software microEnable boards via VisualApplets mEnableVisualApplets Sony XCI SX1 and XCI V3 smart camera SonyXCI Tattile TAG cameras TAG VRmagic USB 2 0 cameras VRmUsbCam The Imaging Source DFG LC1 DFG LC2 DFG LC4 DFG MC2 and DFG MC4 DFG LC Table A 1 Currently supported image acquisition devices ActivView 2008 04 23 A 3 Detection of Image Acquisition Devices 55 AVTViewFG open_framegrabber frame Format CamType Choose File Cam CameraType era Mode etc Color ColorSpace Board Source Device Port Port default 1 default Table A 2 Translation between parameter names in AVTViewFG and the documentation of the HALCON image acquisition interfaces Leutron If your configuration is not in the list of the combo box Board you may type it directly into the text field of the combo box For example the entry for a configuration consisting of 2 physical boards with one camera connected to the first and
27. Preparation for the following example Example Please continue with the project of the previous examples Execute the application The following steps are visualized in figure 4 4 not shown AVTLineProfile ActivView 2008 04 23 Load the image misc saturation_01_scaled and place an ROI across the logo as shown in figure 4 4 The histogram shows regular gaps i e at regular intervals gray values do not appear in the image If you see such a histogram this usually means that the gray values of an image have been scaled after the image has been digitized In fact the image misc saturation_01_scaled has been created from the image misc saturation_01 load this image or see figure 4 1 on page 41 by downscaling the gray values with the factor 0 25 and then back again with the factor 4 the two images seem to be identical but the histogram clearly shows that information has been lost by the scaling Now load the image sequence misc noise1 seq place an ROI over the light character see figure 4 4 and click Run Especially if you zoom further into the image you can see that the pixel values vary slightly due to noise You can visualize noise even better using AVTHistogram Place the two threshold bars around the peak and select Scale Image in the combo box Display Now the gray values in the ROI are transformed in such a way that the interval selected by the two thresholds is mapped to
28. ROI as described in section 3 1 on page 28 Automatically the histogram of this region is displayed with arrow heads marking the minimum maximum and peak gray value Below the histogram the cor responding gray values and further statistical information is displayed If you don t create an ROI for AVTHistogram it uses the full image With a slider you can zoom into the lower part of the histogram Two vertical lines form a lower and an upper threshold The default values for the thresholds are 0 and 255 You can move them by dragging i e by keeping the left mouse button pressed In the combo box Display you can select what is to be displayed in AVTView In figure 4 1 the pixels Inside the two thresholds are displayed O OC To inspect a gray value profile you create the line or arc of inspection using AVT ViewROI as described in section 3 1 on page 28 The gray value profile along that line is displayed automatically Note that in a rectangular ROI the pixel values are averaged perpendicularly to the main axis of the rectangle ActivView 2008 04 23 4 1 Analyzing Image Quality 41 create a ROI for AVTHistogram1 the 3 drag the upper and lower threshold histogram is displayed automatically zoom into the lower part of the histogram 4 select what is to be displayed Inspecting Image Quality Using ActivHistogram and ActivLineProfile 3 rA oj x 502 mE 1h 0 64 128 192 2
29. Single and Run Execute clicking Start and stop continuous grabbing by clicking To save a grabbed image to disk click Save Image in the appearing file selector box specify a file name To save only the displayed part of the image e g when zoomed in click Save Window _ Please note that in order to speed up the image display you should adapt the size of the display to the size of the image as described in the next section ActivVisionTools 3 2 Your Fast Track to Solutions 20 Using ActivView Visual Basic Example 2 3 Inspecting and Modifying Properties of Activ VisionTools Via EE Information about the ActivVisionTools is stored in their so called properties Properties can be divided in two classes standard properties of ActiveX controls e g Width or Visible and properties that are special to ActivVisionTools e g the parameter values you select in the Activ VisionTools controls and dialogs A second classification concerns the time when you can modify a property Typically standard layout properties like Width can only be modified at design time either by interacting with the controls on the form or in the Property Window In contrast most Activ VisionTools properties can only be modified at run time by selecting parameter values in the controls or via Activ View s support tool AVIViewProperties We
30. User s Manual Acti AeEw Your Gateway to Machine Vision Microsoft Windows Windows NT Windows 2000 Windows XP Visual Basic Microsoft NET Visual C Visual C and ActiveX are either trademarks or registered trademarks of Microsoft Corporation All other nationally and internationally recognized trademarks and tradenames are hereby rec ognized EC Copyright 2000 2008 by MVTec Software GmbH M nchen Germany mvrec software cmort Edition 1 November 2000 ActivVisionTools 1 0 Edition 2 Februar 2001 ActivVisionTools 1 2 Edition 3 April 2001 ActivVisionTools 1 3 Edition 4 September 2001 ActivVisionTools 2 0 Edition 5 November 2002 ActivVisionTools 2 1 Edition 6 January 2005 ActivVisionTools 3 0 Edition 7 February 2006 ActivVisionTools 3 1 Edition 8 May 2008 ActivVisionTools 3 2 All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without prior written permission of the publisher More information about ActivVisionTools can be found at http www activ vision tools com How to Read This Manual This manual explains how to use ActivView the basic tool of all ActivVisionTools applica tions It describes the functionality of ActivView with Visual Basic examples Before reading this manual we recommend to read the manual Getting Started with Activ VisionTools
31. a of the characters measured by the number of pixels has shrunk as well this leads to inaccuracies when inspecting those regions e g using ActivMeasure or Activ FeatureCalc The fourth and the fifth image of the sequence were acquired with a narrow aperture both are saturated at low gray levels under saturated Now the peak corresponding to the dark characters has melted into the left boundary the peak value is 0 now the two markers for the minimum and the peak value are highlighted in red As a consequence the peaks corresponding to the light character to the background have shrunk together with their area Furthermore the range of gray values is not used fully anymore the maximum gray value appearing in the image is 206 ActivView 2008 04 23 4 1 Analyzing Image Quality 43 Inspecting Image Quality Using ActivHistogram and ActivLineProfile Oj xj v 0 0 64 128 192 255 r Gray Values Pixel Number Min Max Peak Absolute Relative Rol J 0 l 255 233 Inside 645 4 33 Selection 159 178 Outside 14235 95 67 oO Display Inside 7 Peak 502 3 37 z 5 oO lt Histogram a 2146 r r o 0 64 128 192 255 ava r Gray Values Pixel Number Min Max Peak Absolute Relative ROI 3 255 255 Inside 599 J 4 03 Selection 176 h92 Outside 14281 95 97 Display Inside z Peak l 2146 J 14 42
32. able throughout the calibration process The ActivVisionTools distribution includes the example Visual Basic project externim age view_externimage vbp which is explained in the following When the form is loaded i e within the method Form_Load three test images are created as byte arrays and filled with different twodimensional gray value ramps ActivVisionTools 3 2 Your Fast Track to Solutions 2 gt Z lt 68 Accessing Your Image Acquisition Device is Feeding Images Directly Into Activ iew o x r Line Profile 0 04 8 12 16 2 2 2 32 3640 r Gray Values Row Col aA Gray Value 144 Average fi 44 000 MinGray 124 Deviation 11 979 MaxGray 164 Figure A 4 Integrating external images into an ActivVisionTools application Private Image1 63 47 As Byte Image2 63 47 As Byte Image3 63 47 As Byte Private Sub Form_Load Dim iRowCnt iColCnt As Integer For iRowCnt 0 To 47 For iColCnt 0 To 63 Image1 iColCnt iRowCnt Image2 iColCnt iRowCnt Image3 iColCnt iRowCnt Next Next CByte iRowCnt 4 iColCnt CByte iRowCnt 2 iColCnt 2 CByte iRowCnt iColCnt 3 End Sub The following method returns the pointer to an image matrix alternating between the three images ActivView 2008 04 23 A 6 How to Access an Unsupported Image Acquisition Device 69 Private Function NextExternImagePtr As Long Static iNe
33. ases the external trigger mechanism does not work To test whether this is caused by the Visual Basic environment create a stand alone application see the manual Getting Started with ActivVisionTools section 3 5 on page 38 here the external trigger should work 2 gt 2 lt A general note for those who switch between image acquisition devices of different manufac turers We recommend to keep only the currently used boards in the computer and to uninstall the software of unused devices or at least stop the corresponding driver Otherwise you might get unexpected errors as some image acquisition devices interfere with each other ActivVisionTools 3 2 Your Fast Track to Solutions 50 Tips amp Tricks ActivView 2008 04 23 Appendix A Accessing Your Image Acquisition Device This appendix contains more detailed information about the supported image acquisition de vices Section A 5 on page 57 describes how to set additional parameters of your image acquisition device using AVTViewFGParameter A 1 Supported Image Acquisition Devices 22 0200 53 A 2 More Information About the Supported Image Acquisition Devices 53 A 3 Detection of Image Acquisition Devices 2 0200 55 A 4 Modifying the List of Available Image Acquisition Devices 56 A 5 Setting Additional Parameters 0 00002 e eee 57 A 5 1 Which Parameters Can Be Set for an Image Acquisition Device
34. be loaded Click Execute to re execute all tools on the current image This is just like click ing Single without skipping to the next image This button is useful if you want to evaluate the effect of changed parameters on the current image If you click Run images are loaded in a loop If you have selected a single file it will be reloaded continuously this does not make much sense You stop this mode by clicking Stop AVTViewStatus displays error messages e g if you try to load a not existing image file If you grab from an image sequence it displays the current file name 2 1 Reading Images From Files 17 O select File in the combo box choose an image file in the combo box or via the file selector box Reading Images From Files 15 x requisition Interface File v Name Detect Refresh m Device T Board vj Port z m Input File 5 pendulumpendulum seq is 2 gt hd Choose Directory Choose File S Au lt z 7 r Grabbing Kil gt a Execute C ae 1 IV Connected More Parameters l ir B F Trigger Savel in Save Window i T as Fa ll Single riga ave Image ave Window press Single to re load file press Run to load images continuously or to load next image in a sequence and Stop to stop the loop press Execute to re
35. can open AVTViewProperties You can change connections between tools by dragging them to another position in the tree Allowed positions are marked in green For example the second instance of AVT Barcode1D can only be connected to one of the two instances of AVTView Furthermore while you drag a tool the cursor shape changes If it is red e g when you drag AVT Barcode1D2 over AVIBarcode1D1 the connection is not possible _ Note that ROIs are lost if you connect a tool to a different instance of AVTView The lower part of figure 3 5 shows the state after connecting AVIBarcode1D2 to AVIView2 and creating an ROI for it A further example of using AVTViewConnections can be found in the Advanced User s Guide for ActivVisionTools section 2 2 2 on page 44 ActivView 2008 04 23 3 5 Inspecting and Modifying Connections Between ActivVisionTools 37 Modifying the Connections Between Activ isionTools DJ x 7 m ane 210 x Cove 38 VT BatcodelD1 _Fettesh_ J Checksum 2 gt 2 lt I Composite Detect Display Results V Code m Result Options IV Code IV Position J Elements J Candidates I Region open AVTViewConnections via the context menu of AVTView click a tool to highlight its dialog the tool tip displays additional information via the context menu you can access it
36. chipichip_02 iz hg Choose Directory Choose File z 2 gt 2 lt Connected More Parameters J Single Run F Trigger Save Image Save Window 66 2 ms Loading file chip_02 Unit um X Length Line 30 00 um lt _ Pixel Height 0 275403 um Name User Defined Mode fap Calibration Save Load Reset 6 m Edit Region of Interest 2 21 3 2 2 2 A A Copy Paste Delete Delete All m Select ActivVisionTool AVTViewCalibrationt fr Region of Interest Line 41141 21T Locked rm Display Region of Interest r Display Results ActiveRO Yellow x Group fl Gyan Error ROI Mire gt Group Il Green gt Selected Tool Yew z Error Mro gt Inactive Tools Owie x Selected Yew z Special E Orange x DisplyMode iQ Maon z Pick Point E Magenta v Lnewidh 1Pixl z Line Width 3 Pies v Text Meu gt Disc lines MS Sans Serif 12pt I Text Background I Contrasting Contours LUT BE defaut bd fad AVTViewROI fal AVTViewDisplayModes Fi AVTViewCalibration Figure 1 1 The sub tools of ActivView part 1 ActivVisionTools 3 2 Your Fast Track to Solutions 6 About ActivView ES AVTViewExecute is a support tool of ActivView It allows to switch between configuration mode a
37. contrasting background how regions are displayed and whether contours are displayed with a contrasting border 3 2 Displaying ROIs and Results 31 open AVTViewDisplayModes via the select all results for display 4 context menu of AVTView Modifying the Display of ROIs and Res 0 x Code Type EAN 13 b IV Checksum I Composite Detect Display Results IV Code IV Elements lt V Candidates x V Code I Position Result Options IV Region m Display Region of Interest r Display Results Active ROI iGreen gt Group E Magenta vhe Error ROI fred z Group II sue le Selected Tool Yeow gt Error Mire ze Inactive Tools PE Selected Yew he Special E Magenta DisplyMode B Maon zhe Pick Poit Red v LineWidh 1Pke gt Line Width 2 Pixels hd Display Image I Contrasting Contours color of the different types of ROIs color of the different types of results color font and background of text line width of ROIs or results 4 color of the active pick point look up table for image display drawing mode for regions and contours Figure 3 2 Changing display parameters Note that if you zoom into an image the display of ROIs is clipped to the displayed part of the image see e g figure 3 2 Thus if you see a rectangle aroun
38. cquisition device is detected this way it becomes the default selection in the combo box Name If no image acquisition device could be detected File becomes the default ActivVisionTools 3 2 Your Fast Track to Solutions 2 gt Z lt 56 Accessing Your Image Acquisition Device _ If you override the default selection your choice will be saved in the description file DSC file thus when starting an application the next time this choice will be restored Note that some image acquisition devices of different manufacturers cannot be distinguished by the automatic detection mechanism Therefore the list might contain devices that you never installed on your system A 4 Modifying the List of Available Image Acquisition Devices By default ActivView asks HALCON which image acquisition interfaces are supported and scans HALCON s installation directory for additional image acquisition interfaces as described in section A 3 on page 55 Therefore if you have downloaded and installed a new HALCON image acquisition interface from MVTec s web server it will be listed automatically You can override the list of image acquisition interfaces by modifying the file AVTView nls not to be confused with ActivView n1s which resides in the subdirectory n1s of the folder where you installed Activ VisionTools In this file add the line AVTView FGSelection A list of image acquisition devices with li
39. cting Images coea coe aa RE RS HAS eS ES Ee 22 2 5 Calibrating Image Coordinates ossa ee ee Es 24 3 Combining ActivView with other ActivVisionTools 27 3 1 Managing Regions of Interest o oo 28 3 2 Displaying ROIs and Results 0000 30 3 3 Inspecting the Status of an Application 2 0 0 32 3 4 Configuring the Two Execution Modes 200 34 3 5 Inspecting and Modifying Connections Between ActivVisionTools 36 4 Tips amp Tricks 39 4 1 Analyzing Image Quality 2 5 ee eee ee ee m tE 40 42 Troubleshooting lt o coe ge A Se E e E OE a RRS 48 A Accessing Your Image Acquisition Device 51 A 1 Bad A 3 A 4 A 5 A 6 Supported Image Acquisition Devices 2 00 53 More Information About the Supported Image Acquisition Devices 53 Detection of Image Acquisition Devices ooo 55 Modifying the List of Available Image Acquisition Devices 56 Setting Additional Parameters 2 2 000 57 How to Access an Unsupported Image Acquisition Device 64 Chapter 1 About ActivView This chapter will introduce you to the features and the basic concepts of ActivView It gives an overview about ActivView s master tool and its support tools which are described in more detail in chapter 2 on page 15 and chapter 3 on page 27 In section 1 3 on page 8 we take a closer look at the process of image acquisition as this process is
40. d the image this means that there is an ROI encompassing the displayed image part A very thin green rectangle around the image in contrast indicates that the image is the active item of your application i e that interactions like keyboard input will be processed by the image The question how to adapt the display is also addressed in the manuals of other Activ Vision Tools with the emphasis on the special needs of the respective tool ActivAlignment section 4 1 on page 24 ActivGeoCalib section 4 1 on page 24 ActivMeasure section 4 1 on page 26 ActivBarcode section 4 1 on page 22 ActivDataCode section 4 1 on page 36 ActivBlob Finder section 4 1 on page 34 ActivOCR section 4 1 on page 58 ActivDecision section 3 1 on page 24 ActivVisionTools 3 2 Your Fast Track to Solutions 2 gt 2 lt 32 Combining ActivView with other ActivVisionTools 3 3 Inspecting the Status of an Application with H AVTViewStatus displays information about your ActivVisionTools application e g the execu tion time of a cycle but also warnings and error messages Visual Basic Preparation for the following example Example If you worked on the previous example you may continue using this project If AVTViewStatus is not already on the form please add it by double clicking Ai Execute the application and load barcode code39_01 The following steps are visualized in figure 3 3
41. d to set these properties ActivView 2008 04 23 2 3 Inspecting and Modifying Properties of ActivVisionTools 21 select the tool in the combo box and inspect or modify its properties O open AVTViewProperties by clicking on AVTView with the right mouse button w Modifying Properties of Activ isionTools uPropeties lol x aj a ActivVisionT oly ANTViewl hd IV Connected FGAuto pply FGFileName FGlmageDir FGName True a barcode barcode1 se C Program Files MYT pt t DirectShow Raemon FGParallelGrabbing True Parameters ImageDirectory C Program Files MVTec LastImageHeight p l LastlmageWidth 640 LineWidthl conic 1 Pixel y Size LineWidthRO 1 Pixel MakeFeaturelnvariant True Field RunState False Save Image ActivView Scalex 3 the image size is stored in these two properties Properties A YT iew1 x AYTYiew1 AVTView Alphabetic Categorized 4 at design time click on AVTView its properties are shown in the Property Window False 0 MS Sans Serif W sxs0000012 3765 200 0 C Program Files w Modifying Properties of Activ isionTools True 120 1 eLineWidth1 1 eLineWidth1 0 9 eROINone False SlaveExecution False gt HeightImageWindow The height of the image window in adapt the properties for height and width of the image window pixels Figure 2 3 Modi
42. des view_displaymodes vbp Execute the application and load barcode ean13_08 The following steps are visualized in figure 3 2 ActivView 2008 04 23 Open AVTViewDisplayModes by clicking on AVTView with the right mouse button and selecting Display Modes in the popup menu In the frame Display Results of AVTBarcode1D check all boxes Using AVTView DisplayModes you can now change various display parameters e g the color of the currently selected active ROI of the other ROIs of the selected tool or of the ROIs of other not selected tools or of ROIs that are evaluated as not okay by ActivDecision the color of the selected active pick point the line width of the ROIs or of the results the LUT look up table that is used to display the image the color of the different types of results ActivVisionTools can assign their results to two groups to allow to display them using different colors In the case of ActivBarcode the elements and candidates are assigned to group I the bar code region to group II A third color is reserved for presumed elements that could not be decoded and results that are evaluated as not okay by ActivDecision Finally you can choose the color used for highlighting results if you select them in ActivDataView or ActivDecision the color and the font of displayed text and whether it is displayed on a
43. dual Activ VisionTools in an application To inspect and modify the connections it provides the support tool AVTView Connections Note that in most applications you don t need to modify connections exceptions are applications that use ActivGUIComponents ActivGenericInterface or multiple instances of Activ View or of ActivBlobFinder and ActivFeatureCalc Visual Basic Preparation for the following example Example We recommend to open the project connections view_connections vbp which already contains two instances each of AVTView and AVTBarcode1D Execute the application and load the images barcode barcode1 seq and bar code code39_01 respectively The following steps are visualized in figure 3 5 O Open AVTViewConnections by clicking on either instance of AVTView with the right mouse button and selecting Connections The dialog depicts the connections in form of a tree In the example all tools including the second instance of AVTView are connected to the first instance of AVTView If you click on a tool in the tree the corresponding dialog is highlighted The tool tip displays additional information about the tool e g its input and output data or its number of ROIs If the tool is not connected to any other tool the tool tip explains why If a tool name appears in grey like AVTViewConnections it is not executed in the execution cycle By clicking on a tool with the right mouse button you
44. e grabbers allow to connect them to an external trigger signal which then triggers the next grab see section 1 3 3 on page 12 With some cameras you don t need a dedicated frame grabber board Instead its task is per formed by a standard adapter in the PC e g a USB FireWire or Ethernet adapter Please note that it is not sufficient that a camera has a USB IEEE 1394 or Ethernet output in order to get its images into the PC you also need the corresponding driver software see below ActivView 2008 04 23 1 3 A Closer Look at Image Acquisition 9 O camera computer frame grabber 2 gt 2 lt software SDKs of HALCON image acquisition ActivVisionTools D im acqu devices 8b Ha A G9 SDK1 A so k2 gt ___ gt I Ne yy Figure 1 3 The components of the image acquisition process 3 The Software On the software side again multiple components cooperate to get images inside Activ Vision Tools First of all most frame grabbers come with their own software the so called SDK Ga SDK software development kit consisting of the so called device driver and one or more li braries DLLs The SDK performs the low level communication with its frame grabber e g manages its initialization sends commands and receives and stores the images in main memory and encapsulates it behind an easier to use interface Note that also ima
45. e in the combo box Name If your device does not appear in the list please refer to section 4 2 on page 48 Depending on the used image acquisition device you might need to specify additional parameters describing the device e g the type of your frame grabber board or camera combo box Board or the number of the input port at which the camera is connected to the frame grabber or computer combo box Port Click Refresh to update the supported parameter values for the connected interface Further parameters describe the connected camera and the image format In the combo box CamType you can select the type of the analog video signal e g ntsc or the digital image format For some image acquisition devices it may be necessary to specify a camera configuration file Please refer to section A 2 on page 53 for more information In the combo box Color specify the type of the image together with its pixel value resolution see section 1 3 2 on page 10 e g Gray 8 or Color 24 When using analog cameras the combo boxes Size and Field let you you select the image size and the grabbing modesection 1 3 2 on page 10 Note that the option Half Height means that single fields are grabbed which field is grabbed can be specified in Field First odd fields Second even fields Next both fields Enable or disable an external trigger with the check box v Trigger If you click
46. ee ee eo A 42 4 1 3 Analyzing Sharpness ck ee ee a e 44 4 1 4 Other Aspects of Image Quality 0 0 46 42 Troubleshooting o es s aca eww eS RE we Oe eS 48 39 3 gt z lt 40 Tips amp Tricks Visual Basic Example 4 1 Analyzing Image Quality Using ff and fa When developing machine vision applications it is important to keep in mind that high quality results can only be extracted from high quality images This section shows how to analyze and enhance the quality of acquired images using the inspection tools ActivHistogram and Activ LineProfile 4 1 1 A First Look at ActivHistogram and ActivLineProfile ActivHistogram calculates the gray value distribution within a region of interest i e how often individual gray values occur within the region while ActivLineProfile analyzes the gray value profile i e the sequence of gray values along an ROI In this section we give a quick tour of the two tools How to read the histogram and the profile i e how to get information to optimize your machine vision setup with regard to image quality is the topic of the following sections Preparation for the following example We recommend to open the project imagequality view_imagequality vbp Execute the application and load the image misc saturation_01 The following steps are visualized in figure 4 1 D First create an ROI for AVTHistogram1 using AVTView
47. een them Furthermore another support tool provides a single button to start and stop an application Inspecting the Status of an Application The support tool AVIViewStatus displays the current status of your ActivVisionTools appli cation together with error messages Furthermore this tool shows the time needed for the last processing cycle or alternatively the current speed of the application i e the number of pro cessing cycles per second Inspecting and Modifying Connections Between ActivVisionTools ActivVisionTools automatically creates the connections between the individual tools With the support tool AVTViewConnections you can inspect and modify the connections Inspecting and Modifying Properties of ActivVisionTools With the support tool AVTViewProperties you can inspect and modify the properties of the ActivVisionTools in your application at run time ActivVisionTools 3 2 Your Fast Track to Solutions 4 About ActivView 1 2 The Sub Tools of ActivView Besides its master tool ActivView provides eleven support tools see figure 1 1 on page 5 and figure 1 2 Ti AVTView is the master tool of ActivView It provides the central display for images ROIs and results You can zoom into the display and move the part of the image that is displayed How to use AVTView is described in more detail in section 2 4 on page 22 AVTViewFG is a support tool of ActivView With it you can acquire images from image acq
48. ewExecuteSimple to the form by double clicking Bx s Otherwise open the project usermodes view_usermodes vbp Execute the application and load the image sequence barcode barcode1 seq The following steps are visualized in figure 3 4 not shown AVTBarcode1D ActivView 2008 04 23 Open AVTViewExecute and AVTViewConfigExec by clicking on AVTView with the right mouse button and selecting Execution and Execution Parameters in the popup menu In AVTViewExecute you can switch between the two execution modes via the combo box Mode To execute one cycle press Single In our example this means that the next image of the sequence is loaded With the other two buttons or with the button in AVTView ExecuteSimple you can start the application in a continuous mode and stop it again For each of the two execution modes you can choose what is to be displayed by checking the corresponding boxes in AVTViewConfigExec Furthermore you can specify if images can be dragged to the image window and whether ROIs can be modified in the two modes by default this is disabled in the application mode to prevent you from accidentially moving or deleting an ROI By default AVITViewExecuteSimple executes the application in continuous mode but you can change its behavior to single step execution For this open AVTView Properties by clicking on AVTView with the right mouse button and selecting Prop erties in the appea
49. extracted only if they differ significantly from the background Note that the pixel value resolution may be smaller than the number of bits actually transmitted and stored per pixel as the latter usually is a multiple of 8 _ Please note that in the current version of ActivVisionTools many tools can only process 8 bit images e g ActivBarcode or ActivAlignment ActivView however can display images regardless of their resolution 1 3 3 The Question of Timing As multiple components cooperate to grab images the question of timing arises Here methods range from purely sequential to externally triggered grabbing Figure 1 5 visualizes some of them D Sequential Grabbing The na ve approach is to let components work in sequence A cycle starts with the software requesting the next image Typically the image acquisition device must wait for the beginning of the next frame before starting to grab it Only after the image is fully grabbed the software can start with the actual processing As can be seen in figure 1 5 even if the processing takes less than the grabbing not all images can be processed 2 Parallel Grabbing To optimize the performance ActivVisionTools therefore internally parallelizes the grabbing and the actual processing The main idea is that while an image is processed the image acqui sition device already grabs the next image In the example shown in figure 1 5 every frame can be processed this wa
50. fying properties of ActivView to adapt the display to the image size to the full half or quarter size of the image ActivVisionTools 3 2 Your Fast Track to Solutions 22 Using ActivView 2 4 Inspecting Images Using i AVTView allows to inspect images more closely by providing a zoom mechanism The inspection tools ActivHistogram and ActivLineProfile allow a more detailed inspection please refer to section 4 1 1 on page 40 for more information Visnal Basic Preparation for the following example Example If you worked on the previous example you may continue using this project Other wise open the project display view_display vbp Execute the application Run gt Start or via the corresponding button The following steps are visualized in figure 2 4 D To zoom into the image drag the outer scrollbar on the right side of the display Note that the zooming factor does not increase continuously but following a power series 2 4 8 16 to speed up zooming D After zooming you can change the part of the image that is displayed by using the two scrollbars below and at the right side of the display If you check the box in the lower right corner you can move in the image by moving the mouse inside the image while keeping the left mouse button pressed ActivView 2008 04 23 2 4 Inspecting Images 23 zoom into the image using this scroll bar Adapting the Di
51. ge acquisition devices that can be connected directly to a computer bring their own SDK ActivVisionTools 3 2 Your Fast Track to Solutions 10 About ActivView However each SDK presents a different interface To facilitate the use of different image ac quisition devices in a machine vision application HALCON the basis of the Activ VisionTools therefore provides the so called image acquisition interfaces Gb These software components translate the commands and methods used by the corresponding SDK into a common generic interface which is then accessed by the Activ VisionTools 69 or more exactly by AVTViewFG 1 3 2 About Images Themselves Figure 1 4 visualizes some technical terms concerning images and their representation D Color Images and the Concept of Channels While a so called gray value image also called black and white image contains only informa tion about the brightness also called intensity of a certain object color images also code its color There exist many different ways to represent color In the so called RGB color space colors are represented by the sum of the three principal colors red green and blue Therefore one can think of an RGB image as being composed by three sub images called chan nels The red channel contains all the red parts of an image in the example in figure 1 4 the word RED the green channel all the green parts the word GREEN and the blue channel all the
52. grate RGB images from arbitrary sources by passing three pointers to the three channels How to process the image is described above SetHalconImageRGB With this method you can integrate an RGB image in form of three HALCON images corresponding to the three channels How to process it is described above e Access the image You can access the currently used image in form of a HALCON image HalconImage or directly access the image pointer GetHalconImagePtr Note that the latter should be used for gray value images for color images it returns the pointer to the first channel 3 gt Z lt e Access an image channel To access a single channel of the current image we recommend to first check the number of channel using the method HalconImageChannelCount Then you can either get the pointer to a channel GetHalconImageChannelPtr or access it in form of a HAL CON image HalconImageChannel ActivVisionTools 3 2 Your Fast Track to Solutions
53. he left mouse button keep the button pressed and move the mouse A narrow rectangle appears its orientation fol lowing the mouse The creation of a polygonal ROI f is more complex By the first mouse movement the first side of the polygon is created You can add a new corner point by clicking on the line with the left mouse button when you drag it by keeping the mouse button pressed new polygon sides are created where you can again add new corner points To delete a corner point drag it onto a neighboring corner point After releasing the mouse button you can move the ROI by dragging its pick point in the middle and edit its shape by dragging the outer pick points Note that for a polygonal ROI the middle point appears at the center of gravity of the ROI and therefore changes whenever the polygon is modified besides it may even lie outside the ROI for concave polygons 3 1 Managing Regions of Interest 29 DO NOT check this box select the tool for the ROI 4 draw the ROI in the image by moving G to start creating a ROI select a shape the mouse while pressing the left butt ia Creating Regions of Interest oj x r Edit Rixgion of Interest S S m m m a lt Copy Paste Delete Delete All gt r Select oO ActivVisionT ool AVTBarcodelD1 v q z Region of Interest Rectangle2_2 272 3 a
54. ion Devices Section 2 2 on page 18 showed how to connect to your image acquisition device by setting the corresponding parameters in AVTViewFG However the values available for each device may differ widely They are documented in detail in the HTML page for each HALCON im age acquisition interface but in the nomenclature of the corresponding HALCON operator open_framegrabber You can open these HTML pages via the Start Menu entry for Activ VisionTools Table A 2 on page 55 helps you to translate between these two worlds by showing which pa rameter or value of the HALCON operator open_framegrabber corresponds to the elements or values of AVTViewFG The following list contains additional information for some interfaces that is important when using them with ActivVisionTools DT315x If you select volatile in CamType images are not stored in memory but overwritten continuously using two buffers This speeds up image grabbing significantly However volatile grabbing must not be used when working with ActivGeoCalib Furthermore volatile grabbing is not supported with color images INSPECTA INSPECTA5S You select a camera configuration in two steps First load a configuration file via the file selector box Choose Filej Then type the name of the section within this file which corresponds to your camera into the lower text box _ ActivVisionTools 3 2 Your Fast Track to Solutions 2 gt
55. irectly in the text box Pixel Height in AVITViewCalibration ActivVisionTools 3 2 Your Fast Track to Solutions 26 Using ActivView ActivView 2008 04 23 Chapter 3 Combining ActivView with other ActivVisionTools This chapter explains the parts of Activ View that are used in conjunction with other tools how to create and edit ROIs and how to change the display of ROIs and results For demonstration ActivBarcode is used as an example vision tool please consult the User s Manual for Activ Barcode for detailed information about it Note that if you do not have a license for this tool an error message appears when you add it to the form and the control remains disabled The final sections focus on ActivView s role as the central instance of an ActivVisionTools application They describe the display of status information the customization of the behavior in the two execution modes and how to inspect and modify the connections between individual Activ VisionTools 3 1 Managing Regions of Interest 0 0002 e eee eee 28 3 2 Displaying ROIs and Results 0 02 e ee eee ccee 30 3 3 Inspecting the Status of an Application 0e500 32 3 4 Configuring the Two Execution Modes 2e22000 34 3 5 Inspecting and Modifying Connections Between ActivVisionTools 36 27 3 gt z lt 28 Combining ActivView with other ActivVisionTools 3 1 Managing Regions of In
56. isionTools Error x A Errar grabbing mage D error popup without AVTViewStatus Breie iss rine lt _ after single step or in continuous mode gt Cancel Figure 3 3 The status of an ActivVisionTools application offers two buttons If you click OK the application continues running In the example where the grab error was provoked by selecting wrong parameters for image acquisition ActivVisionTools would again try to grab an image resulting in the same error In such a case you can click Cancel1 to stop the continuous execution ActivVisionTools 3 2 Your Fast Track to Solutions 34 Combining ActivView with other ActivVisionTools 3 4 Configuring the Two Execution Modes Via and H AVTViewExecute allows you to switch between the two execution modes and to start an ap plication AVTViewExecuteSimple is a simplified version consisting of a single button Using AVTViewConfigExec you can customize the behavior of an Activ VisionTools application e g what is displayed for the two execution modes This allows you e g to display live images only in the configuration mode to setup your application but then switch it off in the application mode to speed up the application Visual Basic Preparation for the following example Example If you worked on the previous example you may continue using this project At design time add AVTVi
57. list of file ex tensions without separated by in the second and a default directory in the third Ad ditional values for the combo box can follow gt color_space Color The two queries are combined as follows If gt bits_per_channel gt color_space gray or rgb the val ues for bits_per_channel are automati cally added to form entries like Gray 8 or gt Color 24 with NLS support For other val ues of color_space the text is directly in serted in the combo box without NLS support in this case bits_per_channel is ignored instead when connecting to the image acquisi tion device 1 is passed for this parameter field Field external_trigger Trigger Size The combo box automatically contains the entries Full Size Half Size and gt Half Height for unknown image acquisition interfaces info_boards Board This is a special query for dynamic information Port If it returns values that are not included in the lists returned by device and port they are inserted in the combo boxes and used as default values Table A 3 How queries via info_framegrabber influence the elements of AVTViewFG ActivView 2008 04 23 A 6 How to Access an Unsupported Image Acquisition Device 67 A 6 2 Integrating Images Directly Via the programming interface of ActivVisionTools you can let it process images
58. meters are set whenever you change their value if v Update Image is checked or by explicitly grabbing an image The changed parameters are furthermore saved in the project s description file DSC file see the manual Getting Started with ActivVisionTools section 2 4 on page 9 for more information when you stop the application or select a different image acquisition device or File in AVITViewFG s combo box Name When you start the application or switch back to your image acquisition device the parameters are read from this file they are set when you connect to the image acquisition device If you need to modify parameters at arbitrary moments in your application you can do so via the programming interface as described in the following section A 5 4 How to Set and Read Parameters Via the Programming Inter face You can set and read parameters for image acquisition devices also via the Activ VisionTools programming interface using AVIView s methods SetFGParameterValue and GetFGParam eterValue This allows you e g to set and read parameters at arbitrary moments in your application Applications where this may be necessary include acquiring images from multiple cameras via port switching or accessing digital I O lines provided by a frame grabber Figure A 3 shows an application that allows to switch between cameras ports via a text box and a button and that displays the current port in a second text box The code
59. nd application mode How to use AVIViewExecute is described in section 3 4 on page 34 AVTViewExecuteSimple is a support tool of ActivView It provides a button to start and stop your application How to use AVTViewExecuteSimple is described in section 3 4 on page 34 Ba AVTViewConfigExec is a support tool of ActivView It allows to configure what is displayed in the different execution modes How to use AVITViewConfigExec is described in section 3 4 on page 34 E AVTViewConnections is a support tool of ActivView With it you can inspect and modify the how tools are connected to each other How to use AVTViewConnections is described in section 3 5 on page 36 fl AVTViewProperties is a support tool of ActivView It allows to inspect and modify the prop erties of the ActivVisionTools in an application How to use AVIViewProperties is described in section 2 3 on page 20 ActivView 2008 04 23 1 2 The Sub Tools of ActivView 7 i AVTView Bei AVTViewExecute BR AVTViewExecuteSimple The Sub Touls of Activ iew Eziz Execution Configuration zi Mode J Execute Slaves Single Run stop m Application Mode I Display Image J Display Results J Display ROIs IV Display Error Results I Allow ROI editing Allow Drag amp Drop 2 gt 2 lt m Configuration Mode IV Display Image IV Display Results iV Display ROIs IV Display Error Re
60. offers both interlacing and progressive scan choosing progressive scan does not mean that you get more frames per second only that a full frame is grabbed at a time ActivView 2008 04 23 1 3 A Closer Look at Image Acquisition 11 RED RED GREEN GREEN BLUE gt T T BLUE CYAN CYAN CYAN O color image three RGB channels red green blue progressive scan frames odd field even field odd field even field fields interlaced Figure 1 4 Fields frames and channels Image Resolution Image resolution concerns two aspects In measuring applications for example the effective size of a pixel i e the size of what is projected onto a pixel is important as it influences the accuracy of measuring This spatial image resolution has to be kept in mind when setting up the vision system for a machine vision application A second aspect concerns the resolution of information in other words how many bits are used for each pixel e g 8 bit for gray value images or 3 x 8 24 bit for RGB images Nowadays ActivVisionTools 3 2 Your Fast Track to Solutions 2 gt 2 lt 12 About ActivView many cameras offer other resolutions e g 10 or 12 bit gray value images The higher the resolution the better objects can be differentiated by their appearance in the image This is important for example in blob analysis applications as objects blobs can be
61. or your image acquisition device i e the DLL HFGxyz d11 with xyz being the name of your device interface HALCONROOTY is the folder you selected during the installation of HALCON e g C Program Files MVTec Halcon If everything seems to be okay please contact your local distributor Connecting to an IDS or DFG LC frame grabber fails and an error popup window appears Some parameter selections in the frame Device may cause an internal error in the frame grabber SDK which results in the error popup MATRIX Vision frame grabbers report not enough memory If you get an error in ActivVisionTools claiming that not enough memory is available whereas MATRIX Vision s test program grabs images continuously check whether you allocated enough memory for two image buffers in MATRIX Vision s configuration pro gram MVconfig The grabbed image has a black part at the bottom If you selected a PAL signal try NTSC instead If you selected the automatic signal analysis auto also try NTSC 4 2 Troubleshooting 49 The grabbed image is distorted completely Maybe you selected NTSC instead of PAL or Gray 16 instead of Color 24 The grabbed image appears to be stretched Resize the display to fit the size of the image as described in section 2 3 on page 20 The external trigger does not work within Visual Basic If you are using ActivVisionTools within the Visual Basic environment in some c
62. p transitions between the gray values corresponding to the characters and the back ground respectively Q The second image of the sequence was acquired after defocusing In the gray value pro file the gray values now change more gradually between the characters and the back ground If you are grabbing from a camera please experiment with the focus ActivView 2008 04 23 4 1 Analyzing Image Quality 45 Inspectia Image Quality Using ActivHistogram and ActivLineProfile m Line Profile 255 192 128 64 0 0 7 15 22 2 37 44 SI 59 66 Gray Values Row Col 203 74 Gray Value 54 Average 88 015 Min Gray f4 Deviation 105 407 Max Gray 255 gt 2 lt r Line Profile 255 192 128 64 T T r T T r r O 15 2 29 37 44 Si 59 66 Gray Values Row Col 203 74 Gray Value 57 Average pe 597 MinGray 12 Deviation fi px Max Gray 248 Figure 4 3 Gray value profile of sharp and defocused image ActivVisionTools 3 2 Your Fast Track to Solutions 46 Tips amp Tricks 4 1 4 Other Aspects of Image Quality In the previous sections we showed how to use the information provided by ActivHistogram and ActivLineProfile to optimize the setup of your vision system In this section we take a brief look at other aspects of image quality which show up in the histogram Visual Basic
63. revious example you may continue using this project Switch into design mode Run gt Stop or via the corresponding button Select AVITViewFG by clicking into it and delete it by pressing Delete Add AVTViewROI and AVT ViewCalibration to the form by double clicking the icons and with the left mouse button Otherwise open the project calibration view_calibration vbp Execute the application Run gt Start or via the corresponding button Here you can open AVTViewFG by clicking on AVTView with the right mouse button and selecting Image Acquisition Load the image sequence pendulum pendulum seq The following steps are visualized in figure 2 5 D Make sure that the check box at the lower right corner of the display is not checked Otherwise all mouse clicks in the image will move the displayed part of the image In the combo box ActivVisionTool of AVTViewROI select AVTViewCalibration1 Select the shape of the ROI by clicking the button A To draw the line in the image click into it with the left mouse button keep the button pressed and move the mouse A line appears with its endpoint marked by an arrow Edit it by dragging the pick points To position the line accurately zoom the image as described in the previous section In AVIViewCalibration select a unit in the combo box Unit This unit is automati cally adopted both for the length of the line and for the pi
64. ring context menu Then select the properties of AVIView ExecuteSimple 3 4 Configuring the Two Execution Modes 35 D open the sub tools via the switch between the two modes context menu of AVTView execute a single cycle or start stop the application Controlling the Two User M Execution Application 7 i ode J Execute Slaves z 2 gt 2 lt Application Mode IV Display Image IV Display Results I Display ROIs IV Display Error Results 7 s J Allow ROI editing I Allow Drag amp Drop L XI Configuration Mode ActivVisionT ool AVTViewExecuteSimplel Iv Display Image M Display Results lV Display ROIs IV Display Error Results CaptionSingle Single VV Allow ROI editing V Allow Drag amp Drop CaptionStop Stop Singlestep EI Determines if start stop or single step mode is used CaptionRun Run configure the behavior and D select what is to be displayed and appearance of AVTViewExecuteSimple whether ROIs can be edited Figure 3 4 Configuring and switching between the two execution modes With the property SingleStep you can modify the behavior with the other properties the button text ActivVisionTools 3 2 Your Fast Track to Solutions 36 Combining ActivView with other ActivVisionTools 3 5 Inspecting and Modifying Connections Between ActivVisionTools Via E ActivView is also in charge of the connections between the indivi
65. s a technical term the attribute real time means that a process guarantees that it meets given deadlines In a machine vision application real time behavior may be required both for the process of image grabbing e g an image must be grabbed while the part to be inspected is completely visible and for the actual image processing in order to be ready when the next part ActivVisionTools 3 2 Your Fast Track to Solutions 14 About ActivView i e the next image arrives _ Please keep in mind that Windows is no real time operating systems This means that the operating system itself does not guarantee that your process will get the necessary processing time before its deadline expires In other words all efforts for real time behavior are already thwarted at the basis From the point of view of a machine vision application running under Windows the most you can do is assure that real time behavior is not already prevented by the application itself Activ VisionTools supports this by parallelizing image grabbing and processing and by allowing to switch off various display and output activities in the application mode If your application has hard real time requirements concerning image grabbing there is one thing to note on the use of an external trigger In order to really synchronize the grabbing process with an external event the camera must be able to start grabbing a new image immediately as depicted in diagram G
66. s properties 3 when you drag a tool its valid destinations are marked in green and by the shape of the cursor Modifying the Connections Between Activ isionTools nu Connections m Code Type AV TYiewl AVTBarcode1D1 Refresh code 39 AVTView2 J7 Checksum AVTBarcode1D2 AVTViewConnectionsDialog r Code Type Ean 13 X I Checksum I Composite Detect Result Options IV Code V Code J Elements Display Resutts Result Options IV Code IV Position I Code I Region J Elements J Candidates IV Position I Region Candidates Figure 3 5 Modifying connections between ActivVisionTools ActivVisionTools 3 2 Your Fast Track to Solutions 38 Combining ActivView with other ActivVisionTools ActivView 2008 04 23 Chapter 4 Tips amp Tricks This chapter contains additional information that helps you to get optimal results when using ActivView Section 4 1 shows how to use the inspection tools ActivHistogram and ActivLine Profile to analyze image quality The chapter ends with a list of problems you might encounter when accessing your image acquisition device from ActivView together with tips how to solve them 4 1 Analyzing Image Quality 2 2 2 2 eee ee eee ee we eee 40 4 1 1 A First Look at ActivHistogram and ActivLineProfile 40 4 1 2 Analyze Satiration o e eee bee
67. sionTools automatically send their results back to ActivView to be overlayed ActivView 2008 04 23 1 1 Introducing ActivView 3 on the current image without any action required on your side With the help of AVTView DisplayModes one of the support tools of ActivView you can adapt the visualization to your needs colors drawing mode line width etc see section 3 2 on page 30 For a closer inspection of images ROIs and results ActivView provides a zooming mecha nism Moreover the three inspection tools ActivZoom ActivHistogram and ActivLineProfile are provided together with Activ View Calibration of the Size of a Pixel ActivView provides an easy to use interactive mechanism to calibrate the size of a pixel in a plane perpendicular to the camera If this mechanism is used all subsequent measurements are converted automatically from pixels to other units gt 2 lt Note that this calibration is not very accurate for high accuracy 3D measurements please use ActivGeoCalib Switching Between Execution Modes In an ActivVisionTools application there are two execution modes the configuration mode and the application mode This allows you to create two versions of your machine vision application one for its initial setup and configuration and one for the final running system ActivView provides a support tool for customizing the appearance of an application in the two modes and for switching betw
68. splay Acquisition Interface File gt Name Detect Refresh Device z Board Port m Input File Jpendulum pendulum seq X J z Choose Directory Choose File r Grabbing Execute Cse Connected More Parameters Single Run gt Trigger Save Image Save Window z 2 gt 2 lt a Fes 1 31 7 ms Loading fle pendulu rN V change the displayed part of the image if this box is checked you can change the using the other two scroll bars displayed part of the image by moving the mouse while pressing the left mouse button Figure 2 4 Zooming into the image ActivVisionTools 3 2 Your Fast Track to Solutions 24 Using ActivView 2 5 Calibrating Image Coordinates Using Using AVTViewCalibration you can determine the size of a pixel i e its height as square pixels are assumed by drawing a line in the image and specifying its length This information is passed on by Activ View to subsequent tools which use it to convert measurements from pixels to another unit Note that this conversion only works if the measured objects lie in the same plane i e at the same distance from the camera as the line whose length was specified For high accuracy 3D calibration ActivGeoCalib should be used isual Basi Laem Preparation for the following example Example If you worked on the p
69. st of image acquisition device containing those devices you want to appear in the combo box separated by a semicolon If the line already exists in the file you may modify it accordingly Note that if ActivView finds this line it will only check the names appearing in the list when detecting image acquisition interfaces initiated by clicking Detect in AVT ViewFG Note that it is not necessary to include File in the list to be able to load images from disk this entry appears automatically in the combo box There are three situations in which you need to modify the list of available image acquisition devices 1 The automatically detected list contains image acquisition devices which you do not want to appear in the combo box 2 You want to use your own HALCON image acquisition interface within Activ Vision Tools see section A 6 on page 64 3 In rare configurations incompatible driver DLLs from older installations of image ac quisition devices cause problems for the auto detection of image acquisition devices As a result Activ Viewer may crash when clicking Detect in AVIViewFG ActivView 2008 04 23 A 5 Setting Additional Parameters 57 A 5 Setting Additional Parameters AVTViewFG provides the basic functionality for acquiring images which is common to all image acquisition devices However many image acquisition devices provide additional functionality e g they might allow to modify the
70. sults IV Allow ROI editing V Allow Drag amp Drop AVTView1 AVTMeasurel Refresh ActivVisionTool AVTMeasure1 z V Kocie CalcEdgeAngleDistance False xecuteSimplet CalcEdgeDistance True ine ropertiest CalcEdgePairAngleCente False CalcEdgePairAngleCente False CalcEdgePairAngleExtent False CalcEdgePairCenter True fa Edges gt Edge Type CalcEdgePairCenterDista True CalcEdgePairvvidth True fedge Pairs Edge Grouping a First Last Edge 7 Edge Selectio reisan eoe OO i First Last Edge 4 gt feo Edge Strength All Edges 4 l g i Noise Level ping of successor edges with different transition f gt 15 Roiwicth rao pars Standard he Accuracy Ei AVTViewConnections ActivMeasure i AVTViewConfigExec i AVTViewProperties Figure 1 2 The sub tools of ActivView part 2 ActivVisionTools 3 2 Your Fast Track to Solutions 8 About ActivView 1 3 A Closer Look at Image Acquisition The process of image acquisition is the fundament of every machine vision application To continue this analogy one would like to set up this fundament only once and for well and then be able to concentrate on building the application itself Following the ActivVisionTools paradigm Activ View actively supports you in setting up image acquisition e g by interfacing automatically to the software provided by manufacturers of image acquisition devices and by
71. terest Using 4 Using AVTViewROI you can specify one or more regions of interest ROIs per Activ VisionTool Image processing will then be restricted to the corresponding parts of the image s Visual Basic Preparation for the following example Example If you worked on the previous example in chapter 2 on page 15 you may continue using this project At design time select AVTViewCalibration by clicking into it with the left mouse button and delete it by pressing Delete Instead add AVT Barcode1D to the form by double clicking the icon MI Otherwise open the project rois view_rois vbp Execute the application Open AVTViewFG by clicking on AVTView with the right mouse button and selecting Image Acquisition Load barcode ean13_08 The following steps are visualized in figure 3 1 ActivView 2008 04 23 Make sure that the check box at the lower right corner of the display is not checked Otherwise all subsequent mouse actions in the image will result in moving the displayed part of the image In the upper combo box of AVTViewROI all connected ActivVisionTools are displayed in this case only AVTBarcode1D1 which is therefore automatically selected as the re cipient of ROIs Not all ROI shapes are allowed for ActivBarcode Select for example an arbitrarily oriented rectangle by clicking To draw the rectangle in the image click into it with t
72. the parameter list and value ranges by clicking the button Refresh This is useful when a parameter change causes different value ranges for other parame ters e g when changing the camera type ActivView 2008 04 23 A 5 Setting Additional Parameters 61 if the box is checked all parameter changes are applied automatically rn Acquisition Parameters 13941100 _ Interface DLL M Connected IV Update Image Ic Program Files MYT ec HALCON bin x86sse2 win32 h4cq1 394IIDC DLL 3 2 m Parameter Selection egory All Parameter Visibility Beginne I Sort by Name Refresh m Acquisition Interface Parameters z 2 gt 2 lt camera_type eo sj E you can reset a parameter horizontal_offset oO to its default value vertical_offset ooo or reset all parameters horizontal_resolution pa 80t i sSOSOSOOSOSCS SCCS vertical_resolution 960 image_width 1280 4 image_height a60 4 5 SSIS ILS 15 51515 start_column fo start_row fO packet_size 640 brightness 700 qo a gamma Paramvalue al ae F you can refresh the parameter list and value ranges at any time Figure A 2 Setting parameters using AVTViewFGParameter continued ActivVisionTools 3 2 Your Fast Track to Solutions 62 Accessing Your Image Acquisition Device A 5 3 When Are Parameters Set As described above para
73. to Solutions 64 Accessing Your Image Acquisition Device Reading parameters To read a parameter s value you simply specify its name The following code uses this to read the currently selected port which is then displayed in a text box Dim iCurrentPort As Integer iCurrentPort AVTView1 GetFGParameterValue port TextCurrentPort Text iCurrentPort A 6 How to Access an Unsupported Image Acquisition Device If you want to use an image acquisition device which is currently not supported by Activ Vision Tools there are two principal ways If you are a HALCON user you might have already created a corresponding HALCON image acquisition interface section A 6 1 describes how to access this interface from Activ View Besides this you may feed images directly into Activ View this is explained in section A 6 2 on page 67 A 6 1 Accessing Your Own HALCON Image Acquisition Interface The task of accessing your own HALCON image acquisition interface includes three steps First the interface must be made visible i e it should appear in the combo box Name Secondly AVTViewFG must adapt its content when the image acquisition device is selected And thirdly you specify which additional parameters can be accessed in AVTViewFGParameter D Making the interface available The simplest way to select your HALCON image acquisition interface is to type its name in the combo box Name This setting is then automatically stored in the
74. to realize this behavior is discussed briefly below A detailed example for port switching can be found in the Advanced User s Guide for ActivVisionTools section 5 2 1 on page 147 Setting parameters Parameters are set by specifying their name and the desired value The following exam ple code reads a value from a text box and uses it to switch to another camera connected to the specified port Dim iPort As Integer iPort TextPort Text Call AVTView1 SetFGParameterValue port iPort Note that when you use the programming interface of ActivVisionTools you leave the safe world of the graphical user interfaces where all input is checked for validity auto matically Therefore we recommend to include error handling code e g as follows ActivView 2008 04 23 A 5 Setting Additional Parameters 63 i Setting Image Acquisition Parameters Yia the Programming 2 gt 2 lt i Set Port setting a parameter reading a parameter value Figure A 3 Setting and reading the port via the programming interface On Error GoTo ErrorHandler code accessing the programming interface Exit Sub ErrorHandler Dim sTitle As String If Left Err Source 11 ActivVTools Then sTitle ActivVisionTools Error Else sTitle Runtime Error amp CStr Err Number End If Call MsgBox Err Description vbExclamation sTitle End Sub ActivVisionTools 3 2 Your Fast Track
75. ts are supported BMP PNG GIF TIFF JPEG PNM PCX XWD AVI and binary Furthermore you can read sequences of images by using a special file format extension seq Instead of using sequence files you can also load all images in a directory consecutively The images are loaded sorted by name Subdirectories are not scanned Visual Basic Preparation for the following example Example Open the project imagefiles view_imagefiles vbp Alternatively create a new project and place AVTView AVIViewFG and AVTViewStatus on the form by double clicking the icons 1 and Ai respectively with the left mouse but ton Execute the application Run gt Start or via the corresponding button The following steps are visualized in figure 2 1 ActivView 2008 04 23 Switch the image input mode to File in the combo box Name AVI files can also be loaded in the mode DirectFile In the frame Input File you can now select among a list of image files provided with the Activ VisionTools CD from the combo box or open a file selector by clicking Choose File or Choose Directory The image is loaded and displayed when you press the Enter key Alternatively you can click Single to load or reload an image If you have selected an image directory or a sequence e g pendulum pendulum seq at each click the next image will
76. two cameras connected to the second board would be Picport Stereo H4 D 1 2 2 MultiCam The frame grabbers supported by this interface use two auxiliary files called mpf and camera file to adapt the grabbing to various cameras To select a camera file click on the button Choose File to open a file selection box The selected file without suffix cam is displayed in the upper combo box The mpf file can be selected in the lower combo box For some board types you can also specify the board topology by inserting the corresponding value e g 1_1 before the name of the mpf file separated by a colon C2 A 3 Detection of Image Acquisition Devices Upon starting ActivView inspects the host computer for image acquisition interfaces In a first step ActivView queries HALCON for a list of all supported image acquisition interfaces Furthermore it scans the dynamic libraries for additional image acquisition interfaces which are then also added to the list in the combo box Name Of course the presence of the DLLs does not necessarily mean that actual image acquisition devices are available for the corresponding interfaces Therefore when clicking Detect in AVTViewFG Activ View checks the presence of the devices by trying to communicate with them however not all image acquisition device SDKs allow this or create errors when trying to ac cess a not existing device Nevertheless if an image a
77. uisition devices or from files and also save them to disk How to use AVTViewFG is described in section 2 2 on page 18 AVTViewFGParameter is a support tool of ActivView not shown in figure 1 1 With it you can set special parameters of your image acquisition device interactively How to use AVTViewFGParameter is described in section A 5 on page 57 ka AVTViewStatus is a support tool of ActivView It displays the current status of an Activ VisionTools application How to use and configure AVTViewStatus is described in section 3 3 on page 32 AVTViewROI is a support tool of Activ View It enables you to assign regions of interest to other ActivVisionTools How to use AVTViewROI is described in section 3 1 on page 28 F AVTViewDisplayModes is a support tool of ActivView It allows to change the way results and H i i l ROIs are displayed How to use AVTViewDisplayModes is described in section 3 2 on page 30 z AVTViewCalibration is a support tool of ActivView By drawing a line shaped ROI in the image and specifying its length in a certain unit you can convert pixel coordinates into this unit How to use AVTViewCalibration is described in section 2 5 on page 24 ActivView 2008 04 23 1 2 The Sub Tools of ActivView 5 Tl avtview Hi avtviewstatus BP aavtviewra The Sub Tools of Activ iew r Acquisition Interface Fite X Name Detect Refresh Device Y Board z Port r Input File
78. xample on the next double page ActivView 2008 04 23 A 5 Setting Additional Parameters 59 D click here to open AVTViewFGParameter after connecting to the frame grabber information about it is displayed Setting Additional Para iojxi re Image Acquisition xj m Acquisition Interface 1394IIDC v Name Detect Refresh z Port Frame o Full Si 7 Size ul Size gt Interlaced v Field D lt rfs 388 142 9 ms Execute Stop IV Connected More Parameters Single Run I Trigger Save Image Save Window rtn Acquisition Parameters E jol xi m 1394IDC Interface DLL M Connected F Update Image Resetall C Program Files MVT ec HALCON bin xG6sse2 wind2 hAcq 234lIDC DLL 3 2 lt m Parameter Selection Category All Parameter 3 specify selection of displayed Visibility Beginner IT Sort by Name Refresh parameters if appropriate m Acquisition Interface Parameters camera_type horizontal_offset vertical_offset horizontal_resolution vertical_resolution oe 4 start to edit parameters ISIS ISLS 15 image_height start_column start_row packet_size brightness HARA gamma 5 Figure A 1 Setting parameters using AVTViewFGParameter ActivVisionTools 3 2 Your Fast Track to Solutions 60 Accessing Your Image Acquisition Device Before we show how to
79. xel height O O Then specify the length of the line you have drawn in the example the line drawn across the small card has a length of 3 7cm Press Enter to compute and display the height of a pixel ActivView 2008 04 23 2 5 Calibrating Image Coordinates 25 DO NOT check this box select AVTViewCalibration1 start to create a line by clicking this button iol x ia Calibrating the Size of a Pixel Je ea ica ed ed ad ea Copy Paste Delete _Deltean Select o ActivVisionT ool AVTViewCalibrationt 4 S Region of Interest fline_1 1 1 A 2 T Locked lt Unit cm v Length Line fp 70 lt Pizel Height fo 052723 Name User Defined Mode feo Calibration Save Load Reset select a unit in the combo box to draw the line in the image move the mouse while pressing the left button D specify the length of the line in this unit the computed pixel size is displayed edit the line by dragging the pick points at the end and in the middle measure distances in the image u p Length Line f 38 em by creating new lines Pixel Height 0 052723 cm Figure 2 5 Calibrating the size of a pixel Now you can measure distances in the image by creating new lines Note that the calibration is only valid for the logo Note that if you know the pixel size already you can specify it d
80. xtImage As Integer Select Case iNextImage Case 0 NextExternImagePtr VarPtr Image1 0 0 iNextImage 1 Case 1 NextExternImagePtr VarPtr Image2 0 0 iNextImage 2 Case 2 NextExternImagePtr VarPtr Image3 0 0 iNextImage 0 End Select 2 gt 2 lt End Function When you now click the button Single see figure A 4 the method SingleButton_Click is executed which gets the pointer to an image matrix and calls ExecuteExternImagePtr Besides making the image available to ActivVisionTools this method triggers a full execution cycle In the example project the gray value profile along one line is calculated and displayed using ActivLineProfile see section 3 2 on page 30 Private pExternImage As Long Private Sub SingleButton_Click pExternImage NextExternImagePtr Call AVTView1 ExecuteExternImagePtr pExternImage byte 64 48 True bDoRun False End Sub To integrate images in a continuous loop one has to take care that events are processed after each execution cycle by adding the line DoEvents Otherwise you could not even stop the loop by clicking on the button Stop ActivVisionTools 3 2 Your Fast Track to Solutions 70 Accessing Your Image Acquisition Device Private bDoRun As Boolean Private Sub RunButton_Click bDoRun True D L End Pri o pExternImage NextExternImagePtr Call AVTView1 ExecuteExternImagePtr pExternImage byte
81. y 3 Externally Triggered Grabbing In many machine vision applications image grabbing must be synchronized with a physical process e g by using photoelectric barriers that report when a part has arrived for inspection Most image acquisition devices allow to connect them to such an external trigger signal From the point of view of an ActivVisionTools application this mode works like parallel grabbing with the only difference that now the image acquisition device must wait for the trigger before it grabs the next image ActivView 2008 04 23 1 3 A Closer Look at Image Acquisition 13 frame 1 frame 2 frame 3 wait for grab wait for grab next frame frame next frame frame software device or i727 s grab f process 1 process 3 frame 1 frame 2 frame 3 grab grab grab grab frame frame frame frame device k M jM M software process process 1 process 2 process 3 z 2 gt Z lt G frame 1 frame 2 frame 3 external 52 5 2 trigger wait for grab wait for grab wait for grab trigger frame trigger frame trigger frame device grab software process process 1 process 2 Figure 1 5 sequential grabbing mode parallel grabbing ActivVision Tools default mode externally triggered parallel grabbing Real Time Machine Vision A
82. z 2 gt 2 lt ActivVisionTools 3 2 Your Fast Track to Solutions 48 Tips amp Tricks 4 2 Troubleshooting In this section you find information about how to solve problems regarding image acquisition If the information given does not solve your problem please have a look at the Activ VisionTools FAQ which can be found under http www activ vision tools com If your question is still not answered send a problem report by email to your local distributor not MVTec directly See the Getting Started with ActivVisionTools section 4 3 3 on page 48 for more information ActivView 2008 04 23 The image acquisition device does not appear in the combo box after clicking Detect Please check whether you correctly installed the image acquisition device As a first step use the test program most manufacturers provide with their device to check whether im ages are actually grabbed If it does not maybe the corresponding device driver was not installed successfully or the driver is not started check the Windows Device Manager the driver should be started automatically If the driver is running check whether the environment variable PATH contains the direc tory where the DLLs of the SDK of the image acquisition devices reside Finally check whether the directory ZHALCONROOT bin x86 win32 contains the HALCON image acquisition interface f

Download Pdf Manuals

image

Related Search

Related Contents

eBioo® - Soft  Manual de Usuario - Español  Clique aqui para baixar o Manual Supervisão de Obras  

Copyright © All rights reserved.
Failed to retrieve file