Sunteți pe pagina 1din 18

Objectives

In-Sight Spreadsheets At the end of this Training Course, Participants will be able to:

Advanced • Configure the PatMax (PatMax and PatMax RedLine) tools


• Incorporate edge and bead inspection tools to solve applications
involving complex edges
• Analyze the results returned from the OCRMax tools
• Determine where color tools are helpful and implement them
• Implement Dialog Boxes and Wizards, Audit Messaging, and Test
Run functions into an application
• Identify applications for the Flaw Detection tools and implement
these tools
• Demonstrate how the spreadsheet can interface with JavaScript
programs

Section 1 | Slide 2

Welcome to the In-Sight Spreadsheets Advanced class. At the end of the In-Sight Spreadsheets Advanced training class, Participants will be able to:

The In-Sight Spreadsheets Advanced class teaches the more advanced topics of how to configure a - Configure the PatMax (PatMax and PatMax RedLine) tools
vision application using the spreadsheets configuration environment and user interface. - Incorporate InspectEdge tools to solve challenging applications involving complex edges
- Analyze the results returned from the OCRMax tools
The In-Sight Spreadsheets Advanced product class puts the focus on getting the most out of the In- - Determine where color tools are helpful and implement them
Sight Explorer spreadsheets interface. The spreadsheets interface uses intuitive tools and traditional - Implement Dialog Boxes and Wizards, Audit Messaging, and Test Run functions into an
spreadsheets functions allowing students to focus on solving their application quickly and effectively application
while taking advantage of the latest and greatest tools available through the spreadsheets. - Identify applications for the Flaw Detection tools and implement these tools
- Demonstrate how the spreadsheet can interface with JavaScript programs
The labs will give you hands-on experience with the inspection of an actual part.

Section 1 | Slide 1 Section 1 | Slide 2


Objectives

PatMax and PatMax At the end of this Section Participants will be able to:
RedLine
- Identify uses for PatMax technology
Section 1
- Configure the PatMax (PatMax and PatMax RedLine) tools
- Implement the PatMax tools to solve challenging applications
- List 3 differences between PatMax and PatMax RedLine

Section 1 | Slide 4

The first section of the In-Sight Spreadsheets Advanced training will focus on the PatMax and At the end of this section of training, Participants will be able to:
PatMax RedLine tools.
- Identify uses for PatMax technology
- Configure the PatMax (PatMax and PatMax RedLine) tools
- Implement the PatMax tools to solve challenging applications
- List 3 differences between PatMax and PatMax RedLine

Section 1 | Slide 3 Section 1 | Slide 4


What is PatMax? Why Does It Work?

PatMax: Feature-based FindPatterns: Pixel grid-based

- PatMax is a pattern-based search technology.


- The models in PatMax use geometric (feature based) representation;
FindPatterns is pixel grid-based. Feature based is more accurate.

Section 1 | Slide 5 Section 1 | Slide 6

A PatMax pattern is a collection of geometric features where each feature is a point on the boundary PatMax more closely resembles the way humans discern between similar things and recognize
between two regions of dissimilar pixel values. PatMax calculates geometric representations of familiar ones.
curves. This makes it more accurate than FindPatterns, which approximates curves with line
segments that follow the pixel grid. Consider the examples of remembering the faces of people you know well.
Even if the faces change due to lighting, extra features, and fewer features, you will still likely
recognize them if there is enough of the original detail intact.

Section 1 | Slide 5 Section 1 | Slide 6


How Does it Work? TrainPatMaxPattern Parameters

PatMax uses two tools:

FindPatMaxPatterns
- Finds features in an image based
on the trained pattern

TrainPatMaxPattern
- Extracts and trains a pattern: a
trained geometric description of an
object you wish to find

Section 1 | Slide 7 Section 1 | Slide 8

PatMax offers three key features that distinguish it from other pattern-location technologies in The TrainPatMaxPattern Property Sheet includes the following:
machine vision:
- High-speed location of objects whose appearance is rotated, scaled and/or stretched - Image – Reference to target image cell
- Location technology that is based on object shape, not greyscale values - Fixture – Where tool should fixture itself
- Very high accuracy - Pattern Region – Region specifying features to train
- External Region – Allows use of custom region
PatMax uses two tools: - Pattern Origin – Location within pattern to report
- FindPatMaxPatterns - Pattern Settings – Specialized settings
- Finds features in an image based on the trained pattern - Algorithm – Choose from PatQuick or PatMax
- TrainPatMaxPattern - Elasticity – Specifies allowed perimeter deviation
- Extracts and trains a pattern; a trained geometric description of an object you wish to - Ignore Polarity – Toggles to check for opposite polarity
find - Sensitivity – Disabled
- Coarse Granularity – Granularity used to find large features
- Fine Granularity – Granularity used to find small features
- Reuse Training Image – Model image is saved for later use (retrain)
- Timeout – Milliseconds before tool gives up
- Show – Graphic options to display

NOTE: Any time you make region changes to the TrainPatMaxPattern tool (directly or through an
EditRegion), the model is retrained on whatever is inside the training region at that time – even with
the “Reuse Training Image” selected. If that is not selected, any changes to TrainPatMaxPattern will
retrain the model.

Section 1 | Slide 7 Section 1 | Slide 8


Algorithm Elasticity

Choose from two algorithms:

PatQuick PatMax

Trained Pattern Elastic Change on Part

Section 1 | Slide 9 Section 1 | Slide 10

Choose from two algorithms: Elasticity specifies the amount of non-linear perimeter deviation (0 to 10; 0 = default).
- 0 = No Tolerance
PatQuick - 1 or Greater = Flexible Boundary
- First step in PatMax
- Uses coarse granularity (details later) A linear change in a pattern is where the whole pattern changes in the same way. For example, if a
- Faster than PatMax, but less accurate cross were twice as large all over, as the model, that would be a linear change, called Scale. But in
the cross at the right, only part of the cross has changed. For example, it could be made of rubber,
PatMax and the top section was pulled out at the corners. This is a non-linear change.
- Uses fine granularity (details later)
- Slower than PatQuick, but more accurate Increasing the elasticity parameter makes it more likely to find a part such as this. But if you increase
the elasticity value too much, you run the risk of a wrong feature being selected.
NOTE: The color of a trained feature (Green, Yellow and Red) represents the quality of the feature
candidate for matching. Green represents high quality; Red represents low quality and Yellow is
intermediate quality. The Granularity parameters should be adjusted until all trained features are
green or you should select a better image to train. Distinct features (edges) and good image contrast
will yield the best results.

Section 1 | Slide 9 Section 1 | Slide 10


Ignore Polarity Ignore Polarity

Model

Section 1 | Slide 11 Section 1 | Slide 12

The Ignore Polarity defines whether or not parts with color-inverted match features will be On the left:
considered matches (default = Off, unchecked). When Ignore Polarity is applied (On, Checked), Ignore Polarity is unchecked, meaning a part must match the polarity of the model. Only one match
detected patterns with color inverted features, such as black/white vs. white/black in the Model is reported.
pattern, for example, will be classified as matching the Model pattern.
On the right:
Ignore Polarity instructs PatMax to check for original polarity identified at training and opposite Ignore Polarity is checked. Both parts match the shape of the Model, and both are reported, even
polarity as well. This may increase the execution time for PatMax. though the part on the right is opposite polarity from the model.

Section 1 | Slide 11 Section 1 | Slide 12


Granularity and How it Works Coarse Granularity

104 Boundary Points 32 Boundary Points


32 Boundary Points

GetGrainCoarse returns
6.579

Section 1 | Slide 13 Section 1 | Slide 14

Granularity works to determine the number of boundary points extracted from features in an image. Coarse Granularity is used by the PatQuick algorithm.
- A granularity value of 6 means that boundary points will have a radius of 6 pixels where no - If set to 0, it is automatically set to the best value for coarse granularity.
other boundary points can exist. - If set to > 1, coarse granularity is manually set to that number.
- A granularity value of 1 means that boundary points will have a radius of 1 pixel where no
other boundary points can exist. Since PatQuick is optimized for speed, coarse granularity should never be set to 1.

GetGrainCoarse functions returns coarse granularity value.

Section 1 | Slide 13 Section 1 | Slide 14


Fine Granularity Relationship Between Boundary Points

104 Boundary Points

GetGrainFine returns 1

Section 1 | Slide 15 Section 1 | Slide 16

Fine Granularity is used by the PatMax algorithm. The algorithm used by PatMax in pattern matching involves more than points. In the end PatMax
- If set to 0, it is automatically set to 1. creates a compilation of vectors which include boundary point information, direction (polarity), and
- If set to > 1, fine granularity is manually set to that number, and is no longer using the best their relationship to one another.
accuracy setting.

Since PatMax is optimized for accuracy, fine granularity should always be set to 1.

GetGrainFine function returns fine granularity value.

Section 1 | Slide 15 Section 1 | Slide 16


TrainPatMaxPattern FindPatMaxPatterns Parameters

TrainPatMaxPattern auto-inserts one result (GetTrained):

- 0 if a pattern could not be trained


- 1 if a pattern was successfully trained

GetTrained

Section 1 | Slide 17 Section 1 | Slide 18

TrainPatMaxPattern Results The FindPatMaxPatterns Property Sheet includes the following:


- A Patterns data structure containing a trained pattern, or #ERR if any of the input
parameters are invalid. The function is Disabled by default to avoid accidently training a - Image – Reference to target image cell
new pattern on the next acquisition. - Fixture – Where tool should fixture itself
- GetTrained - Find Region – Region specifying searching area
NOTE: While in the function’s property sheet, supplemental information strings are provided as - External Region – Allows use of custom region
suggestions for better training a pattern. - Pattern – Reference to a TrainPatMaxPattern
- Number to Find – Number of match to search for
Avoid Retraining Accidently - Accept – Minimum score necessary
- Any time you make region changes to the TrainPatMaxPatterns tool (directly or through an - Contrast – Specifies lowest contrast necessary
EditRegion), the model is retrained on whatever is inside the training region at that time – - Clutter in Score – Toggles consideration of extra features
even with the ‘Reuse Training Image’ selected. - Outside Region – Percentage allowed out of region
- If that is not selected, any changes to TrainPatMaxPatterns will retrain the model. - Find Tolerances – Sets rotation, scale & aspect ratio range
- Find Overlapping – Sets allowable overlapping
- Timeout – Milliseconds before tool gives up
- Show – Graphic options to display

Section 1 | Slide 17 Section 1 | Slide 18


Accept Threshold Puzzling Behavior in Scoring

0 80 100

Accept = 80
No match is found
Not Valid Accept Valid
Matches Threshold Matches

Accept = 70
Match is found with a score of 87.405
Section 1 | Slide 19 Section 1 | Slide 20

Accept Threshold defines the degree of similarity that must exist between the model pattern and the Why wasn’t a match found with Accept = 80?
found feature. The minimum acceptable score will vary depending upon the Location Tool selected.
Accept is used only with PatQuick, which uses coarse granularity. Suppose, at coarse granularity,
PatMax uses this to determine if the match represents a valid instance of the model within the search the part scores 75%, and so fails because it is below 80%.
region. Increasing the Accept value reduces the time required for search. With Accept = 70, a part scoring 75% passes in PatQuick, and so is reevaluated in PatMax, using
fine granularity (more points). With fine granularity, it scores 87.405% and passes.

NOTE: A way around this is set Accept low so that more parts pass PatQuick and are then
reevaluated in PatMax using fine granularity. You can use logic in the spreadsheet to compare the
reported score to the desired threshold score.

In the example in the slide, we could set Accept to 20, and then add the following in another cell:
If(G7>80, 1, 0) where G7 is the cell with the score and 1 means pass.
This would still allow a threshold of 80%, but the pass/fail would be based on fine granularity.
Increasing the Accept value reduces the time required for a search because fewer features will be
promoted from PatQuick to PatMax.

Section 1 | Slide 19 Section 1 | Slide 20


Contrast Threshold Clutter

The minimum acceptable contrast that must be present in the found pattern to be
considered a match

92 62 31

Model Part with Clutter

16 5 Score: 68

Score: 94

Section 1 | Slide 21 Section 1 | Slide 22

Contrast Threshold defines the minimum acceptable contrast that must be present in the found Clutter is a term used to describe extra features present adjacent to the boundary features of the
pattern; the contrast for a found pattern must be greater than the Contrast Threshold value to be part that are not part of the original model.
considered a valid instance. A low Contrast Threshold value is used for low-contrast images, while a
high Contrast Threshold value is used for high-contrast images. Clutter in Score – Specifies whether missing or occluded pattern features will reduce the response
score(s).
Contrast threshold sets the minimum contrast required in order to consider a change in grayscale a
potential boundary point. For a boundary point to be detected its feature contrast must exceed this - 0 = OFF
value. Do not include the effect of clutter in score.
- 1 = ON (default)
Include the effect of clutter in score.

Section 1 | Slide 21 Section 1 | Slide 22


Outside Region Find Tolerances

Allowable rotation of match


relative to model

Allowable scaling range


relative to pattern (100%
means no scaling)

Section 1 | Slide 23 Section 1 | Slide 24

Outside Region specifies the percentage of pattern features that may be found outside the Find Find Tolerances – Specifies the settings for finding patterns that are rotated or scaled with respect
Region without degrading the pattern response score (0 to 100: default = 0). to the trained pattern.

The Score of the feature will be based only on section of the feature that is within the Find Region. - Angle Start – Specifies the angle at which to begin searching for matches, in degrees
counter-clockwise (-180 to 180, default = -15).
- Angle End – Specifies the angle at which to stop searching for matches, in degrees
counter-clockwise (-180 to 180; default = 15).
- Scale Start – Specifies the scale at which to begin searching for matches (1 to 10,000;
default = 100).
- Scale End – Specifies the scale at which to stop searching for matches (1 to 10,000;
default = 100).
- Aspect Ratio – Limits match-finding to uniform scale only or allows aspect ratio in X or Y, in
addition to a uniform scale.
NOTE: The Aspect Start and Aspect End parameters are disabled if Uniform Scale Change is
selected.
- 0 = Uniform Scale Change
- 1 = Uniform and X Change
- 2 = Uniform and Y Change
- Aspect Start – Specifies the minimum scale change, at which to begin searching for
matches, as a percentage of the trained pattern (1 to 10,000; default = 100).
- Aspect End – Specifies the maximum scale change, at which to stop searching for
matches, as a percentage of the trained pattern (1 to 10,000; default = 100).

Section 1 | Slide 23 Section 1 | Slide 24


Find Overlapping PatMax RedLine

PatMax RedLine uses two tools:


30
FindPatMaxRedLine
- Finds objects in an image based on a trained pattern.
FindPatMaxRedLine finds patterns within an image based on a
trained pattern from a Patterns structure.

3 Found 2 Found TrainPatMaxRedLine


- Extracts and trains a pattern from an image for use with the
FindPatMaxRedLine function.

Section 1 | Slide 25 Section 1 | Slide 26

Find Overlapping specifies the settings for finding patterns that overlap each other with respect to PatMax RedLine has been designed from the ground up to be optimized for speed on the newer In-
position, rotation, and scale. Sight 5 megapixel models. PatMax RedLine is typically 3 – 7X faster than PatMax, and is sometimes
even faster. It allows for both speed in pattern matching and high resolution (accuracy).
- XY Overlap – Specifies the expected position difference between multiple overlapping
patterns in roughly the same X,Y location, as a percentage of the trained pattern size (0 to NOTE: This function is only available on In-Sight vision systems running In-Sight firmware 5.1.0 and
100; default = 80). later.
- Angle Overlap – Specifies the expected angle between multiple rotated overlapping
patterns in roughly the same X,Y location. A (0 to 360; default = 360). PatMax RedLine uses two tools:
- Scale Overlap – Specifies the expected uniform scale difference between multiple - FindPatMaxRedLine
overlapping patterns in roughly the same X,Y location, as a percentage of the trained - Finds objects in an image based on a trained pattern. FindPatMaxRedLine finds
pattern size (1 to 10,000; default = 140). patterns within an image based on a trained pattern from a Patterns structure.
- Aspect Overlap – Specifies the expected aspect scale difference between multiple - TrainPatMaxRedLine
overlapping patterns in roughly the same X,Y location, as a percentage of the trained - Extracts and trains a pattern from an image for use with the FindPatMaxRedLine
pattern size (1 to 10,000; default = 140). function.

Section 1 | Slide 25 Section 1 | Slide 26


Requirements for PatMax RedLine How Fast is PatMax RedLine?

PatMax RedLine 150 ms (3.2x faster) PatMax RedLine 111 ms (4.9x faster) PatMax RedLine 31 ms (6.8x faster)
In-Sight series 57xx and 8xxx

PatMax = 486 ms PatMax = 551 ms PatMax = 210 ms

PatMax RedLine 208 ms (16x faster) PatMax RedLine 54 ms (4.5x faster) PatMax RedLine 810 ms (10.8x faster)

In-Sight Micro 8405 PatMax = 3330 ms PatMax = 242 ms PatMax = 8795 ms*

In-Sight 5705
Section 1 | Slide 27 Section 1 | Slide 28

Requirements for PatMax RedLine: The speeds depend on the In-Sight model, the nature of the part itself, and the settings in the
- In-Sight series 57xx and 8xxx Property Sheet, including Model Region, Find Region, and Angle of Rotation.
- Spreadsheet mode: In-Sight Explorer and firmware version 5.1.0 or higher
- EasyBuilder mode: In-Sight Explorer and firmware version 5.2.0 or higher NOTE: These timings were obtained on an In-Sight 5705.

PatMax RedLine is not supported by the following:


- In-Sight 51xx, 54xx, 56xx models
- In-Sight 7xxx models
- In-Sight Micro 1xxx models

Section 1 | Slide 27 Section 1 | Slide 28


PatMax RedLine consists of two functions Moving from PatMax to PatMax RedLine
TrainPatMaxRedLine

FindPatMaxRedLine

• Existing job files using PatMax can be converted to


PatMax RedLine

• However, there are some differences in the Property


Sheet parameters and how they work

Section 1 | Slide 29 Section 1 | Slide 30

PatMax RedLine consists of two functions: TrainPatMaxRedLine and FindPatMaxRedLine. Moving from PatMax to PatMax RedLine:

NOTE: These functions are only available on In-Sight vision systems running In-Sight firmware 5.1.0 - Existing job files using PatMax can be converted to PatMax RedLine
and later. - Load job on supported 5 MP system (5705, 5705C or Micro 8405)
- Replace TrainPatMaxPattern function with TrainPatMaxRedLine
TrainPatMaxRedLine – Extracts and trains a pattern from an image for use with the - Retrain the pattern using PatMax RedLine (PatMax RedLine can not use PatMax
FindPatMaxRedLine function. patterns)
NOTE: A trained pattern consumes approximately 1Mb when using the default pattern Region (320 X - Replace FindPatMaxPatterns with FindPatMaxRedLine
440), although the pattern size varies greatly depending on the size of the trained pattern. - However, there are some differences in the Property Sheet parameters and how they work.
- Some parameters are not present in both tools
FindPatMaxRedLine – Finds objects in an image based on a trained pattern. FindPatMaxRedLine - Some parameters are in both tools, but behave differently
finds patterns within an image based on a trained pattern from a Patterns structure.

Section 1 | Slide 29 Section 1 | Slide 30


Key Differences Between PatMax & PatMax RedLine PatMax RedLine is not PatMax!

Setup and runtime differences between PatMax and Applications where PatMax may still be needed:
PatMax RedLine include:
- Fixtured search region (tool can run slow)
- Accept Thresholds and scoring methods are different - Variable aspect ratio, perspective, or skew
- Contrast Threshold has different meaning - Non-linear deviations along perimeter
- Automatic search optimization behaves differently - Filtering match results at approximately same X/Y location by
- Angle and Scale Find Tolerance behavior is different Angle and Scale Overlap

Section 1 | Slide 31 Section 1 | Slide 32

PatMax RedLine matches tend to score higher than PatMax. Therefore, it may be necessary to use Differences:
a higher Accept Threshold for PatMax RedLine compared to PatMax.
- Fixtured search region – PatMax RedLine’s automatic search optimization may cause it to
PatMax RedLine contrast is a relative measure of contrast change between features in the trained run slower than PatMax if the search region is fixtured, especially when searching for
pattern versus target features in the search image. PatMax contrast is an absolute measure of multiple targets on a confusing image background
contrast for target features in the search image. - Variable aspect ratio, perspective or skew – PatMax RedLine does not yet support X/Y
aspect ratio changes, perspective changes, or skew in target compared to trained pattern
In PatMax RedLine, an automatic (re)optimization occurs following any change to Angle/Scale Find - Non-linear deviations along perimeter – PatMax RedLine does not yet have an Elasticity
Tolerances or search ROI. This includes optimization at every trigger when PatMax RedLine is parameter, and may be less tolerant of deviations along the target perimeter compared to
fixtured. This can make the tool run slow if it is fixtured. However, PatMax RedLine is so much PatMax
faster than PatMax for a 5MP image that a fixture is no longer needed in most cases. - Filtering match results at approximately the same X/Y location by Angle and Scale
Overlap – PatMax RedLine cannot filter results based on angle and/or scale differences
PatMax RedLine Find Tolerances are strict, meaning the tool will fail if a limit is exceeded. PatMax between two or more matches found at the same X/Y location (as allowed by XY Overlap
Find Tolerances are permissive, meaning there is some allowance beyond the limits. Therefore, if setting).
PatMax RedLine does not find matches that PatMax finds, it may be necessary to widen the Angle
and Scale Find Tolerances in PatMax RedLine.

Section 1 | Slide 31 Section 1 | Slide 32


Comparison of Pattern Matching Vision Tools Summary

PatFind PatMax PatMax RedLine


• PatMax can be used to locate trained models when the
appearance of the model is adversely affected.
Software Accuracy
Up to 1/10 Up to 1/40 1/10-1/40
(pixels)
• PatMax provides high accuracy because the model is
3x - 7x faster than
Relative Speed fast Moderate speed feature based.
PatMax

Excellent for Excellent for challenging


Excellent for many • PatMax RedLine provides both high speed and high
Versatility challenging apps requiring both
applications
applications speed & accuracy resolution.
Scale Range 90 - 110% 1 - 10,000% 1 - 10,000%
• Both PatMax and PatMax RedLine consist of two
Additional Price Included $500
$750 functions, one for training and one for finding.
(includes PatMax)

Included on all Option on all Option on 5705, 5705C,


Models
standard models standard models Micro 8405

Section 1 | Slide 33 Section 1 | Slide 34

Take a moment to review the differences between the Pattern Matching tools that are available in the In this section we covered the following topics:
various In-Sight vision systems . The timing for PatMax RedLine is in comparison to the PatFind
Tool. - PatMax can be used to locate trained models when the appearance of the model is
adversely affected.
Versatility is dependent upon both speed and accuracy: - PatMax provides high accuracy because the model is feature based.
- PatFind is excellent for many applications. - PatMax RedLine provides both high speed and high resolution.
- PatMax is excellent for more challenging applications. - Both PatMax and PatMax RedLine consist of two functions, one for training and one for
- PatMax RedLine is excellent for the most challenging applications that demand speed finding.
without compromising accuracy.

Section 1 | Slide 33 Section 1 | Slide 34


Lab Exercise

Section 1 | Slide 35

Complete:
Lab Exercise 1.1 – PatMax

Section 1 | Slide 35

S-ar putea să vă placă și