Inspect Image for Defects

NI Vision for LabVIEW Basics

Inspect Image for Defects

You can inspect an image for defects by comparing it to a golden template and by verifying characters in the image.

Compare to Golden Template

Use the IMAQ Compare Golden Template VI to inspect your image based on differences in intensity. Use the NI Vision Template Editor to learn golden templates for inspection. Select Start»All Programs»National Instruments»Vision»Template Editor to launch the NI Vision Template Editor. Use the methods described in the Performing Particle Analysis section, to analyze the resulting binary image.

Verify Characters

Use character verification functions to verify characters in your image.

Before you verify text, you must train the OCR Session with samples of the characters using the NI OCR Training Interface. Select Start»All Programs»National Instruments»Vision»OCR Training to launch the NI OCR Training Interface. You must then designate reference characters for each of the character classes in your character set. The characters you want to verify are compared against these reference characters and are assigned a score based on this comparison.

After you have trained the samples of the characters and assigned the reference character, use the following functions to verify the characters.

  1. In the initialization part the of code, use the IMAQ OCR Read Character Set File VI to read in a session that you created using the NI OCR Training Interface.
  2. Use the IMAQ OCR Verify Text VI to verify the characters inside the ROI(s) of the image under inspection.
  3. Use the IMAQ OCR Dispose Session VI to free the resources that the OCR Session used.