From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Set XY Coordinate in Vision Builder AI (VBAI)

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

  • LabVIEW

Code and Documents

Attachment

Overview

If you inspect multiple images the inspected object is moving. Therefore it's required to set a coordinate system. This example is using edge detection from two directions to calculate the intersection and set the coordination system.


Description

This example set's a coordination system based on the location of the object. Functions that are placed afterwards should reference to the coordination sytsem. To make sure the functions are moving relative to the coordination system.

Requirements

NI Vision Builder for Automated Inspection (VBAI) 2010 "or compatible"

Steps to Implement or Execute Code
In order to set XY Coordinate system in VBAI, you would need to do the following

1. Find Edge for Y axis

2. Find Edge for X axis

3. Find the intersection for those edges

4. Set XY Coordinate

Untitled.png

Additional Information or References

Note: You might have to increase the region of interest for the edge detection to make sure it covers the left bottom of the object.

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit thisdiscussion thread**

Andy Chang
National Instruments
LabVIEW Control Design and Simulation

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

Contributors