Home

ActivMeasure User`s Manual

image

Contents

1. rv vTFileOptions Limitations IV Limit File Size peles set v Enable Writing yj A TOutputDataSelect 7 m ni x General Tool ROI Object IV Date and Time V Name IV Name V Name I Tags IV okay IV okay IV okay Path J amp VTMeasurel B AVTMeasurel Tool ROI Object okay Value Min Max Interpretation Operation E Line 1 AV TMeasurel Objects To Good Object Good Object Tool Bad Objects Bad Objects Tol Good ROIs Bad ROls Line_1 Objects ROI Good Objects ROI Bad Objects ROI Good Objects width Distance Center Bad Objects Width XITXIXLTI 3334 04009000707 99999999954 499594090971 BEEEEHEREEEN 4399719949977 4 gt Distance Center 1 V D navigate through the results select the output data Figure 3 3 Customizing log files object By clicking on the column labels with the right mouse button you can check or uncheck all boxes in the column similarly you can check or uncheck whole rows or all rows of a certain tool If you now step through the image sequence by clicking Single in AVTViewFG the log file is created Figure 3 4 shows part of an example log file ActivVisionTools 3 2 Your Fast Track to Solutions 24 Combining ActivMeasure with other ActivVisionTools 09 11 04 15 26 10 AVTMeasurei yes Bad ROIs Line_1 yes Objects ROI Bad Objects ROI 0 yes Width 1 yes Wid
2. AxAVTMeasurei Then You can query the overall evaluations at different levels tool ROI or object Dim atROIResult As AVTROIResult Dim bToolIsOK As Boolean bROIIsOK As Boolean bObjIsOK As Boolean Set atROIResult atMeasureResult ROIResults 0 bToolIsOK atMeasureResult Evaluation bROIIsOK atROIResult Evaluation b0bjIsOK atROIResult ObjEvaluation 0 Furthermore you can access the evaluation of individual features like the measured width of the object with the ID 0 but also of tool features e g the evaluation of the number of bad ROIs or of ROI features e g the evaluation of the number of objects in the ROI via the corresponding feature handle In contrast to object features the handles for tool and ROI features are available as properties of ACTIVVTOOLSLib AVTToolResult ActivVisionTools 3 2 Your Fast Track to Solutions ActivMeasure 38 Tips amp Tricks iw Accessing the Results via the Programming Interface Bi x flight gt Dark Edge Type Edge Pairs gt Edge Grouping ades Edge Selection AS gt l 0 Edge Strength A 1 gt 2 Noise Level 3 fio Rot width Standard z Accuracy Width 1 Mean 0 54 Widh2 Mean 0 56 Number of Good Cycles 19 r Execution Application v Mode Execute Slaves Single E Stop Cycle 37 object 1 has wrong width 0 734561649736938 Cycle 38 object 0 ha
3. a pair respectively 3 color of the different ROI types o color of objects evaluated as not okay 4 look up table for image display color for highlighting selected objects 5 line width of the ROIs or 9 display mode for edges of the edges Figure 4 1 Modifying the display of results and ROls in the tree of ActivDecision To test the effect open ActivDataView by clicking on AVT Measure with the right mouse button and selecting Data View in the appearing context menu then click on one of the objects which is automatically highlighted in AVTView 9 If you check this box the edges are framed with a contrasting color ActivVisionTools 3 2 Your Fast Track to Solutions 28 Tips amp Tricks 4 2 Configuring the Two Execution Modes Via and H In an ActivVisionTools application you can switch between two execution modes the config uration mode and the application mode The former should be used to setup and configure an application the latter to run it ActivView s support tools AVTViewExecute and AVTView ConfigExec allow you to switch between the two modes and to customize the behavior of an Activ VisionTools application in the two execution modes e g 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 A third sub tool AVTViewExecuteSimple provides a single button to execute the application AVTVi
4. arcs of measurement because the direction of the edges is always perpendicular to the line or arc of measurement For this reason all angular features of measurement lines are equal to zero The angular features of measurement arcs are derived from the angles of the displayed edges which are perpendicular to the measurement arc These edges are not necessarily identical to the edges in the image Output of Results Measured features can be displayed using ActivDataView or ActivFeatureHistogram and then further evaluated using ActivDecision before you output them via ActivFile ActivSerial or Ac tivDigitalIO furthermore you can access results via the programming interface see section 4 3 on page 30 1 2 The Sub Tools of ActivMeasure Besides its master tool ActivMeasure provides 2 support tools In figure 1 5 they are depicted together with other ActivVisionTools that you will use in a typical ActivMeasure application ActivMeasure 2008 04 23 1 2 The Sub Tools of ActivMeasure 5 ActivView Hi AvrMeasure ia The Sub Tools of ActiyMeasure Bi x r Edit Region of Interest af e Z G e c Copy Paste Delete Delete All r Select ActivVisionTool ANVTMeasure1 ha Region of Interest Line 1 111 4 gt F Locked ActivMeasure Light gt Dark Edge Type Edge Pairs v Edge Grouping All Edges v Edge Selection Ed
5. calculated as well as the angular pair width the angle of the pair centers and the angular distance between successive pair centers Note that the angular features provide meaningful information only for arcs of measurement for lines they are zero To view the calculated features enable the update of results in AVTDataView and select the tool whose results to display in the combo box ActivVisionTool If there is only one tool as in our example it is selected automatically Automatically a list of the ROIs of AVTMeasure1 appears Select the ROIs whose re sults you want to examine by checking their box Their results are then displayed in a table spreadsheet The columns correspond to the selected features the rows to the ex tracted objects If you chose to group edges to pairs i e if you selected Edge Pairs in the combo box Edge Grouping each edge pair corresponds to an object otherwise objects correspond to single edges ActivMeasure 2008 04 23 2 3 Selecting Results 15 IEEE select results types lower ones only for edge pairs Selecting Results iol x ActivMeasure flight gt Dak T Edge Type Edge Pars gt Edge Grouping fallEdaes T Edge Selection A o gt o Edge Strength Af Bo Noise Level 3s n0 nor width Standard E Accuracy r Edge Feature Selection Positions v Angles IV Distances Angl Dist
6. full flexibility In this section we show how to access the measurement and evaluation results via the program ming interface With this you can e g realize an application specific graphical user interface perform additional processing on the results or send results to a special output device Detailed information about the programming interface can be found in the Reference Manual As in the previous sections the examples stem from Visual Basic 6 0 if the ActivVisionTools specific code differs in Visual Basic NET the corresponding lines are also shown for the first appearance only For other NET languages or C please refer to the Advanced User s Guide for Activ VisionTools section 1 2 3 on page 5 and section 1 3 4 on page 28 respectively Please note that we assume that readers of this part have at least a basic knowledge of Visual Basic To work with the programming interface in VB 6 0 you must first add the Activ Vision Tools type library to the project s references by checking the box labeled ActivVisionTools Type Library in the menu dialog Project gt References In Visual Basic NET the ref erence is added automatically References datacode resultaccess vbp xj Available References M Visual Basic For Applications M Visual Basic runtime objects and procedures sual Basic objects and procedures Is 3 1 Type Library lelper COM Component 1 0 Type Library CO IAS RADIUS Protocol 1 0 Type Libr
7. image Change the line width or the ROIs or of the edges amp 9 9 ActivVisionTools assigns results to two groups to allow to display them using dif ferent colors If you selected A11 Edges in the combo box Edge Grouping of AVTMeasure all extracted edges belong to group I In contrast if you selected Edge Pairs the first edge of each pair is assigned to group I and the second edge to group II Change the color of these groups 7 Change the color ActivDecision uses to mark objects evaluated as not okay Change the color used for highlighting objects if you click on them in ActivDataView or ActivMeasure 2008 04 23 4 1 Adapting the Display of Results 27 o open AVTViewDisplayModes via a click on AVTView with the right mouse button ia Adapting the Display ActivMeasure m Display Region of Interest r Display Results AciveRO NN X Group Cyan E le Error ROI los Group Il I Green y j Selected Tool Gen Error ne le Inactive Tools Ei Magenta gt Selected Yellow is Special B Magenta m DisplayMode Marin 7 Pick Poit Red z Line Width Line Width Text 2 Pixels m Display Image LUT E defaut 1 color of the selected pick point Text Background Contrasting Contours colors of the first and second edge of
8. is described in section 2 2 on page 10 E AVTMeasureResults is a support tool of ActivMeasure It allows you to select which measure ments are to be performed How to use AVTMeasureResults is described in section 2 3 on page 14 ActivMeasure 2008 04 23 Chapter 2 Using ActivMeasure This chapter will explain how to use ActivMeasure to measure distances between edges along lines or arcs It describes how to create the different types of lines of measurement how to parameterize edge extraction and the types of measurements that can be taken The corresponding Visual Basic projects show how to solve an example measuring task 2 1 Specifying the Line of Measurement llle 8 22 Extraehng Edges s uoles rcg o e y Rm ERR Roy RES 10 2 3 Selecting Results ss assessed t re ETT SE 14 ActivMeasure Using ActivMeasure Visual Basic Example 2 1 Specifying the Line of Measurement Using tr ActivMeasure lets you choose between two shapes of measurement lines straight lines or circular arcs To get more robust results you can let ActivMeasure average pixel values in a certain margin perpendicular to the line or arc To facilitate the creation of very wide averaging margins along a line you can directly create a rectangle You specify a line of measurement using AVTViewROI which is a support tool of ActivView Preparation for the following example Open the pr
9. with this parameter until all edges are successfully extracted Note that the ROI width can be set for each ROI individually all other parameters can be set only once per tool In the combo box labeled Accuracy you can choose the method of averaging In normal cases Standard is sufficient the other variants take considerably more computing time and should be used only in case of high accuracy measurements along arcs or in thin rectangles or lines that are oriented arbitrarily ActivMeasure 2008 04 23 2 2 Extracting Edges 13 5 if the image is noisy you can smooth it using the slider the smoothed profile is depicted in red in the profile iw Extracting Edges A x ActivMeasure i Dark gt Light Edge Type Edge Pars T Edge Grouping i L j f Jalledges Tl Edge Selection i ee Pe CIE ee NAPS n ha i 3 Rol width Standard iv Accuracy a rectangular ROI 6 select the width of averaging fixed in the case of select the accuracy of averaging Figure 2 3 Specifying the edges that are to be extracted cont ActivVisionTools 3 2 Your Fast Track to Solutions 14 Using ActivMeasure Visual Basic Example 2 3 Selecting Results Using jE Up to now we have just extracted edges i e the starting points for our measurements Using AVTMeasureResults you can specify what is to be measured between the edges Thes
10. 3 2 Your Fast Track to Solutions 22 Combining ActivMeasure with other ActivVisionTools Visual Basic Example 3 3 Output of Results Using Using ActivFile you can write the results and the evaluations to a log file How to access results via the programming interface is described in section 4 3 on page 30 how to output them via a serial interface or a digital I O board in the User s Manual for ActivSerial and the User s Manual for ActivDigitalIO respectively Preparation for the following example If you worked on the previous example you may continue using this project At design time add AVTOutputFile by double clicking Ll Otherwise open the project output measure_output vbp Execute the application and load the image sequence fuse fuse1 seq The following steps are visualized in figure 3 3 not shown AVIView AVTMeasure Q By clicking on Select you can open a file selector box to choose a file name for the log file which will then appear in the text field beside the button By pressing Clear File you can clear the content of the selected file By checking v Enable Writing you enable the writing mode You can open the ActivFile s two dialogs DialogFileOptions and Dialog utput DataSelect by clicking File Options and Data Selection respectively In DialogFileOpt
11. Is are displayed using AVTViewDisplayModes which is a support tool of ActivView Visnal Basic Preparation for the following example Example If you worked on the example in the previous chapter you may continue using this project Otherwise open the project display measure_display vbp and execute it Run gt Start or via the corresponding button Load the image sequence fuse fusel seq and create additional ROIs AVTView FG and AVTViewROI can be opened at run time via a right mouse button click on AVTView The following steps are visualized in figure 4 1 Experiment by choosing different settings for the display parameters and watching the result O Open AVTViewDisplayModes by clicking on AVTView with the right mouse button and selecting Display Modes in the popup menu Q Change the color of the selected pick point Select another pick point by clicking into its vicinity Change the color of the currently selected ROI Select another ROI by clicking into its vicinity Change the color of the other not selected ROIs of the currently selected tool Change the color of the ROIs of the other not selected tools As a second tool you can open AVTViewCalibration via a right mouse button click on AVTView and create an ROI for it If you use ActivDecision to evaluate results it can mark ROIs evaluated as not okay in a special color Change the LUT look up table that is used to display the
12. Measure with other ActivVisionTools Visual Basic Example 3 2 Evaluating Results Using Ei In the former examples you have employed ActivVisionTools to extract and display measure ment results Using ActivDecision you can evaluate these results by formulating conditions the results have to meet in order to be okay For a detailed description of ActivDecision please consult the User s Manual for ActivDecision In our example measuring application fuse types can be differentiated by the width of the wire for 25 mA fuses this width should lie between 0 5 and 0 6mm Preparation for the following example If you worked on the previous example you may continue using this project At design time add AVTDecision to the form by double clicking EH with the left mouse button Otherwise open the project decisions Wneasure decisions vbp Execute the application and load the image sequence fuse fuse1 seq The following steps are visualized in figure 3 2 not shown AVTView and AVTMeasure D The main functionality of ActivDecision is presented by its support tools which can be opened via clicking on AVTDecision with the right mouse button The master tool displays the overall evaluation of the application Q To view the current feature and evaluation results check v Enable Update in AVT DecisionViewResults GB ActivDecision lets you compare the value of an individual objec
13. OIResult or by specifying its index in a call to the method ROIResults The following code uses the latter method to access the first ROI of AVTMeasure1 Dim atROIResult As AVTROIResult Set atROIResult atToolResults R IResults 0 Now we can e g query the number of objects extracted in the ROI via Dim iNum bjects As Integer iNum bjects atROIResult bjectNum Actual measurement results for an object i e the calculated values of features like Distance or Width can be accessed by specifying the feature of interest and the ID of the object in a call to the method ObjectValue of ACTIVVTOOLSLib AVTROIResult The feature handles are available as methods of the corresponding tool e g AVTMeasure FeatureHandlePairWidth being the handle for the measured width The following code fragment uses another method of ACTIVVTOOLSLib AVTROIResult Ob jectValues which returns the values of all objects for the specified feature in an array to calculate the mean width Dim handleWidth As Integer i As Integer Dim vWidthArray As Variant Dim dSumWidth As Double dMeanWidth As Double handleWidth vWidthArray dSumWidth 0 For i 0 To iNum0bjects 1 dSumWidth dSumWidth vWidthArray i Next dMeanWidth dSumWidth iNum bjects AVTMeasurei FeatureHandlePairWidth atROIResult ObjectValues handleWidth A general difference in Visual Basic NET is that instead of the type Variant you must use Object when accessing multiple values Dim
14. User s Manual Acr EASURE ccuracy Meets Speed 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 _mvreeseftware cmon Edition 1 November 2000 ActivVisionTools 1 0 Edition 2 April 2001 ActivVisionTools 1 3 Edition 3 September 2001 ActivVisionTools 2 0 Edition 4 November 2002 ActivVisionTools 2 1 Edition 5 January 2005 ActivVisionTools 3 0 Edition 6 February 2006 ActivVisionTools 3 1 Edition 7 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 ActivMeasure to measure distances between edges along lines or arcs It describes the functionality of ActivMeasure and its cooperation with other Activ VisionTools with Visual Basic examples Before reading this manual we recommend to read the manual Getting Started with Activ VisionTo
15. VTViewCalibrationi 2 the mouse while pressing the left button m 3 D edit the line by dragging the pick points click to create a line shaped ROI gt Z O lt lol x iw Converting Results into Other Units r Edit Region of Intere BI 2 s 4 el els A Copy Paste Delete Delete All r Select ActivVisionT ool ANTViewCalibration1 v 4 Region of Interest Line_2 1 1 4 gt Locked Select ActivVisionTool AVTMeasurel gt Rol CNN Length Line Pixel Height 0 025568 mm Object Id Row 1st Column 1st Row 2nd Column 2nd Width Distanci Name User Defined 8877 13678 8310 13678 0567 2124 6 763 13679 amp 176 13679 0587 Mode oo Calibration Save Load Reset MEET IV Enable Update 5 select a unit 7 results are converted into the selected unit mu 6 specify the length of the line the computed pixel size is displayed Figure 3 1 Converting measurements into other units 6 Then specify the length of the line 4 5 in the text box Length Line and press AVTViewCalibration now calculates the height of a pixel in mm and Enter displays it in the text box Pixel Height 7 Automatically all measured distances and positions are converted into the selected unit ActivVisionTools 3 2 Your Fast Track to Solutions 20 Combining Activ
16. ances Amplitudes IV Pair Widths v Pair Width Angles JV Pair Centers Pair Center Angles Pair Center Distances Pair Center Angle Distances r Select ActivVisionT ool AVTMeasurel x ROI BOLIA Les Id wigih Distanse Pat Row Center Folumn Lente Angle Tti Angle 2nd Angle width Oo 126 552 483000 138 725 483 000 152 308 483 000 155 085 483 000 179 267 483 000 192 493 483 000 m Circular n d 173 323 415 397 Circular rc 1 z 173 880 410 543 Circular Arc_1 169 077 404 767 Circular Arc 1 165315 399 383 Circular Arc_1 161 805 393 384 Circular Arc_1 r z 158 700 386 874 v Enable Update Unit Pixel enable the update of results and select one or more ROIs whose _ select AVTMeasure1 in the combo box results are then displayed Figure 2 4 Selecting what is to be measured You can also display the distribution of the calculated feature values in a histogram using Ac tivFeatureHistogram which can be opened by clicking on AVTView with the right mouse button and selecting Feature Histogram in the appearing context menu ActivVisionTools 3 2 Your Fast Track to Solutions 16 Using ActivMeasure ActivMeasure 2008 04 23 Chapter 3 Combining ActivMeasure with other ActivVisionTools While the previous chapter explained how to get measurement results this chapter focuses on how to further evaluate and output the results usin
17. ary Acrobat Priority C Acrobat Access 2 0 Type Library Help O Acrobat Access 3 0 Type Library gt l C Acrobat Distiller Ll Acrobat WebCapture 1 0 Type Library C Acrobat WebCapture IE Toolbar Favorites 1 0 Type L lAcroIEHelper 1 0 Tvpe Library of ActivVisionTools 3 1 Type Library Location C Program Files MvTeclActivVisionToolslbinlib86 nt4VActivVT Language Standard ActivMeasure 2008 04 23 4 3 Accessing Results Via the Programming Interface 31 4 3 1 Accessing Measurement Results The principal idea behind accessing the results of an ActivVisionTool is quite simple When a tool has finished its execution it raises an event called Finish sending its results as a parameter If you want to access the results all you have to do therefore is to create a corresponding event procedure which handles the event Within the Visual Basic environment you can create event procedures very easily as shown in figure 4 3 In the header of the form s code window there are two combo boxes Select the instance of AVTMeasure by default called AVTMeasure1 in the left combo box The right combo box then lists all events available for this object when you select Finish the event procedure is created automatically Within this procedure the measurement results are now accessible via the object variable atToolResults li Project Form1 Code ni xj AVTMeasuret w Finish v Private Sub AVTMeasurel_Fini
18. dark and one from dark to light or vice versa Note that if you choose this mode Edge Pairs the value selected in Edge Type determines whether grouping starts with the first edge A11 Edges with the first Light Dark or the first Dark Light edge With the help of the combo box Edge Selection you can further reduce the number of edges to the First Edge the Last Edge or both the First Last Edge With the slider Edge Strength you can specify the minimum strength of the edges to be extracted The strength of an edge corresponds to the gradient of intensity This relation becomes clear when looking at the intensity profile depicted in AVTMeasure Graph Edges are extracted at points where the intensity rises or falls quickly Their strength is visualized by the bold bars the red ones denote edges that are above the threshold the magenta ones fall short of the threshold by up to ten percent Experiment with the slider to get a feeling for this parameter You can also drag the horizontal line in AVTMeasureGraph to change the minimum strength As a rule of thumb keep the line a bit below the bars of those edges you want to be extracted and ActivMeasure 2008 04 23 2 2 Extracting Edges 11 choose the edge type direction of intensity change 4 are edges to be grouped to pairs ActivMeasure select special edges ia Extracting Edges Edge Type 4 Edge G
19. e results also called features are then sent to subsequent Activ VisionTools e g ActivDecision Preparation for the following example If you worked on the previous example you may continue using this project At design time add AVTMeasureResults and ActivDataView to the form by double clicking Bz and EE respectively You may remove AVTMeasureGraph it can be opened at run time by clicking on AVTMeasure with the right mouse button and selecting Graph Execute the application Run gt Start or via the corresponding button Otherwise open the project results measure_results vbp Execute the appli cation Run gt Start or via the corresponding button Load the image chipNchip 01 and create one or more ROIs AVTViewFG and AVT ViewROI can be opened at run time via a right mouse button click on AVTView The following steps are visualized in figure 2 4 O Select the features to be calculated by checking the corresponding box in AVTMeasure Results Available features for single edges are their position in the image their ampli tude strength and the distance to the next edge If edges are grouped to pairs i e if you selected Edge Pairs in the combo box Edge Grouping additional features can be selected the pair width the position of the center of a pair and the distance between pair centers Furthermore the angle of the edges and the angular distance between them can be
20. e using this project At design time add AVTViewCalibration to the form by double clicking Ei with the left mouse button You may remove AVTMeasureResults it can be opened at run time by clicking on AVTMeasure with the right mouse button and selecting Features Otherwise open the project units measure_units vbp Execute the application Run gt Start or via the corresponding button and load the image fuse fuse25_01 If necessary place an ROI for AVTMeasure over the fuse wire as shown in figure 3 1 AVTViewFG and AVTViewROI can be opened at run time via a right mouse button click on AVTView The following steps are visualized in figure 3 1 not shown AVTMeasure D You create the line of known length using AVTViewROI First select AVTViewCalibra tioni in the combo box ActivVisionTool To start creating the line click 7 To draw the line move the mouse in the image while keeping the left mouse button pressed As before you can position the line precisely by dragging the pick points Place it as shown in the figure this distance corresponds to 4 5 mm on the car fuses O Now switch your attention to AVTViewCalibration Select the desired unit mm in the combo box Unit The labels below denoting the unit will automatically switch to the selected unit ActivMeasure 2008 04 23 3 1 Converting Results to Other Units 19 9 to draw the line in the image move D select A
21. ewStatus another sub tool of Activ View lets you inspect the status of your application isual Basi d ade Preparation for the following example Example If you worked on the previous example you may continue using this project At design time add AVTViewExecuteSimple and AVTViewStatus to the form by double clicking the icons Bx and Fj with the left mouse button Otherwise open the project usermodes measure usermodes vbp Execute the application and load the image sequence fuse fuse1 seq The following steps are visualized in figure 4 2 not shown AVTMeasure D Open AVTViewExecute and AVTViewConfigExec by clicking on AVTView with the right mouse button and selecting Execution and Execution Parameters Q Switch between the two execution modes via AVTViewExecute s combo box Mode GB To execute one cycle press Single With the other two buttons you can let the appli cation run continuously and stop it again By default AVTViewExecuteSimple starts and stops an application how to change its behavior to a single step button is described in the User s Manual for Activ View section 3 4 on page 34 D 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 thi
22. ext to it in the image Alternatively use the two arrow buttons 4 k to step through all the ROIs of the selected tool ActivVisionTools 3 2 Your Fast Track to Solutions 10 Using ActivMeasure Visual Basic Example 2 2 Extracting Edges Using jf and q While you created and modified ROIs ActivMeasure already started to work and extracted edges along the ROIs i e the lines of measurement We now show how to specify what is to be extracted Preparation for the following example If you worked on the previous example you may continue using this project At design time add AVTMeasureGraph by double clicking ft You may remove AVT ViewROI Otherwise open the project edges Nneasure edges vbp Execute the application Run gt Start or via the corresponding button and load the image chipNchip 01 If neccessary place a line shape ROI as shown in figure 2 2 AVTViewFG and AVTViewROI can be opened at run time via a right mouse button click on AVTView The following steps are visualized in figure 2 2 Q In the combo box Edge Type you can select the type of edges you want to be extracted e g only edges where image intensity changes from light to dark Note that the direction of measuring is indicated by an arrow on the ROI In the combo box Edge Grouping you can choose whether edges are to be grouped to pairs i e one edge from light to
23. ffect of the error handler de select the feature Width in AVTMeasureResults Private Sub AVTMeasurei Finish atToolResults As _ ACTIVVTOOLSLib IAVTToolResult variable declarations On Error GoTo ErrorHandler procedure body 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 Call SetAlarm End Sub By placing the following code at the beginning of the event handler the actual result access is restricted to the application mode With this mechanism you can setup the vision part of your ActivVisionTools 3 2 Your Fast Track to Solutions ActivMeasure 36 Tips amp Tricks application in the configuration mode without having to worry about run time errors If Not AVTView1 ExecutionMode eApplicationMode Then TextWidthi Caption TextWidth2 Caption Exit Sub End If 4 3 2 Accessing Evaluation Results The evaluation results can be accessed similarly to the measurement results in fact they are even stored in the same object However to access the evaluation results you now have to wait for ActivDecision to finish i e create the following event procedure Private Sub AVTDecisioni_Finish atToolResults As Collection End Sub Note that you will get a run time error if you try to access e
24. g other ActivVisionTools How to access results and evaluations via the programming interface is described in chapter 4 on page 25 In the corresponding Visual Basic projects the task is to examine car fuses 3 1 Converting Results to Other Units e eee 18 32 Evaluating Results celer 20 33 Output of Results 45 524r tr t t 9 t e ws 22 17 ActivMeasure 18 Combining ActivMeasure with other ActivVisionTools 3 1 Converting Results to Other Units Using In section 2 3 on page 14 distances and positions were measured in image coordinates i e pixels Using AVTViewCalibration you can convert these measurements into other units Note that for a more accurate calibration you should employ ActivGeoCalib The main idea behind AVITViewCalibration is that the user draws a line in the image and tells Activ VisionTools that the length of this line is in a certain unit From this information AVT ViewCalibration calculates the size of a pixel i e its height as square pixels are assumed in this unit which in its turn can be used to convert measurements from pixels into the new 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 isual Basi AL PR Preparation for the following example Example If you worked on the example in the previous chapter you may continu
25. ge Feature Selection Positions Angles BL es aa i Sonn Distances Angle Distances a e B Noise Level Amplitudes hz fio ROI Width v Pair widths JT Pair Width Angles Standard gt Accuracy v Pair Centers J Pair Center Angles IV Pair Center Distances J Pair Center Angle Distances m Select ActivVisionTool avTMeasuret gt ROI CER Column Cent m 5473 246 532 1 5 22 13 186 81 000 259 538 2 5101 13214 81 000 272 594 3 4995 13094 81 000 285 307 4 4908 13072 81 000 299 002 5 4831 13482 81 000 312074 6 4828 13 18 81 000 325 266 M JV Enable Update Bz AVTMeasureResults ActivDataView B AVTMeasureGraph Figure 1 5 The sub tools of ActivMeasure together with suitable other tools AVTMeasure is the master tool of ActivMeasure With it you can select which kind of edges EH are to be extracted and whether they are to be grouped to pairs Furthermore you can control image processing to make sure that you get those edges you want How to use AVTMeasure is described in more detail in section 2 2 on page 10 ActivVisionTools 3 2 Your Fast Track to Solutions 6 About ActivMeasure az AVTMeasureGraph is a support tool of ActivMeasure It displays the line profile i e the pixel values along the line of measurement together with the position of the edges Thereby it helps you to select suitable image processing parameters How to use AVTMeasureGraph
26. get familiar with the ROIs To finely position an ROI you can zoom the image and move the displayed part using the scrollbars to the right and below the image To create a second ROI repeat step Q You can also copy paste and delete the selected ActivMeasure 2008 04 23 2 1 Specifying the Line of Measurement 9 ia Specifying the Line of Measurement amEdges z Edge Type amEdges z Edge Grouping JallEdges v Edge Selection s f j 20 Edge Strength Af gt B Noise Level 3H vif nor win Standard v Accuracy ActivMeasure r Edit Region of Interest 2 el 2 zl 2 of 51 cj Copy Paste Delete Delete All le r Select ActivVisionT ool AVTMeasure1 E Region of Interest Line 1 171 4 gt Locked select AVTMeasure1 edit the ROI by dragging the pick points in the combo box copy paste and delete the selected ROI or delete all ROIs select a shape for the ROI lock the selected ROI draw the ROI in the image by moving the mouse while pressing the left mouse button C e eo step through the ROls of the selected tool with these buttons Figure 2 1 Creating the lines of measurement ROI or delete all ROIs 6 By checking v Locked you can lock the selected ROI and thus prevent it from acci dental editing D ROIs can be selected by clicking n
27. has been evaluated as not okay Again a corresponding error message is created this time containing the measured width of the object The following code shows how to access the indices of all objects evaluated as not okay Dim badObject As Variant If atROIResult FeatureEvaluation handleBadObjectsInROI False Then gt get all bad objects cause bad width For Each badObject In atROIResult BadObjectIndices errorMsg Cycle amp iNumCycles amp object amp badObject amp _ has wrong width amp _ atROIResult ObjectValue handleWidth badObject amp Call DisplayMessage errorMsg Next End If ActivVisionTools 3 2 Your Fast Track to Solutions ActivMeasure
28. ine 1 Good Objects Toolf 0 0 100 Number None C ROI Featured Bad Objects Tool 12 0 100 Number None Object 0 Good ROIs 0 10 Number None 2 0 Object 1 Bad ROIs 1 0 Number Max ine 1 Objects ROI 2 2 Number zMax Good Objects ROI 40 100 Number None Bad Objects ROI 12 0 0 Number Max Object 0 Width 0 699 0 500 0 600 Number Inside e Object 1 Width 0 735 0 500 0 600 Number Inside v Enable Update IV Fit Cell Size w Substitute Default Unit mm fd 3 AYTDecision iewDefaults a Path E AVTMeasurel Line 1 Objects ROI 0 100 Number Good Objects RO 0 100 Number None Bad Objects ROI 0 100 Number None Width 0 500 1 243 Number None Width 0 500 0 600 Default Inside Unit mm IV Fit Cell Size Substitute Default 6 check this box to show the used parameters 5 specify default conditions Figure 3 2 Formulating conditions to evaluate results meet the conditions 5 In the example application both extracted wires should meet the same condition Instead of specifying the same conditions for each object you can specify default conditions us ing AVTDecisionViewDefaults Defaults can be set per tool or per ROI ROI defaults override tool defaults and individual conditions override defaults 6 If you check v Substitute Default the entries marked Default are substituted by their actual content ActivVisionTools
29. ions you can choose between two file formats Standard text suffix txt and the so called comma separated values files suffix cvs which can be used as an input to Microsoft Excel Furthermore you can select a delimiter In the same dialog you can limit the size of the log file in form of the number of cycles that are to be recorded A cycle corresponds to one processing cycle from image input to the evaluation and output of results If you use this option ActivFile creates two log files and switches between them thus assuring that you can always access at least the results of the last N cycles N being the specified number of cycles By pressing Estimate you can let ActivFile estimate the size of one cycle Note that you must first select the output data in order to get meaningful results In the left part of DialogOutputDataSelect you can navigate through the result hi erarchy similarly to ActivDecision In the right part of DialogOutputDataSelect select the output data by checking the corresponding boxes You may output different items depending on the evaluation of an ActivMeasure 2008 04 23 3 3 Output of Results 23 O select the name of the log file select file format and delimiter 2 check to enable writing limit the file to a number of cycles 8 click to open the dialogs 6 estimate the file size for one cycle ActivMeasure ia Wril ing Results to a Log File
30. le Private bIsNewCycle As Boolean Private Sub AVTView1_CycleStart bIsNewCycle True End Sub Before calculating the mean values within the handler for AVTMeasure s event Finish this ActivMeasure 2008 04 23 4 3 Accessing Results Via the Programming Interface 35 variable is checked and immediately reset If bIsNewCycle True Then iNumGoodCycles iNumGoodCycles 1 bIsNewCycle False dSumWidthi dSumWidthi dWidthi dMeanWidthi dSumWidthi iNumGoodCycles dSumWidth2 dSumWidth2 dWidth2 dMeanWidth2 dSumWidth2 iNumGoodCycles TextMeanWidthi Caption Format dMeanWidthi Fixed TextMeanWidth2 Caption Format dMeanWidth2 Fixed End If You can test this behavior by moving or modifying the ROI The new widths are displayed while the mean values remain constant When using the programming interface of ActivVisionTools you leave the safe world of the graphical user interfaces where all input is checked for validity automatically In contrast if you try to access a non existent object or result via the programming interface a run time error is caused which terminates your application To avoid this you can use the Visual Basic error handling mechanisms i e set up an error handler which examines any occurring error and reacts in a suitable way In the example project if an error is caused by the result access a dialog with the error description pops up and the function SetAlarm is called To view the e
31. ls 3 2 Your Fast Track to Solutions 34 Tips amp Tricks First of all the measurement results are only to be read and displayed if exactly two objects have been extracted If iNumObjects 2 Then dWidthi atROIResult ObjectValue handleWidth 0 dWidth2 atROIResult ObjectValue handleWidth 1 TextWidth1 Caption Format dWidthi Fixed TextWidth2 Caption Format dWidth2 Fixed If bIsError True Then Call ClearAlarm End If Else TextWidthi Caption TextWidth2 Caption Call SetAlarm End If If not exactly two objects are extracted the function SetAlarm stops the application by setting AVTView s property RunState to False and switches the color of the element beside the number of good cycles to red The function ClearAlarm resets the color to green Test this behavior by modifying the ROI such that in some images only one object is extracted and then starting the continuous execution Private bIsError As Boolean Private Function SetAlarm AVTView1 RunState False Light BackColor vbRed Private Function ClearAlarm Light BackColor vbGreen bIsError False End Function When calculating the mean values one has to keep in mind that AVTMeasure is executed not only when the next image is grabbed but also whenever you modify its ROI s or parameters To distinguish the two cases an event raised by AVIView at the start of each execution cycle can be used to set a variable called bIsNewCyc
32. ly in the following again only for Visual Basic 6 0 First of all the main If ActivMeasure 2008 04 23 4 3 Accessing Results Via the Programming Interface 39 Then Else clause around the display of measurement results now tests the overall evaluation of AVTMeasure1 If atMeasureResult Evaluation True Then access and display measurement results Else examine cause of error more closely End If In the example application the only cause for AVTMeasure1 being evaluated as not okay is that its one ROI has been evaluated as not okay This in turn can have two possible reasons First that the wrong number of objects has been extracted i e less or more than two In this case the following code fragment displays a corresponding message in a list box which indicates how many objects have been extracted If atROIResult FeatureEvaluation handleObjectsInROI False Then errorMsg Cycle amp iNumCycles amp wrong number of objects amp atR IResult Value handleObjectsInROI amp Call DisplayMessage errorMsg End If The error message also contains the number of the cycle in which the error occurred The corresponding counter is incremented in the handler for AVIView s event CycleStart which was introduced already in the previous section Private iNumCycles As Integer Private Sub AVTView1_CycleStart iNumCycles iNumCycles 1 End Sub A second cause of error is that at least one object
33. oject rois Wneasure rois vbp Alternatively create a new project and place the following tools on the form in parentheses the icon you have to double click with the left mouse button AVIView I AVIViewROI qe and AVT Measure Bi Execute the application Run Start or via the corresponding button Open AVTViewFG by clicking on AVTView with the right mouse button and select ing Image Acquisition Load the image chipNchip 01 via the combo box In put File The following steps are visualized in figure 2 1 OO First you have to tell AVTViewROI that it is to create an ROI for ActivMeasure by selecting the corresponding entry in the combo box ActivVisionTool In this box all ROI processing ActivVisionTools are listed that have been placed upon the form The tools are referenced by the name of the corresponding ActiveX control In the default behavior of Visual Basic multiple instances of a control are distinguished by a postfix counter e g AVTMeasure1 and AVTMeasure2 In our example there is only one item in the combo box AVTMeasuret Next select the desired shape of the line of measurement To draw the line of measurement move the mouse in the image while keeping the left mouse button pressed Please experiment at this point with the different shapes Now you can move the ROI by dragging its pick point in the middle By dragging the outer pick points you modify its shape Again please experiment to
34. ols which introduces the basic concepts of Activ VisionTools and the User s Manual for ActivView to learn how to load and display images To follow the examples actively first install and configure ActivVisionTools as described in the manual Getting Started with ActivVisionTools For each example in this manual there is a corresponding Visual Basic project these projects can be found in the subdirectory exam ples manuals activmeasure 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 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 About ActivMeasure 1 LI Introducing AcDvN easutB ao oo Soo oo RR o ee EUER 2 12 The Sub Tools of ActivMeas te 2 2 2 22 Rs 4 Using ActivMeasure 7 2 1 Specifying the Line of Measurement llle 8 22 JBxmactng BHEBE 2221 3 c B UR ek Pade Roy ee s 10 2 3 BSelboungeResuls eek XL SR Xx E was 14 Combining ActivMeasure with other ActivVisionTools 17 3 1 Converting Besults to Other Units s se cs ck or om RR Rs 18 3 IBvahianngBRe
35. rouping Af l 20 Edge Strength a l EN Noise Level s gt fro RO width Standard Accuracy D specify the minimum strength of edges using the slider or by dragging the horizontal line in the graph the strength of the edges is marked with the bold bars Figure 2 2 Specifying the edges that are to be extracted above those you do not want We continue with the example on the next double page ActivVisionTools 3 2 Your Fast Track to Solutions 12 Using ActivMeasure Visual Basic Example Extracting Edges continued Preparation for the following example Place a line shaped ROI over the radial conductor paths near the middle of the image At first not all edges are extracted The following steps are visualized in figure 2 3 If you have got a noisy image it is useful to smooth it using the slider Noise Level before extracting edges Graphically spoken smoothing removes narrow peaks in the intensity profile Experiment with this parameter the smoothed profile is depicted in AVTMeasureGraph by a second profile drawn in red If you chose a line shaped or an arc shaped ROI you can specify the width of averaging with the slider ROI Width For a rectangular ROI this slider is disabled and shows the width of the rectangle In our example the averaging parameter prevents the radial edges from being extracted Experiment
36. s the bold parts at the bottom correspond to their strength amplitude a b Figure 1 1 a Image with line of measurement b corresponding gray value line profile Measurement Paths In the example above edges were searched for along a line Besides this ActivMeasure also allows measurements along a circular arc To extract edges more robustly it is useful to widen the examined image region e g from a line to a rectangle and to average pixel values along that dimension i e perpendicularly to the line of measurement However one has to take care then that the edges one want to measure are almost parallel to the direction of averaging In figure 1 2 for example the goal is to measure the non parallel wires If the pixel values are ActivMeasure 2008 04 23 1 1 Introducing ActivMeasure ZZ EE 77 NN T0 with averaging without averaging ActivMeasure Figure 1 2 Edge setection with and without averaging averaged over a width of 10 pixels the outer edges are are smoothed down as can be seen in the corresponding profile Averaging can also be performed for measurements along arcs If you want to measure an object which moves from image to image the line or arc of measure ment must be moved accordingly For this you need the tool ActivAlignment Please consult the corresponding user s manual for more information Modes of Measuring Besides measuring
37. s is disabled in the application mode to prevent you from accidentially moving or deleting an ROI S In AVTViewStatus an icon indicates the current execution mode of the application ActivMeasure 2008 04 23 4 2 Configuring the Two Execution Modes 29 D open the sub tools via the context menu of AVTView suitehiBerwedn the to tadas D select what is to be displayed __ and whether ROIs can be edited x lolx 3 execute a single cycle or start stop the application x Execution Execute Slaves Single Run Stop x r Application Mode M ge IT Display ROIs Allow ROI editing IV Display Results IV Display Error Results Allow Drag amp Drop r Configuration Mode IV Display Image IV Display ROIs v Display Results v Display Error Results ActivMeasure Allow ROI editi Allow Drag amp D E 4 558 ms Loading file fuse25 02 Scoble 5 current execution mode 6 processing time or speed space for messages Figure 4 2 Customizing and switching between the two execution modes In the mode 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
38. s wrong width 0 6691 74404578857 Error Messages Cycle 38 object 1 has wrong width 0 762857516213989 Cycle 41 object 0 has wrong width 0 698542348583985 Cycle 41 object 1 has wrong width 0 734561649 ij Figure 4 5 Accessing and displaying the evaluation results Dim handleWidth As Integer handleBadROIs As Integer Dim handleObjectsInROI As Integer Dim bWidthIsOK As Boolean bBadROIsIsOK As Boolean Dim bObjectsInROIIsOK As Boolean handleWidth AVTMeasurei FeatureHandlePairWidth handleBadROIs atMeasureResult FeatureHandleBadROIs handleObjectsInROI atMeasureResult FeatureHandleObjectsROI bWidthIsOK atROIResult ObjFeatureEvaluation handleWidth 0 bBadROIsIsOK atMeasureResult FeatureEvaluation handleBadROIs bObjectsInROIIsOK atROIResult FeatureEvaluation handleObjectsInROI The ActivVisionTools distribution includes the example Visual Basic project evalac cess measure_evalaccess vbp which uses these methods to extend the application de scribed in the previous section Now ActivDecision is used to check the width of the fuse wire as described in section 3 2 on page 20 in case the overall evaluation shows an error the cause of the error is to be displayed see figure 4 5 The example project is already configured just start it and click the button Run in AVIViewExecute Besides accessing the evaluation results the project code contains additional functionality which is explained brief
39. sh atToolResults s ACTIVVTOOLSLib IAVTToolResult E End Sub X Figure 4 3 Creating a procedure to handle the event Finish atToolResults contains the result data for all ROIs of your instance of AVTMeasure The current number of ROIs can be queried via Dim iNumROIs As Integer iNumROIs atToolResults ROINum In Visual Basic NET the event handler has a different signature Private Sub AxAVTMeasure1_Finish ByVal sender As Object _ ByVal e As _ AxActivVTools __AVTMeasure_FinishEvent _ Handles AxAVTMeasurei Finish A first difference is that tool names start the prefix Ax i e AVTMeasure becomes AxAVT Measure The main difference however is that the tool results are not directly passed instead they are encapsulated in the parameter e From there they can be extracted with the following lines Dim atToolResults As AVTToolResult atToolResults e atToolResults To use classes like ACTIVVTOOLSLib AVTToolResult without the namespace ACTIVVTOOL SLib as in the code above you must import this namespace by inserting the following line at ActivVisionTools 3 2 Your Fast Track to Solutions ActivMeasure 32 Tips amp Tricks the very beginning of the code more information about importing namespaces can be found in the Advanced User s Guide for ActivVisionTools in section 1 2 4 5 on page 12 Imports ACTIVVTOOLSLib The results of a certain ROI can be accessed by specifying its name in a call to the method R
40. sulsS uon a ee ER BORSE ee ee Wa eS 20 3 89 Outputof RGSS uus uso A a a ae od 22 Tips amp Tricks 25 4 1 Adapting the Display of Results 2 0 26 4 2 Configuring the Two Execution Modes 28 4 3 Accessing Results Via the Programming Interface 30 ActivMeasure Chapter 1 About ActivMeasure This chapter will introduce you to the features and the basic concepts of ActivMeasure It gives an overview about ActivMeasure s master tool and its support tools which are described in more detail in chapter 2 on page 7 11 Introducing ActivMeasure 12 The Sub Tools of ActivMeasure ee eeevecaes 2 About ActivMeasure 1 1 Introducing ActivMeasure With ActivMeasure you can measure the distance between edges along a line or an arc Such measurements are a typical task in automated quality control e g chip inspection Activ Measure assures subpixel accuracy at high speed even when taking measurements in multiple ROIs Edges Edges are strong discontinuities in pixel values This is illustrated in figure 1 1 On the left you see a zoomed image of a printed circuit board with a line shaped ROI for measuring On the right the so called line profile is displayed i e the pixel values along that line Note that dark pixels correspond to low values In such a profile edges correspond to points of a strong change of pixel values They are marked by vertical line
41. t ROI or tool feature with two boundary values a minimum and a maximum value For our example applica tion change the minimum value for the feature Width to 0 5 and the maximum value to 0 6 in the columns Min and Max Now select a condition that the result has to meet in the column Operation if you select None the feature is not evaluated In our example the Width has to be Inside the two boundary values Furthermore exactly two objects have to be extracted and none should be evaluated as not okay 4 Those features which meet their condition appear in green the others in red If at least one feature is not okay the whole object ROI or tool is evaluated as not okay as well Analogously the overall evaluation of application which is visualized by AVT Decision depends on the tool evaluations Figure 3 2 shows suitable conditions for the example task When you step through the image sequence by clicking Single in AVTViewFG you see that some fuses do not ActivMeasure 2008 04 23 3 2 Evaluating Results 21 D open the support tools via the GO formulate conditions for objects ROIs context menu right mouse click or tools first enable the update of results 4 the evaluations are displayed immediately ia Evaluating Results ActivMeasure Faila E AVTMeasurel Value Min Max Interpretation Operation Tool Features AVTMeasurel Objects Tool 2 0 100 Number None L
42. th 09 11 04 15 26 11 AVTMeasurei yes Bad ROIs Line_1 yes Objects ROI Bad Objects ROI 0 yes Width 1 yes Width 09 11 04 15 26 11 AVTMeasurei no Bad ROIs Line_1 no Objects ROI Bad Objects ROI O no Width Distance Center 1 no Width ActivMeasure 2008 04 23 yes OREO yes 2 2 yes 0 0 Max Max Max yes 0 551424 yes 0 571242 yes 0 0 yes 2 2 yes 0 O0 Max Max Max yes 0 536949 yes 0 555279 no 1 0 ws 2 eB me 2 0 S no 0 698542 2 223346 no 0 734562 Max Max Max 0 500000 0 600000 Inside 0 500000 0 600000 Inside Figure 3 4 Part of an example log file ActivMeasure Chapter 4 Tips amp Tricks This chapter contains additional information that facilitates working with ActivMeasure e g how to modify the graphical display of results and to customize the appearance of an Activ Measure application in the two execution modes Furthermore it shows how to access measure ment and evaluation results directly via the programming interface of ActivVisionTools 4 1 Adapting the Display of Results leen 26 4 2 Configuring the Two Execution Modes leen 28 4 3 Accessing Results Via the Programming Interface 30 43 Measurement Results llle 31 43 2 Ivaluaiion Results lt o a 4 ac 2 ew ORO ee ee ee ee ee 36 25 26 Tips amp Tricks 4 1 Adapting the Display of Results Using You can adapt the way results and RO
43. the distances between successive edges you can choose to group edges to pairs and measure the distances between them or measure the distance between the first and the last edge Additional results also called features that can be calculated are the center position and the width of a pair and the distance between pair centers see figure 1 3 Lus right left right pair air edge edge edge edge center center E AoA QE E NN N NNI pair width distance center distance Figure 1 3 What can be measured between edge pairs If you calibrated the size of a pixel using either ActivView s support tool AVTViewCalibration or ActivGeoCalib measured distances and positions can be converted to other units besides pixels Itis also possible to measure angles of edges and angular distances between successive edges If the edges are grouped to pairs additionally the angular pair width the angle of the pair centers and the angular distance between successive pair centers can be calculated see figure 1 4 ActivVisionTools 3 2 Your Fast Track to Solutions 4 About ActivMeasure pair center pair center second edge first edge second edge first edge m SD 0 o0 0 o0 2 9025 9 ce oD 2 o os S amp m S of a co cg H amp 2 sx c 9 co 9 o 29 C Z o o gt 82s eee 2 E ags fom Figure 1 4 Which angular features can be calculated Note that the angular features provide meaningful information only for
44. 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 6 AVTViewStatus also shows the number of processed cycles and the time needed for the last processing cycle 7 AVTViewStatus display two types of messages Informative messages describe e g what the application is doing while it is busy while error messages indicate errors that prevent the application from working correctly e g the failure to connect to an image acquisition device If AVTViewStatus is not added to an application error messages are displayed in popup dialogs More information about AVTViewStatus e g how to modify its appearance can be found in the User s Manual for ActivView section 3 3 on page 32 ActivVisionTools 3 2 Your Fast Track to Solutions 30 Tips amp Tricks 4 3 Accessing Results Via the Programming Interface The previous chapters and sections showed how to use ActivVisionTools interactively i e via the graphical user interfaces presented by the underlying ActiveX controls In this mode you can develop the image processing part of your machine vision application rapidly and easily without any programming However there is more to ActivVisionTools than the graphical user interfaces Because ActivVisionTools comes as a set of ActiveX controls it provides you with an open programming interface thereby offering
45. vWidthArray As Object ActivMeasure 2008 04 23 4 3 Accessing Results Via the Programming Interface 33 Accessing the Results via the Programming Interface E ni xj flight gt Dak T Edge Type Edge Pais z Edge Grouping AlEdges gt Edge Selection ao Edge Strength x 1 5 2 Noise Level sf gt 2 no width Standard gt Accuracy Width 1 0 54 Mean 0 62 ActivMeasure Width 2 0 56 Mean 0 65 BH Number of Good Cycles 88 Execution Application v Mode J Execute Slaves Single EB Stop Figure 4 4 Accessing and displaying the measurement results The ActivVisionTools distribution includes the example Visual Basic project resultac cess measure_resultaccess vbp which uses the methods described above to extend the application for inspecting car fuses introduced in the previous chapter The task is to display the measured widths of the wire and their mean values over time see figure 4 4 The example project is already configured just start it and click the button Run in AVIViewExecute Besides accessing the measurement results the project code contains additional functionality which is explained briefly in the following Note that the code is only shown for Visual Ba sic 6 0 a Visual Basic NET application with result access can be found in the directory exam ples dotnet vb measure_results ActivVisionToo
46. valuation results before Activ Decision has finished e g in the handler for AVTMeasure s event Finish Because ActivDecision can evaluate the results of more than one tool the event handler provides you with a Collection of tool results The following code fragment searches the collection for the results of AVTMeasure1 and stores them in the object variable atMeasureResult or exits if no results are found Dim atToolResult As AVTToolResult Dim atMeasureResult As AVTToolResult Dim bMeasureResultsFound As Boolean bMeasureResultsFound False For Each atToolResult In atToolResults If atToolResult Name AVTMeasurei Then Set atMeasureResult atToolResult bMeasureResultsFound True End If Next If bMeasureResultsFound False Then Exit Sub End If ActivMeasure 2008 04 23 4 3 Accessing Results Via the Programming Interface 37 In Visual Basic NET the event procedure has the following signature Private Sub AxAVTDecisioni Finish ByVal sender As System Object ByVal e As AxActivVTools __AVTDecision_FinishEvent Handles AxAVTDecisioni Finish Again the tool results are encapsulated in the parameter e They can be extracted as follows note the use of VBA Collection instead of Collection Dim atToolResults As VBA Collection atToolResults e atToolResults As already remarked in the previous section tool names are prefixed with Ax thus you must search for the results of AxAVTMeasuret If atToolResult name

Download Pdf Manuals

image

Related Search

Related Contents

  196/C fra.  The Burst Analyzer Tutorial  PSW-50 - Diamond Cable Brasil  WFP11S 2.5-Quart Sealed Batch Bowl Food Processor Instruction  MODEL 2900 Downflow - Donamarc Water Systems Co.  IS5300 User Manual  DG-HD1TBPVR User Manual  

Copyright © All rights reserved.
Failed to retrieve file