Professional Documents
Culture Documents
In-Sight Spreadsheets Advanced Final Lab Final Lab Section 1 - Patmax
In-Sight Spreadsheets Advanced Final Lab Final Lab Section 1 - Patmax
In-Sight Spreadsheets Advanced Final Lab Final Lab Section 1 - Patmax
It is not expected that you complete all the sections of this Final Lab in the time allocated,
just those that are the most relevant to your applications.
All image folders are found in the following (or similarly named) pathway:
1. Start a new job.
IS_Student\Classes\Spreadsheets Advanced\Resources_Final_Lab 2. Browse to the images file in the Keys folder.
3. Use a different TrainPatMaxPattern tool to train a model of each of the 4 key variations
Contents: (Key1 – Key4)
Section 1: PatMax (1 exercise) 4. Add four FindPatMaxPatterns tools to search for the four patterns.
Section 2: InspectEdgeForDefects (3 exercises) 5. Insert logic in the spreadsheet to choose the pattern with the highest score, which
BeadInspect (1 exercise) should be the correct key.
Section 3: OCRMax (3 exercises) 6. Run the job on images sample00 – sample08.
Section 4: Color (2 exercises)
Section 5: TestRun (1 exercise) 7. Save your job as MyKeys.
Section 6: Flexible Flaw Detection (3 exercises)
Section 7: Surface Flaw Detection (1 exercise)
Section 8: Scripting (2 exercises)
Page 1 Page 2
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
• Part: Cookies
• Estimated Time: 10-15 minutes
• Emulation: In-Sight 7400
• Tools: InspectEdge and InspectEdgeForDefect
• Overview: All four cookies should fail, due to missing parts of the edges. However, the
radial cracks should not be reported as defects. 1. Start a new job.
2. Browse to the images file in the Unions folder.
3. Use a pattern tool to fixture the part.
4. Use InspectEdge and InspectEdgeForDefect tools to inspect the parts. The first
four images should fail, while the last four images should pass.
HINT: The Region for InspectEdge should be an annulus. This can be created by
dragging the Bend icon on the Region around circularly.
5. Save your job as MyUnions
1. Start a new job.
A sample solution job is provided in the Unions folder. It includes numerous
2. Browse to the images file in the Cookies folder. comments. It also inspects for the diameter of the parts being in a range.
3. Use the InspectEdge and InspectEdgeForDefect tools to inspect the four cookies.
All four should fail. The defects should be the varations on the circumference. The
cracks that go inward radially should not be flagged as defects.
HINT: The Region for InspectEdge should be an annulus. This can be created by Exercise 2.3: BeadInspect
dragging the Bend icon on the Region around circularly.
4. Save your job as MyCookies. • Part: Gaskets
A sample solution job is provided in the Cookies folder. • Estimated Time: 10-15 minutes
• Emulation: In-Sight 7400
• Tools: BeadFind and BeadInspect
• Overview: You will inspect for defects on the beads
Exercise 2.2: InspectEdgeForDefect
• Part: Unions
• Estimated Time: 15-20 minutes
• Emulation: 7400
• Tools: InspectEdge and InspectEdgeForDefect
• Overview: The “defects” that the tool will identify are not actually defects, but desired
depressions called “grips.” We want to confirm there are 18 grips. Fewer than 18 grips
should cause the part to fail.
Page 3 Page 4
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
3. Use BeadFind and BeadInspect tools to inspect the parts. The first three images Final Lab Section 3 – OCRMax
should pass, while the last three images should fail.
4. Save your job as MyGaskets.
Exercise 3.1: OCRMax Distorted Images
Page 5 Page 6
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
This is the lab that appears in the Color section of this class, dsignated as “If Time
Permits.” If you did not complete it then and want to delve more into the Extract Color
tools, go back to that section and do the lab.
go back g o back t o
1. Start a new job.
2. Browse to the images file in the HotBlock folder. • Part: Fruit
3. Use several OCRMax tools to read the characters. • Estimated Time: 10-20 minutes
4. Change the OCRMax that reads the expiration date to verify that the expiration date is • Emulation: In-Sight 7400C
26/08/2016. All images should fail. • Tools: MatchColor and ExtractColor
5. Save your job as MyHotblock • Overview: You will compare the Match Color tools with the Extract Color tools for
A sample solution job is provided in the HotBlock folder. identifying apples and oranges. First, try MatchColor. It can be configured to work, but
the difficulty is that the fruit has shadows and glare, i.e., it is not a uniform color. After
trying MatchColor, try ExtractColor, which should be easier because it can handle the
shadows and glare as different colors.
Page 7 Page 8
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
Click “OK.” This will create a structure in a cell with the trained colors Library.
7. Add a MatchColor tool. Set the region of interest to cover ONLY the area where each
color will be displayed
4. Add a TrainMatchColor to the job. Click on the “Add New Color” button and place
the tool region (Circle) around an area free of any other markings and represents the
color to train. Click on the Green Check Box or the “Enter” key.
NOTE: Making the Region of Interest too lage or small will affect the averaging of
pixels to determine a match. Example –Too large would include the background
pixels,too small –just saturated pixels, thus changing the average pixel color found.
Reference the Match Color Library parameter to the cell containing the
TrainMatchColor tool you just created.
5. Name each color to something more intuitive than Color_1. Orange will work for this
particular selection. Run the images through your job and see if it correctly identifies the fruits. If not, try
modifying training region(s), the matching region, and/or tolerance slider
9. Compare the two approaches (Match vs. Extract) in terms of ease of use and
effectiveness.
6. Repeat the process for Apple. Be sure to click on the appropriate image in the “Film
Strip’ to train on.
You will probably need to account for different intensities of a single color by using the
Color Tolerance Bar to adjust for lighter or darker appearances of each color.
Page 9 Page 10
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
Final Lab Section 5 – TestRun Final Lab Section 6 – Flexible Flaw Detection
• Part: Aluminum blocks Exercise 6.1: Flexible Flaw Detection
• Estimated Time: 15-20 minutes
• Emulation: Standard • Part: Knobs
• Tools: TestRun • Estimated Time: 15 minutes
• Overview: Configure TestRun to verify a job • Emulation: In-Sight 7400
• Tools: TrainFlawModel, FlexFlawModel, DetectFlaw
• Overview: Use the Flexible Flaw tools to look for defects on knobs
1. Browse to the images file in the Knobs folder. Cycle through the images to see the
variations you will encounter. Image0 and Image7 represent good parts, without any
defects. The other images are bad parts.
2. Use PatMax tools to fixture, using the following pattern region on Image0:
Page 11 Page 12
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
Image3
Image4
Image5
3. Insert and configure TrainFlawModel, FlexFlawModel (if needed), and DetectFlaw
tools to identify the following defects:
4.
Image6
Image0
Image1
Exercise 6.2: Flexible Flaw Detection
1. Browse to the images file in the Screens folder. Cycle through the images to see the
variations you will encounter.
2. Image0 – Image4 represent bad parts, with defects. Image5-Image12 have defects.
Use PatMax tools to fixture, using the following pattern region on Image6:
Page 13 Page 14
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
Image4
• Part: Labels
• Estimated Time: 20-30 minutes
• Emulation: In-Sight 7400
• Tools: TrainFlawModel, FlexFlawModel, DetectFlaw
• Overview: Use the Flexible Flaw tools to look for defects on labels
1. Browse to the images file in the Labels folder. Cycle through the images to see the
variations you will encounter.
Page 15 Page 16
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
Final Lab Section 7 – Surface Flaw Detection HINT: Make sure you set your Detection Size to be larger than the defect to be found.
4. Save the job as MyInsightLabel.
• Part: In-Sight labels A sample solution job is provided in the In-Sight_Label folder.
• Estimated Time: 20-30 minutes
• Emulation: In-Sight 7402
• Tools: Mask and SurfaceFlaw
• Overview: Use the SurfaceFlaw tool to look for defects on labels that also have the In-
Sight logo on them. To ignore the logo, you will use a Mask structure.
Good Part:
1. Browse to the images file in the InSightLabels folder. Cycle through the images to see
the variations you will encounter.
2. Use the Mask and SurfaceFlaw tools to detect flaws on a sponge. Image0-Image4
should pass, while Image5-Image14 should fail.
Image6:
Page 17 Page 18
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
• Part: none
• Estimated Time: 15 minutes
• Emulation: In-Sight 5705 and version 5.1 or later of In-Sight Explorer
• Tools: Script, Get
• Overview: This lab demonstrates the use of a Script with a variable number of inputs,
and four results that are inserted in spreadsheet cells by four Get functions.
3. Open the Scripting category and drag the ArgumentsAndResults snippet into cell
A2 of the spreadsheet.
Page 19 Page 20
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
The spreadsheet displays. 8. Find the part of the JavaScript program that looks like this:
return {
avg: avg,
stddev: stddev,
min: minAndMax.min,
max: minAndMax.max
}
}
NOTE: The ‘return’ tells the Script to return the four values calculated elsewhere in
the Script, naming the returned values avg, stddev, min, and max. The four Gets in
the spreadsheet use these same names.
9. Modify the Script so that it also returns the ratio min/max.
The return section will look like this:
return {
avg: avg,
stddev: stddev,
min: minAndMax.min,
max: minAndMax.max,
ratio: minAndMax.min/minAndMax.max
}
}
Description of Snippet: 10. Add another Get to the spreadsheet to display the ratio.
A4:A15 contain 10 numbers, generated by Rand (random number) functions. The updated spreadsheet displays.
D3: Script(A4:A15) – This executes JavaScript code written to calculate the
average, standard deviation, minimum, and maximum of the 10 numbers.
D4: Get(D3, “avg”) retrieves the average calculated by the Script
D5: Get(D3, “stddev”) retrieves the standard deviation calculated by the Script
D6: Get(D3, “min”) retrieves the minimum calculated by the Script
D7: Get(D3, “max”) retrieves the maximum calculated by the Script
NOTE: Each time the spreadsheet is executed, new random numbers are generated
by the Rand functions and sent to the Script.
4. Insert a Button function into cell B0 and change its trigger parameter to Manual.
NOTE: When running the Emulator, F5 or the toolbar trigger icon does not trigger the
spreadsheet.
5. Each time you click the Button, the spreadsheet will execute, the 10 input values
will change, and the average, standard deviation, minimum, and maximum will
update.
6. Add 2 more Rand functions in cells A16 and A17.
NOTE: This increases the number of values from 10 to 12. Each time you click the
button the spreadsheet will now process 12 values.
7. Double click on cell D3, which will display the JavaScript code.
NOTE: Read through the code to get a sense of how it works. Even if you are not
familiar with JavaScript, you can read the comments.
Page 21 Page 22
In-Sight Spreadsheets Advanced Final Lab In-Sight Spreadsheets Advanced Final Lab
3ge Labe 3 3Look at Additional Examples of Scripting 3. To execute an example, check the Enable checkbox for that example.
Page 23 Page 24