0% found this document useful (0 votes)
110 views10 pages

Lab Exercise 4 - Color: In-Sight Spreadsheets Advanced In-Sight Spreadsheets Advanced

The document provides instructions for two lab exercises using In-Sight vision tools to identify colors: 1. Exercise 4.1 uses TrainMatchColor and MatchColor tools to train and identify three colors (grape, lemon, orange) in cough syrup images. 2. Exercise 4.2 uses TrainExtractColor and ExtractColor tools to train and identify four color combinations (Berry, Natural, Peach, Rose) in images of cosmetic cases. Participants will train on representative images to create color models and test the models on additional images.

Uploaded by

Noe Jimenez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views10 pages

Lab Exercise 4 - Color: In-Sight Spreadsheets Advanced In-Sight Spreadsheets Advanced

The document provides instructions for two lab exercises using In-Sight vision tools to identify colors: 1. Exercise 4.1 uses TrainMatchColor and MatchColor tools to train and identify three colors (grape, lemon, orange) in cough syrup images. 2. Exercise 4.2 uses TrainExtractColor and ExtractColor tools to train and identify four color combinations (Berry, Natural, Peach, Rose) in images of cosmetic cases. Participants will train on representative images to create color models and test the models on additional images.

Uploaded by

Noe Jimenez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

9. Change the name from Color_1 to Grape.


Lab Exercise 4 – Color
At the end of this lab exercise, Participants will be able to:
• Train colors for single color training and identification
• Train colors for multiple color extraction and identification

The Participant will utilize the following In-Sight Functions to successfully complete this
exercise:
• TrainMatchColor and MatchColor
• TrainExtractColor and ExtractColor

Lab Exercise 4.1 Color Identification Using MatchColor Tools

1. Use In-Sight 5400C emulation.


2. Start a new job.
3. Use comments to document each function entered into the spreadsheet.
4. Browse to (or Open) the images file in the Color_Cough_Syrup_Match folder and 10. Select the image of lemon syrup. Repeat steps 7-8 to train for the yellow color.
cycle through the images to see the three products you will encounter. 11. Change the name from Color_1 to Lemon and click the OK button.
NOTE: There are three flavors of cough medicine – grape, lemon, and orange – and
the objective is to identify which is which on the basis of color.
5. Insert a comment into cell C10: ‘Train colors using TrainMatchColor.
6. Select the first image (grape syrup) and insert a TrainMatchColor tool into cell C11.
7. Click the Add New Color button and place the tool region (circle) near the
center of the purple area, avoiding darker areas, to designate the color to train for
grape syrup.

12. Select the image of orange syrup. Repeat step 7-8 to train for the orange color.
13. Change the name from Color_1 to Orange and click the OK button.

8. Click the Green Check Box or press the <Enter> key.

Page 1 Page 2
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

NOTE: This will create a structure and table of results with the associated auto
14. Click the OK button at the bottom of the window.
inserted information identifying which of the colors is found within the ROI.
20. Cycle through the images to test the results.
A score (0-1) will be assigned for each trained color, indicating how close the part’s
color is to the trained color. The colors will be listed highest score first.

15. Select the grape image. Insert a MatchColor tool into cell C16.
16. Set the Region to be the area where each part’s color will be identified when
inspecting parts.

NOTE: If the correct color does not appear first for a given image, try adjusting one or
more of the following:
- The size or location of the region in the TrainMatchColor tool
- The size or location of the region in the MatchColor tool
- One or more of the Color Tolerance sliders:

17. Reference the Match Color Library parameter to cell C11 containing the
TrainMatchColor you just created.
21. Save your job as MyMatchColor.job.

18. Click the Colors Tab to verify all boxes are checked next to the colors you have
trained.

19. Click the OK button.

Page 3 Page 4
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

Lab Exercise 4.2 Color Group Identification Using ExtractColor Tools Set the region (an annulus) as follows:

1. Use 5400C emulation.


2. Start a new job.
3. Use comments to document each function entered into the spreadsheet.
4. Browse to (or Open) the images file in the Color_Cosmetic_Extract folder and cycle
through the 16 images to see the parts you will encounter.

NOTE: There are four models of cosmetics, each comprising four colors. The
cosmetics are named Berry, Natural, Peach, and Rose. The first four images
represent Berry, the next four Natural, etc. The objective is to identify each part Cycle through all 16 images to verify that FindCircle is locating the part.
based upon its four colors.
5. Since the part can move around in the Field of View, we need to fixture. Select the 6. Continue with the first image of cosmetic cases. Insert a TrainExtractColor tool into
first (leftmost) image. We will use a FindCircle tool. Insert it into cell C10, with the cell C16. We will train this tool on four cosmetic cases, one for each product. For
following settings: training, we do not need to fixture, since we will position the region for each case.

7. Add a new model to your library named Berry. We’ll use the first image of Berry to
train all the shades found within this Berry combination of colors.

8. So that we represent each of the four shades with a single color, make sure that Most
Dominant Color is checked:

(If we checked Multiple Colors, the tool might identify more than one color for each of
the four colors in a cosmetic case. What would be the pros and cons of Dominant
Color vs. Multiple Colors?)

Page 5 Page 6
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

9. Click the Add New Color button. 10. Remove the Overlay of the spreadsheet (ViewOverlay) and notice the graphics
showing up over the color you just trained.

11. Adjust the color tolerances controls so that the desired shade is filled in as thoroughly
as possible, without filling in other colors.

Position the region on the color shown:

Before Color Tolerance After Color Tolerance

Page 7 Page 8
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

12. Repeat the previous steps to train the other three shades found in the Berry product. 13. Cycle to the first image for the next color combination (Natural). Repeat the steps
Graphics will be displayed for each of the trained colors. used above to now train for Natural, using the four colors in the Natural product.
Repeat the process for Peach and Rose. Be sure to take advantage of the color
tolerance controls for each color.

14. Click the OK button at the bottom of the window to return to the
spreadsheet.

15. Add an ExtractColor tool in cell C20. Don’t forget to add a comment.

Try the three options for Image Marking to see the effect on the display:

Page 9 Page 10
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

Set the Region to cover only the area where the four colors will be identified. You can
create a circular region using the bend icon to wrap the rectangle around on itself.

16. Set the Row and Column fixture parameters to reference the CentRow and CentCol
results from the existing FindCircle tool so the ExtractColor tool can track any
movement of the cosmetic case.

Leave a little space between the circle and the silver case to allow for possible
variation in fixturing.

17. Reference the Extract Color Library parameter to cell C11 containing the
TrainExtractColor you just created.

18. Click on the Color Models tab to verify all boxes are checked next to the color models
you have trained.

Page 11 Page 12
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

19. Click the OK button. This will create a table of results featuring the Lab Exercise 4.3: Complex Color Identification Using Extract Color Tools
associated auto inserted information identifying which of the color combination is
found within the region of interest. If Time Permits:
The cosmetic’s identify based on the color combination will appear at the top of the In this lab exercise, we want to inspect fuses to make sure that the fuse elements are
list. intact. The fuse element in a bad fuse will have two breaks.

20. Cycle through the images to test the results.


21. Save your job as MyExtractColor.job.
Good Fuse Bad Fuse
If Time Permits:
The difficulty with a greyscale image is that the greys around the link are all similar.
Select the first image of cosmetic cases. Skip 2 rows in the spreadsheet and insert
another TrainExtractColor tool into the next row. Repeat steps 7-21 above, except
specify Multiple Colors in step 8 and specify a single circular training region for each
model, encompassing the entire cosmetic area, instead of four per model.

This will cause the tool to determine how many colors will represent each of the four
models.
- How many colors did TrainExtractColor choose to represent each model?
- How did the pixel counts in step 20 compare to the counts when you used
Dominant Color?
- In general, what are the pros and cons of Dominant Color vs. Multiple Colors?

Page 13 Page 14
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

We will use the Extract Color tools to come up with images that are binarized, based on
the red color of the link: 9. Click the Rename Color button and rename Color_1 to Red_Link.

0 Blobs Reported 1 Blob Reported


10. Press the <Enter> key.
We will then apply a DetectBlobs tool to these binarized images, configured to report how 11. Click the Overlay button to remove the spreadsheet overlay (or select View 
many blobs are found. We will set it to ignore boundary blobs, so that a good fuse will give Overlay) and make note of the graphics (inverted pixels) showing up over the color
a result of 0 blobs, and a bad fuse will return a result of 1 blob. you just trained.
1. Use 5400C emulation. Start a new job.
2. Use comments to document each function entered into the spreadsheet.
3. Browse to (or Open) the images file in the ColorExtract_Fuse_Link folder and cycle
through the images to see the variations you will encounter.
4. Insert a TrainExtractColor tool into cell C5.
NOTE: No software fixturing is needed because the fuses are already mechanically
fixtured.
5. Click the New Model button to add a new model to your library.
6. Name the new model Red_Link.
7. Click the Add New Color button and place the tool region (circle)
somewhere on the fuse link itself, in an area free of any other markings, to represent
the color to train.
8. Click the Green Check Box or press the <Enter> key.
12. Adjust the Color Tolerance controls so that the link is as filled in as possible.

Page 15 Page 16
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

18. Check the Count Pixels box.

19. Click the Color Models Tab to verify all boxes are checked next to the colors you
Before Color Tolerance After Color Tolerance have trained.

13. Repeat Steps 7-12 to train the different shades/color of the Red Fuse Link if needed.
14. Click the Overlay button to bring back the spreadsheet overlay (or select View

Overlay). Click the OK button to exit the TrainExtractColor tool. Turn the
overlay back on.
15. Insert an ExtractColor tool into cell C11.
16. Set the ROI around the Fuse Link.
20. Click the OK button.
NOTE: This will create a structure and table of results with the associated auto
inserted information identifying which of the colors is found within the ROI.
21. Cycle through the images to test the results.
Based on the color combination, the Red_Link will appear in the Model Name
column.

17. Reference the Extract Color Library parameter to cell C5 containing the
TrainExtractColor you just created.

Page 17 Page 18
In-Sight Spreadsheets Advanced Section 4 | Lab Exercise In-Sight Spreadsheets Advanced Section 4 | Lab Exercise

22. Insert a DetectBlobs tool into cell C14 to determine if the Fuse Link is separated from If Time Permits:
the body of the posts.
a. Image: Reference the ExtractColor tool in cell C11 1. Add logic for Pass/Fail for an intact links versus a broken link.
b. Draw the Blob region within the ExtractColor region, to include the entire link.

c. Number to Sort = 0
d. Boundary Blobs = unchecked
e. Select Blob Color = White
23. Click the OK button.
24. Cycle through the images; verify the Blob tool has a count of 0 when the Fuse Link is
intact and non-zero when the link is broken.
25. Save your job as MyExtractColor.job.

Page 19 Page 20

You might also like