To download NI software, including the products shown below, visit ni.com/downloads.
Overview
The example demonstrates how to select and extract a rotated rectangle from an IMAQ image.
Description
The 'IMAQ Select Rectangle' function allows the user to specify a rectangular area in the image. It then outputs the coordinates of that rectangular area to be used with other functions. For example, if used with the 'IMAQ Extract' function, the user can output a separate image display that will just show the selected rectangular area. The 'IMAQ Select Rectangle' function also allows the user to select a rotated rectangular area. However, in order to appropriately extract the selected rotated rectangular area in a separate image display, you cannot simply wire the rectangular coordinates into the 'IMAQ Extract' function as done previously. The easiest way to extract the image while maintaining the appropriate rotation angle involves using the 'IMAQ Convert Rectangle to ROI', the 'IMAQ Extract Tetragon' and the 'IMAQ Rotate' function.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
**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.