LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

defining a rotated region of interest (ROI)


hello all,

i'm using the IMAQ Snap.vi and i need to define a rotated rectangle for the region of interest.  it seems to only accept pixel values that define a horizontal/vertical ROI.  is there a simple way to create a rotated ROI?  

thanks,
dan


0 Kudos
Message 1 of 6
(4,396 Views)
I am not sure about using IMAQ functions but more generically you can define a ROI rectangluar region (you will need 3 points to define this instead of 2), rotete the image around the center of ROI by the difference between the ROI slope and the horizontal axis (just a simple image translation and rotation)  and then use the rotated rectangular region for processing.  Remember images have no true coordinate system and is relative to the freame of reference.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 6
(4,383 Views)
Hello dantimatter,

Thank you for contacting National Instruments.  You can define a rotated rectangle ROI by selecting the ROI tool that is right below the rectangle ROI tool.  It should appear as a rotated rectangle.  When you place this ROI rectangle onto your image, you will see crosshairs appear when you place your cursor over the ROI rectangle.  Click and drag one of the lines that are part of the crosshair, and you can rotate the ROI rectangle.

If you cannot find the rotated rectangle
ROI tool in the ROI tool palette, make sure that you have it checked as visible.  To check for visibility of your ROI tools, right-click on the ROI tools palette, and go to Visible Items >> ROI Tool Button Visibility. A VI should appear with a bunch of toggle switches that allow you to define which tools are visible.  Click on the "All Visible" button, and click "OK."  This will display all ROI tools in the ROI Tools palette.

If you cannot see your ROI Tools palette at all, right-click on your acquired image, go to Visible Items >> ROI Tools and select  "Visible."

Regards,

Mike T
National Instruments
0 Kudos
Message 3 of 6
(4,371 Views)
i'm sorry, i don't quite understand.  the IMAQ Snap VI seems to only have an input for an array of four numbers that define the ROI.  in the image window, i see the toolbar with the rotated rectange drawing tool, and i can draw the rotated rectangle on the image, but it doesn't 'set' that rectangle as the ROI. 

thanks,
dan
0 Kudos
Message 4 of 6
(4,369 Views)
alternatively, is there a VI that i should use that's better than IMAQ Snap for this kind of thing?  or perhaps it would be easier to rotate the image before i snap it?  any thoughts would be appreciated.

thanks,
dan

0 Kudos
Message 5 of 6
(4,366 Views)
Dan,

I apologize for the misunderstanding.  I am thinking of the wrong type of ROI.  I am assuming that you want to restrict the acquisition window of your camera to a rotated ROI.  If this is the case, then you are probably going to have to rotate the camera to the angle that you are planning to create the ROI for.  The ROI that defines the acquisition window is limited to a rectangle with no rotation.

If you are planning to acquire the entire image first and then create an ROI off of the image, then it is possible to create a rotated ROI.  Doing so will involve manipulation of the image using NI-Vision.

Regards,

Mike T
National Instruments
0 Kudos
Message 6 of 6
(4,334 Views)