LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer the image processing steps from subVI to its Main VI front panel image control?

Manu,

I tried out the reference/property node method this morning, and I apologize that this did not work.  This time, I tried out my suggestion before making it Smiley Happy.  I was able to use a global variable to update the main vi in a similar application.  I am attaching a main VI, a sub VI, and a global variable.  Run the main VI, and notice that there is no image in the display.  Now, as soon as you run the sub VI, the image that is referenced in that VI will show up in the Main VI.  The image.VI is a global variable that is being used to store the information.  One note, you will need to change the path in the sub VI to point to an image of yours!

Respectfully,
Download All
Message 11 of 20
(1,859 Views)

Hello Jeffery,

It just work great!!   Now I am going to apply this in my program and see its effect.

Once again, Thanks.

Manu

0 Kudos
Message 12 of 20
(1,847 Views)

Hello Jeffery,

I tried the global variable method in my application, but with little sucess. It definitely update the MainVI, but only once (similar to my very first approach). I think the reason is, the global variable doesn't carry the image pallet information (i.e. each image control can be used to display gray or binary image). My SubVI has 10 cases to process and in each case, I had defined the pallet selection (i.e. gray or binary) suitable as per the analysis being performed. In order to view the same image in MainVI, somehow we need to carry the pallet selection info along with the image. And also the global variable will needs to be updated 10 times.

Any more suggestion !!!!!!!!!!

Manu

0 Kudos
Message 13 of 20
(1,843 Views)
Manu,

You are right!  Each time that the image display on the front panel needs to be updated, the global variable information will have to be written in the sub-VI.  You can have a parallel loop on the front panel that runs and does nothing but update the image display from that global variable, much like in the example that I posted.  One way to update the palette is the following.  Each global variable gives you the option of creating many controls/indicators on the same global front panel.  Simply create a control/indicator to store the palette information, and when you read from the global variable, update the palette on the main VI image display with a property node implicitly linked to that control (right-click and choose property --> palette).

Respectfully,
Message 14 of 20
(1,833 Views)

Hello Jeffery,

Thanks for your reply. The solution works out well, but I still feel there should be a better way of updating IMAQ images, similar to refrence control in graphs through "value " property etc. I hope the NI will come up with better solution in their next release. Thanks.

On seperate note....... In a "Calibrated Binary Image", How can I fit an Arc/Circle to a bunch of pixels. I need to find out the Radius of an best fit Arc/Circle excluding outlier pixels. The mentioned binary image is enclosed for your reference. Is there any direct VI available or how can extract the pixel coordinates (real) ?. Thanks for all your help.

Manu

0 Kudos
Message 15 of 20
(1,816 Views)
Manu,

There isn't going to be a function that performs this operation for you; however, I can lead you in the right direction of how to accomplish this.  The "hard" part of this is going to be finding the endpoints and midpoint of the curve.  Once we have these numbers, recreating a fit to those points is relatively easy using built-in LabVIEW curve fitting features.  The best way that I can think of determining the end and mid points is using Particle Analysis.  Particle Analysis can give you a bounding rectangle for the pixles after a threshold.  You can determine some sort of algorithm to use based on the orientation of the curve in the image, to then determine the end and mid points of the curves.

I hope that helps!

Respectfully,
Message 16 of 20
(1,797 Views)

Hello Jeffery,

Thanks for your reply. I am aware of Particle Analysis features in Vision ToolKit. I had used them in past and it works great.

But for above mentioned application, I had just completed the C-program, which works fine with pixels coordinates. There are two things I need to know ----

1. How can extract the real cooridinate values (as the image is callibrated) of the selective binary pixels (e.g. white ones) and stored them in Array in LabView?

2. How can I use the external C-Program to be a part of my LabView application (i.e. executed thru LabView), so that I can input the above generated array into C-program and get the results back on to labview front panel?

Thanks for your help.

Manu

0 Kudos
Message 17 of 20
(1,788 Views)
Manu,
You can access your c program by turning it into a dll and then using a LabVIEW Call Library Function Node . We also have a great resource that discusses Using External Code in LabVIEW. There's also an example titled Calling a C-built DLL in LabVIEW to Generate and Sort an Array of Numbers. Lastly, we have an example that ships with LabVIEW called "call dll.vi". You can get to it by going to Help>>Find Examples and then search for "dll".
 
That should get you started. Let us know if you have other question.
 
Chris C
 
Message 18 of 20
(1,762 Views)

Hello Chris,

Thanks for your reply. I am going to try this. There is any guidance on Q1. (i.e. Extracting .... Real pixel coordinates!!!)

Thanks

Manu

0 Kudos
Message 19 of 20
(1,761 Views)
Manu,

The VI that you are going to want to use is IMAQ Convert Pixel to Real World.  The help documentation should provide all of the information that you will need.  Basically, you will need to "calibrate" the image with a template.  The template will consist of a grid of pixels where you enter information about the coordinates in pixel values and the corresponding real-world coordinate values.  It then calibrates the image to these real-world coordinates. 

There is a shipping example included with the Vision Development Module that illustrates this behavior.  It is called Simple Calibration Example.VI.  There is also included a Pattern Matching examples that includes a calibration.

Respectfully,
Message 20 of 20
(1,744 Views)