This is a classic problem in web inspection.
I would ideally recommend a texture based operation.
With the IMAQ Vision library, you should use a convolution and/or a morphology function as the first processing step. You want to be able to use the geoemtrical and frequency characteristics of your defect.
The problem with using straightforward thresholding is that this method is sensitive to the eveness of lighting as well as the stability of light output. Also you will find yourself continually adjusting the threshold.
Even with the smarter auto and local thresholding methods, you not find this method to be robust.
Also be aware that you should try to accumulate as many defect samples as possible to account for variations in the background and the defect itself.
You may start this machine vision project to find and fix a certain defect you are seeing now. Once you control and/or quarantine this defect, you may find other defects you want to detect.
In order of importance, your vision solution should be:
1. Robust - not require frequent tweaking of parameters due to variations in the product (fabric), process, and defects.
2. Fast - to keep up with your process throughput.
3. Flexible - to allow for changes in the detection algorithm
Message Edited by taufiqhabib on 03-17-2005 12:09 AM