# Inspect Textures with Red Focused Unsupervised

Inspecting textiles is a typical example of an aesthetic inspection. Defects can be of many different types, ranging from problems in the weaving pattern, defective or bad yarn, stains and infinitely many more. The challenge is even bigger when the fabric is not perfectly aligned in front of the camera, but may shift, shear and rotate quite dramatically.

This tutorial shows a typical textile example, using a couple of images from a textile which shows a relatively complex yet repetitive color pattern. The images are taken from random positions, so that each shows a distinct, precise view. Furthermore, the images show quite a degree of shear and rotation, demonstrating the flexibility of the Red Analyze Tool.

Note: For more information on the specific steps of setting up the tool, see

The objectives of this tutorial are:

- Get to know the Red Analyze Focused Unsupervised tool.
- Label images as good or bad.
- Introduce database statistics sidebar.
- The role of the Feature Size and Border Type parameters.
- Use the Perturbation parameters to improve performance.

1. Add the images for the Textiles tutorial.
2. Add a Red Analyze tool and switch this tool to Red Analyze Focused Unsupervised.
3. Segment the images by clicking the Scissors icon.

4. Label the images as Good or Bad depending on whether or not they show an anomaly.

   Note: You can simplify the process by using the Label Views option in the View Browser.
5. Click the Train icon.
6. After training, review the results.
7. Expand the Database Overview, and in the interactive Scores graph, lower the green Threshold slider, and you can see that the system tends to respond to the good images that are close to the border.
8. Right click on an image and from the menu, select Edit Mask and using the Edit Mask toolbar, use the Add Border option to add a mask to the border of the image.
9. In the Edit Mask toolbar, press the Apply button and apply the border mask to all the images in the database.
10. Reprocess the images and review the results.
11. There may still be a response in the strongly skewed region of the second bad image.
12. Go to the and change the Shear and Aspect-Ratio to 5% and retrain.
13. After training, these responses should be reduced.