Example Code

Average a Sequence of Images with the Vision Development Module

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Vision Development Module
  • LabVIEW

Code and Documents

Attachment

Overview

The example demonstrates how to average multiple images into one.

 

Description

A folder containing multiple images are loaded and displayed in an adjustable speed. The images are averaged and after all images of the specified folder have been displayed the averaged images is displayed.

To average the image simply the pixel values of every image are added and then averaged by dividing the sum by the number of images. For that it is important to use a data type that is large enough to be able to store the value without saturating. That is why the unsigned 8-bit integer value is converted to an unsigned 32-bit integer value.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)
  • Vision Development Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. (Optional) Change the setting on how fast the images are replayed
  3. Run the VI 

 

Additional Information or References

IMAQ Average Grayscale Images - Front Panel.png

 

IMAQ Average Grayscale Images - Block Diagram.png

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
seniya
Member
Member
on

Hi,

    Thanks for the example. I have tried this example in my code to capture four averaged images. I am triggering a PZT to move a mirror with fixed voltage to shift the image. I need to capture an averaged image, let say an average of ten images, at every move by pzt. I want to save averaged image each time separately in png or tiff file format. Please find the attached image of the vi for your kind information. I am not able to attach the VI. 

 

I would appreciate if some one help this VI to work as I expected.

example.png