Hardware manual

Impact Reference Guide Light Leveling
3-47 Datalogic Automation Inc.
Weighted Average Calculation
The output image pixel value is calculated as follows:
output pixel = (input image pixel * input image weight + secondary image pixel * secondary image weight)
/ (input image weight + secondary image weight)
The scaling of the weights and the scaling of the output image is handled automatically by the above for-
mula. For example, the output will be the average of the two inputs as long as the input weight and second-
ary weight are equal, regardless of their actual value (except zero).
The input image and secondary image must be the same height and width. If the secondary image is null
(non-existent), the output image will be a copy of the input image.
Averaging more than two images
The recommended method (recursive filter) is:
1. Use a counter tool to track the number of images.
2. In the Image Math tool, link the Secondary Image input to the tool's Output Image, so that each input
image is combined with the result of averaging all the previous images.
3. In order for all the images to be weighted equally, the weight of the Secondary Image must be
increased each time the tool runs, so link the Secondary Image Weight to the Counter tool value.
4. Set the Input Image Weight to 1.
When the first image comes into the tool, the Secondary Image Weight (from the Counter) should be 0, so
that the Output Image is just a copy of the input image. When the second image comes in, both weights are 1
and the two images are averaged evenly. When the third image comes in, the Secondary Image (the average
of the first two images) now has a weight of 2 and gets weighted twice as much as the Input Image, so that
all three images are being given the same weight. In this way any number of images can be averaged by just
changing the end value of the Counter tool.
Light Leveling
In the Image Filtering Drawer
The Light Leveling tool corrects for uneven lighting in an image. Within the Light Sensor Shape List area,
the column or row with the highest average grey level is found (based on the Direction To Level input). A
Secondary Image The operation is performed on this image and the Input image (except
for NOT and Invert)
Operation The operation to perform
Input Image Weight Used only for the Weighted Average operation. See “Weighted Average
Calculation” on page 3-47 for details.
Secondary Image
Weight
Used only for the Weighted Average operation. See “Weighted Average
Calculation” on page 3-47 for details.
Output Name What it is
Output Image The image resulting from the math operation
Input Name What it is