The Cognex Histogram tool computes histograms and histogram statistics for acquired images. A histogram is a one-dimensional function of pixel values that represents the distribution of pixel values in a window. A typical histogram is characterized by the presence of peaks, or modes, representing the pixel values found in the dominant window features. The effects of noise from various sources – for example, spatial quantization error, uneven printing, irregular lighting, or electrical noise – cause these peaks to spread out. Machine vision applications rely on the Histogram tool to determine pixel count, contrast, and brightness.The Histogram tool can generate a number of statistics, including:
- Pixel count
- Mean, median, and modal pixel value
- Minimum and maximum pixel values
- Standard deviation and variance of pixel values
Users generate a histogram by supplying the Histogram tool with an acquired image. The Histogram tool returns a histogram in an array of 32-bit values. Histograms can be used to measure the brightness threshold for an image or section of an image in order to determine the presence/absence of a part or to determine relative fill levels.
Image processing filters prepare images for analysis
Image processing tools help optimize images for analysis by removing unwanted or distracting features, heightening contrast, and removing noise. This critical first step helps ensure accurate, repeatable inspections once image analysis tools are applied.Cognex image processing tools optimize images in several ways by:
- Correcting uneven lighting or shading from your image for a clean, clear image to work with
- Filtering out unwanted or confusing backgrounds to highlight the part to be inspected
- Filtering out all colors except for the one(s) you want for easy detection and inspection
- Rotating and unwrapping acquired images
- Cognex image filters filter out noise due to lighting or poor contrast, smooth and sharpen edges, and remove specular glare.
- Cognex Image Transform changes an image’s pixel coordinates into real-world calibrated units
- Image Transform can even adjust curved lines to straight lines for the most accurate measurement during inspection.