Hello,
This is very difficult to answer without examples of what's good or bad. Usually if you can see a defect easily enough, it should be easy enough for the software to pick it out. If you could send some example images of what kind of defects you're looking for and some examples of good samples, I could send you the results of some processing so you can get an idea how it would work.
Go to www.ni.com/ask to email tech support.
Thanks,
Brad Buchanan
www.ni.com/ask
National Instruments