Example Code

Calculate Overall Image Intensity

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 calculate the mean intensity of an IMAQ image section.

 

Description
With the 'IMAQ Histogram' function it is possible to calculate the overall intensity of an image or the intensity of an image section.

To calculate the intensity of an image section a mask has to be created. The mask normally is created from a ROI (region of interest) that in this example can be easily selected by the user with the 'IMAQ ContructROI' function.

 

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. Run the VI
  2. Select any available ROI (region of interest) tool and create a ROI and click OK

 

Additional Information or References

IMAQ Calculate Image Intensity LV2012 NIVerified_2.vi - Front Panel.png

 

IMAQ Calculate Image Intensity LV2012 NIVerified_2.vi - 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.**

Ashish Naik
Automotive Business Development Manager
National Instruments UK

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

Comments
udka
Active Participant
Active Participant
on

I don't understand why so much complexity? Use IMAQ ROIProfile VI with given ROI, no need of masking, casting.

 

Edit: Also the heading is misleading, is it Overall Image Intensity or the selected Region Mean Intensity?

Thanks
uday