Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to process the "Find Edges" result with LabVIEW?

I am using VBAI 2010's "Find Edges" step to find a large number of lines. The results I got are:

- Edge [1].X Position, Edge [1].Y Position, Edge [1].Distance, Edge [1].Strength

- Edge [2].X Position, Edge [2].Y Position, Edge [2].Distance, Edge [2].Strength

- Edge [3].X Position, Edge [3].Y Position, Edge [3].Distance, Edge [3].Strength

-..... and so on.

 

I'd like to extract all the X Positions results and use LabVIEW to do processing. How can I do that? I understand that I can do a "Update Inspection UI" step in VBAI, but exactly how to do it?

The structure in LabVIEW should be cluster I guess?

Can someone post example code?

Thanks.

0 Kudos
Message 1 of 6
(3,266 Views)

Are you using the LabVIEW API to control VBAI from LV and you want to get the results from VBAI into your LV code using the API, or do you want to process the results in a Run LabVIEW step within VBAI?

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

My program is written in VBAI, but the Inspection Interface is written in LV. So in my VBAI, I will call a step "Update Inspection UI" which will feed the measurement data to the LV front panel.

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

There is currently no way to set all the X Position data to an array. This is something I hope to add in a future release, but in the mean time, you can always have an individual numeric for each edge you expect to have and then you could build it into an array in the block diagram of the inspection UI VI and display the array on the front panel. Here is a sample of how to do that. I included the VI as well.

 

Hope this helps,

Brad

Download All
Message 4 of 6
(3,259 Views)

Ok thanks Brad.

But for 1000+ entries it will be a problem..

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

Hi splee,

you actually can transfer all the elements to labview, but it is very slow, because the elementloops within vision builder are slow.

 

You need to:

1. Build a loop, which loops over all the Elements (I used this for my Particle Analysis Result)

2. After you got all the needed Values of the current Element, you can wire them with a customVIstep, which looks like the image below. (its german sry)

3. After you have added every last Element, you may work with that array, but you need to start all actions within that customVI, because you cant transfer it to another one outside the customVI itself. You can try to build a functionvariable which represents a code like

0 = add element

1 = reset elements

2 = function: Sum all angles

3 = ...

 

Once you got all the elements into that array, you can work at normal speeds.

 

For a little better performace, initialize the array with the right size, the picture shows the easiest way to transfer all elements...

Message 6 of 6
(3,246 Views)