Example Code

Using VDM to Find the Average Pixel Values of Particles using LabVIEW

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

This example uses Vision Development Module VIs combined with array math to find the average values of pixels inside individual particles in an image.

 

Description

To perform particle measurements beyond binary images, the Particle Analysis VI contains outputs such as bounding box coordinates to use with grayscale analysis VIs. For more unique analyses of non-rectangular or -circular particles such as intensity measurements, the easiest approach is to use array math rather than IMAQ Masks. This example averages the intensity values of discrete particles identified from a binary particle analysis. The results are then overlaid on the image.

 

Requirements

 Software

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

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Download and open the attached file
  2. Run the program

 

Additional Information or References

Pixel Value Averaging of Particles LV2012 NIVerified.vi - Front Panel.png

 

Pixel Value Averaging of Particles LV2012 NIVerified.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.**

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

Comments
prashamthitzme
Member
Member
on

Great work Mr. karl-G. I'm designing vision based project to messure dimensions of an object. can u please suggest some useful tools for my project. thank a lot man keep rocking.

Karl-G
NI Employee (retired)
on

The best place to start are with the Vision Development Module shipping examples for caliper functions. The Clamp example shows how to use the caliper to find the dimensions of an object. These can also be paired with the calibration VIs to turn pixel values into real world distances.