Jump to content

Curve fitting a hand drawn picture


Recommended Posts

Hello,

I have a pretty simple program with a picture control on the front-panel on which I want to be able to draw a wave.

I already came this far tongue.gif.

Next I want to have some kind of function which uses the picture and generates a waveform which can be generated by the DAQ hardware.

Does anyone know if this is possible and how?

attached is what I came up with this far.

main.vi

Link to comment

 It's possible, but you'd have to validate the drawing's data before you could make it into a waveform.  I've made it into an X-Y Graph by doing this:

post-7534-057702500 1279031383_thumb.png 

What would your waveform look like if you moved your pen from right-to-left?  That's one thing you'd need to handle.

Interesting question, however.  What's your application going to do?

main.vi (LV 8.2)

Link to comment

It's possible, but you'd have to validate the drawing's data before you could make it into a waveform. I've made it into an X-Y Graph by doing this:

post-7534-057702500 1279031383_thumb.png

What would your waveform look like if you moved your pen from right-to-left? That's one thing you'd need to handle.

Interesting question, however. What's your application going to do?

main.vi (LV 8.2)

thanks for you reply.

I want to make a program where you can draw a waveform which can be later on be generated by my DAQ analog out.

Link to comment

 

I want to make a program where you can draw a waveform which can be later on be generated by my DAQ analog out.

I understood that part, I just don't understand why.

I've modified my earlier example to use the Waveform data type, but you'll see that it doesn't faithfully represent what's been drawn.  This is where you'll have to define how to convert X-Y data into a waveform (axis scaling and handling right-to-left pen movement, to start).  Do you understand what I mean?

post-7534-016919600 1279102673_thumb.png

main (1).vi

  • Like 1
Link to comment

but you'll see that it doesn't faithfully represent what's been drawn. This is where you'll have to define how to convert X-Y data into a waveform (axis scaling and handling right-to-left pen movement, to start). Do you understand what I mean?

Thanks again for you reaction.

I have been tuning my software and also added code to scale/sort x- and y-axis.

My waveform is now almost a duplicate of the drawing.

There is however a bug which I haven't found jet which screws up my x-axis scaling.

I'll try to fix this myself. Thanks for all the help so far.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.