To download NI software, including the products shown below, visit ni.com/downloads.
This example demonstrates how to extract parts of an image based on a user defined ROI (Region of Interest).
Description
This example code enables you to extract parts of an image based on a ROI. You can use any type of ROI with this example. You are not limited to the rectangle ROI.
If you use a ROI which creates a closed area, the extract image contains the image inside the ROI. If you use a ROI which doesn't creates a closed area, the resulting image only contains the pixels under der contour of the ROI.
This example takes your ROI and converts it into a mask. This mask is used to mask out any pixels which are not part of the ROI. After this step, the example cuts out the image based in the bounding rectange of the ROI.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
NOTE: This VI is compatible with the following file types, all others will result in error: PNG, JPG, JPEG, JPG2000, TIFF or BMP.
**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.
Hi Michelle_B
I’m new to LabVIEW and even newer to the Vision Development Module. I understand what you say about the non-rectangular RoI not returning a non-rectangular RoI.
In your experience (or indeed that of anyone else reading this) is it possible to use or modify this technique or any other to just extract the pixel values of the region you are interested in?
Context: I have an image and in it lies a disc of varying intensity; its position and size will vary. I would like to highlight the disc and output the statistics for it.
Kind regards,
Chris
Hi Chris,
This is probably not the best place to get your question answered - repost your question here: http://forums.ni.com/t5/Machine-Vision/bd-p/200
it's our Machine Vision discussion forums, they are generally very active so you should get a response from someone in the community this way.
Cheers,
Michelle
thank you for offering methods to crop image by using this development version. can i ask if i use it. how to activate licese key in this situation.
Hi there,
You need to have Vision Development Module: https://www.ni.com/en/shop/data-acquisition-and-control/add-ons-for-data-acquisition-and-control/wha...
You get a license with a purchase of this module.
how can i make extracted roi more visualised