LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolation of curve with loops

I have an image on which I need to select points and then use motion control to etch the curve defined by my points. Motion Assistant cannot import my image, so I am building my own interface in LabVIEW.

Here's how I have it working now:

Get the image in LabVIEW
Define the points in LabVIEW
Export them to file
Import the file into the Motion Assistant
Use contouring to smooth things
I usually get the desired curve (near as I can tell without the image) and can begin the etching process.

When I do not get the desired curve, I need to start over and define a few more points in the problem region. This is tedious and not the user friendly UI that a customer would want.

I would like to perform the same or similar interpolation as the Motion Assistant's contouring on my image in LabVIEW then use the motion control VIs to do the etching. Is there a way to do contouring style interpolation?

I tried to use the spline interpolation, but my defined curve often has places where there can be loops (the curve crosses itself) or at least multiple Y points for a single X value (such as vertical lines or double-backs) and the spline interpolation that is included with LabVIEW errors. Is there another way to do it? I mean, I know that it works in the Motion Assistant so I know that there is a way to do it, the real question is how to get at the algorithm that the Motion Assistant uses or something similar.

Thanks,
Bob Young
0 Kudos
Message 1 of 29
(4,655 Views)
After you define your points on the image (make sure you define them in the correct order) make a spline curve of [x vs. index] and [y vs. index], then combine the two splined arrays in an XY graph.
Message 2 of 29
(4,646 Views)
Bob,

I wired up a quick demo (LabVIEW 7.0) over breakfast. 🙂 Enjoy!
Message 3 of 29
(4,641 Views)
Thanks!

That is exactly what I was looking for. Of course it seems obvious after you have the solution, but that is often the trouble with genious answers, isn't it? 🙂

Thanks again,
Bob Young
0 Kudos
Message 4 of 29
(4,626 Views)
And I thought Wheaties were good for breakfast.


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 29
(4,616 Views)

@Ed Dickens wrote:
And I thought Wheaties were good for breakfast.


Gives new meaning to the words "number crunching" 🙂
0 Kudos
Message 6 of 29
(4,596 Views)
Altenbach,

Sorry for digging up an old post, but is there any chance of the VI you posted as 6.1?

I'm trying to do the same thing, but the spline interpolation has be quite baffled.  I should have paid more attention in school....

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 7 of 29
(4,445 Views)
Altenbach,

I got it to work,  no need for the VI, but I'll look at it if you post anyway.

Thanks for your words of wisdom, helped me out of a momentary tight spot.

Stars are yours to keep 😉

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 8 of 29
(4,442 Views)
Shane,
 
Here's the 6.1 version with a few minor tweaks. (I no longer have 6.1, so I cannot test if the downconversion worked. It complained about incompatible format codes).
 
Good luck!
Message 9 of 29
(4,436 Views)
Altenbach,

Fantastic.  It's basically the same as how I finally got it to work, which really shouldn't have been so difficult since you actually described it quite well.

Nice to check someone else's implementation though to be sure.

Thanks

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 10 of 29
(4,434 Views)