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

Bounding Box to Rectangle ROI

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 convert a bounding box to a rectangle shaped ROI.

 

Description
When working with the NI Vision Development Module you may find yourself running inspections with steps oriented to find patterns, objects or image templates. Some of these functions output a bounding box which is basically a rectangle with the coordinates of a binary object.

The example converts the bounding box to a ROI (region of interest) so the information can be used where a ROI is required.

 

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. (Optional) Change the Bounding Box predefined settings
  2. Run the VI

 

Additional Information or References

Convert Bounding Box to Rectangle ROI LV2012 NIVerified.vi - Front Panel.png

 

 

Convert Bounding Box to Rectangle ROI 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.**

Alejandro C. | National Instruments

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

Comments
eduardochinen
Member
Member
on

alcava.cr,

 

I use your example together with this IMAQ zoom to ROI from Kev_R and I was able to zoom on a QR Code read from a jpg file. Thanks a lot.

I left a copy of the code on the page from Kev_R article.

Here is a picture of my VI.

2018-05-02.png