Image Enhancer vTool#
The Image Enhancer vTool accepts an image via the Image input pin and outputs the filtered image via the Image output pin.
If you use the ROI Creator vTool to specify a region of interest before enhancing, the Image Enhancer vTool accepts the ROI data via its Roi input pin. In that case, only the region of interest is enhanced, which results in faster processing.
How It Works#
The Image Enhancer vTool offers two enhancement operations:
By stretching the histogram, the lower and upper limits of the histogram are modified. All gray values below and equal the lower limit are mapped to the gray value 0. All gray values above and equal the upper limit are mapped to the maximum gray value (i.e., 255 for 8-bit pixel formats or 65535 for the other pixel formats). In mathematical terms, the histogram stretching is a linear transformation defined by the two user-defined limits.
There are two ways to specify the new upper and lower limits of the gray value range:
- Adaptive: The gray value range is determined by analyzing the individual image's histogram. By specifying a relative rank, you can discard gray value sections at the upper and lower ends of the range.
- Fixed: You can manually specify the new lower and upper limits of the gray value range. These limits will be the same for all images.
For color images, the adaptive mode works on the three color channels separately. As a consequence, the overall color appearance of the image may change.
Using the fixed mode, the same limits are applied to all color channels.
In fixed mode, processing is so fast that the processing time is negligible. In adaptive mode, the histogram of every image is analyzed but processing is still very fast.
Equalizing the histogram means that all gray values of an image are distributed evenly across the entire range, e.g., 0–255. By doing this, areas of the histogram with high gray value populations are stretched and areas only sparsely populated are condensed. This results in a linear histogram.
For color images, the three histograms of the color channels are equalized separately. As a consequence, the overall color appearance of the image may change.
Because the histogram and its equalization are computed for every image processed, the processing time depends on the image size.
Images with Constant Histograms#
In this scenario, the gray value range of the incoming images is constant but a bit low in contrast. For example, if the gray value range is between 0 to 100, you can set the limits to 0 and 100. The resulting images are then stretched to the full gray value range and you get bright images with good contrast.
Images with Varying Histograms#
In this scenario, the gray value range of the incoming images may change over time. However, the application requires constant histograms or gray value contrasts. In this case, you can use the stretching method with adaptive limits or the equalization method.
Use stretching for general use cases. If the gray values in the histogram are distributed very unevenly, it is better to use equalization.
Configuring the vTool#
To configure the Image Enhancer Basic vTool:
- In the Recipe Management pane in the vTool Settings area, click Open Settings or double-click the vTool.
The Image Enhancer Basic dialog opens.
- In the Enhancer Operation area, select the desired operation.
- If you have selected Stretch histogram, select a stretching method.
- If you have selected Adaptive, specify a rank.
- If you have selected Fixed, specify a lower and an upper limit.
You can view the result of the enhancement in a pin data view.
Accepts images directly from a Camera vTool or from a vTool that outputs images, e.g., the Image Format Converter vTool.
- Data type: Image
- Image format: 8-bit to 16-bit mono or color images (see Supported Pixel Formats)
Accepts a region of interest from the ROI Creator vTool or any other vTool that outputs regions or rectangles. Multiple rectangles or regions are merged internally to form a single region of interest.
- Data type: RectangleF, RectangleF Array, Region, Region Array
Returns the filtered image. The output image can be used by any vTool accepting images as input.
- Data type: Image
- Image format: Color or mono images (see Supported Pixel Formats)
Supported Pixel Formats#
Depending on the pixel format of the input image, the Image Combiner vTool outputs the following pixel formats:
|Input Pixel Format||Output Pixel Format|
|Bayer GR 8||RGB 8 Planar|
|Bayer GR 16||RGB 16 Planar|
|Bayer RG 8||RGB 8 Planar|
|BGRA 8 Packed||RGB 8 Planar|
|BGR 8 Packed||RGB 8 Planar|
|Mono 8||Mono 8|
|Mono 10||Mono 10|
|Mono 12||Mono 12|
|Mono 16||Mono 16|
|RGB 8 Packed||RGB 8 Planar|
|RGB 16 Packed||RGB 16 Planar|
|RGB 8 Planar||RGB 8 Planar|
|RGB 16 Planar||RGB 16 Planar|
- Any image processing vTool