Example Code

Edge Detection using Vision Development Module for LabVIEW

Overview

 

Use the Edge Tool to find edges or sharp transitions in the pixels values along a given line or ROI profile. Edge locations can determine the dimensions of an object in a gauging application or identify cracks during quality control inspections.

 

Description 

 

The Edge Detection example shows you how to get the line profile, gradient information and number of edges detected along a line ROI.

The example allows you to draw the line ROI anywhere on the image and will overlay red dots on the location(s) along the line ROI where edges are detected.

 

The IMAQ ROIProfile.vi returns information about the line profile of the ROI selected.

The IMAQ Edge Tool 3.vi returns the gradient information as well as the edges detected along the line.

 

Hardware and Software Requirements

 

Vision Development Module.

 

Steps to Implement or Execute Code

 

  • Find the example under Help >> Find Examples >> Toolkit and Modules >> Vision >> Caliper >> Edge Detection.vi
  • Run the VI
  • Draw an ROI in the image or change the Process of Edge Options to see the edges detected along the ROI

 

Additional Information or References

 

IMAQ Edge Tool 3 Help Documentation:

http://zone.ni.com/reference/en-XX/help/370281AD-01/imaqvision/imaq_edge_tool_3/

Front Panel

Edge Detection Front Panel.PNG

T. Le
Vision Product Support Engineer
National Instruments

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

Comments
samihamid
Member
Member
on

By using the above Vi is it possible detect broken Pills ?

samihamid
Member
Member
on

Bad Image 2.png

Contributors