LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ROI Rect to Array of ROI Line (IMAQ VISION)

Hey everyone,
 
I've gotta reemphasize this, this is the best software forum I've ever used.  Using only this and teaching myself from the labview help files and templates I've learned so much.  Labview's awesome.
 
Anyways, I need to make a .vi which will convert an ROI rectangle to an array of ROI lines... or just an array of lines.  Does anyone know how to do this?
 
I'm not sure, gonna check it out now, but I think that the ROI rectangle is just specified by an ROI type specifier and two sets of coordinates cooresponding to the two corners of the rectangle.  I'm going to work on it now, but if anyone can help me I'd greatly appreciate it.
 
Thanks,
 
Jonathan
0 Kudos
Message 1 of 6
(4,672 Views)
I don't have a ready-made example, but you should be able to do this rather easily. You need to use IMAQ ROItoMask, then IMAQ Mask to create the image of just the ROI. Then you can use IMAQ ImageToArray.
 
 
PaulG.
Retired
0 Kudos
Message 2 of 6
(4,668 Views)

Hi,

 

Thanks PaulG for your answer! I would just add that before using ImageToArray that will give you the array of the entire image, I use IMAQ ROItoRectangle that gives the four coordinates of the ROI.

 

And then I use IMAQ ImageToArray and I use the coordinates to link the optional rectangle! And I obtain the array for the only region of interest desired.

 

Chris

 

 

[Edit] We can get the coordinates of the ROI (draw event) with a property node of the image...

 

What's best ? What is ROItoRectangle for ?

Message Edited by christophe69000 on 07-23-2009 09:05 AM
0 Kudos
Message 3 of 6
(4,410 Views)

Hi Chris,

 

For the purposes discribed in this thread, they both do the same thing. It really doesn't matter which one you use.

ROI to Rectangle has additional information if the ROI has been rotated. The property node has additional information if the ROI is not a rectangle.

0 Kudos
Message 4 of 6
(4,395 Views)

Hi people,

 

I have a rotated ROI from where I would like to get the pixel values.

 

The ROI is as attached..........I am not too sure how to convert this to the Global Rectangle that is needed for the IMAQ ImagetoArray

 

Please kindly assist me

 

Thanks

Kevin

 

 

0 Kudos
Message 5 of 6
(3,667 Views)

Hi Pierreiza,

 

I suggest creating a discussion topic to boost the signal on your request. You will get a better response from the community.

 

Additionally, could you please clarify the problem? Do you want to create a rotated rectangular ROI?

 

Regards

Michael Bilyk

Applications Engineer

National Instruments

 

 

Michael Bilyk
Former NI Software Engineer (IT)
0 Kudos
Message 6 of 6
(3,620 Views)