Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Completeting vi IMAQdx ROI

Solved!
Go to solution

Hi,

In my previous project I was given to modify a vi, now I was given another vi which was a subvi of another vi.

This vi calculates the centroid area and has a user defined ROI. My first problem is that since it was a subvi, I'm not sure how to connect it to IMAQdx to grab a frame/video. I've tried putting it in a while loop and adding camera, open session, grab, and IMAQ, but it didnt work. I would really appreciate it if someone can explain to me how to convert it to a stand alone vi.

The ROI will be a dark centroid with a white background around it, so I assume I need to define a mask for it too. Am I correct?

 

Thank you,

Download All
0 Kudos
Message 1 of 6
(3,790 Views)

Last attachment...

0 Kudos
Message 2 of 6
(3,789 Views)

Simply_me

A SubVI merely passes in inputs and out outputs.  Therefore, you can simply copy and paste the code in your sub VI and wire the inputs and outputs directly to the other aspects of your code (ie connect the wires to the inputs and outputs).  Is your application running correctly as is with the SubVI in place?

Regards,

Mike S
NI AE
0 Kudos
Message 3 of 6
(3,758 Views)

Hi Mike,

 

I've seen the subvi. work as part of a larger vi. I only want to take this ROI portion and make it a stand alone vi (which i'll add other things to it later), the important thing is to be able to define the ROI in real time (while the vi is running). I've tried to make the following changes which are pretty standard in IMAQdx, but I dont think it is working. Please review the attached file.

0 Kudos
Message 4 of 6
(3,755 Views)
Solution
Accepted by topic author simply_me

Simply_me-

I don’t see any aspects of your code that are creating an ROI.  I would suggest using the ROI palette and ROI functions to help you with this.  It can be found in Vision & Motion>>Vision Utilities>>Region of Interest>>Region of Interest Conversion.  These functions let you use different shapes or points found on your image to create an ROI.  Will this work for your application?

Regards,

Mike S
NI AE
0 Kudos
Message 5 of 6
(3,732 Views)

Hi Mike,

 

You are abolustely correct, I've met with the guy who wrote the complete vi and it turns out he didn't send me the ROI definitions (using mouse movements) and the mask definitions. Furthermore, since using the mask it'll be challenging to define multiple vi's, I've decided to modify a vi that I have plus modifying a particle analysis example. (I'll probably post questions about it now actually, in a different thread).

Thank you for your answers.

0 Kudos
Message 6 of 6
(3,723 Views)