LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2d interpolation

Dear friends,

   I want to perform the 2D interpolation of  a intensity graph using “Interpolate 2D” Vi. But I don't want this function operated at the same time of running  the main VI. So I saved the intersity graph as a JPEG using the Invoke Node firstly. Then the question comes. Is there a method to change the JPEG picture to the data array that used to draw the original intersity graph,or is there a method to realize the interpolation by operating the image(image data)??

 

Thank you!

0 Kudos
Message 1 of 18
(3,886 Views)

That sounds like a difficult way to handle the task.  You know how to handle the interpolation while the VI is running it sounds like.  Why convert the data to a jpg?  Just store/log it as it is.  Whatever VI you're using to handle the interpolation can open the logged file with the data in the same format you're used to and then run the interpolation.

 

This avoids the mess you're creating with converting your data to a picture instead of the data you're used to.

Message 2 of 18
(3,871 Views)

Wow,I am just curious about this. i think it's interesting.  I think maybe a good way to edit picture.

0 Kudos
Message 3 of 18
(3,865 Views)

I will second natasftw's suggestion that you store the data from the original source and format. As said, this will allow you to get it in the original form without going through any modification. Also possible is to use the methods Export to Excel or Export to Clipboard. You will need Excel installed for the first one.

 

Be aware that the JPEG format uses lossy compression. This will change your data, so saving as a JPEG is not recommended.

 

If you need help with saving your original data to disk and reading it back for analysis, let us know. Please post your current code so we can help you better.

Message 4 of 18
(3,837 Views)

Thank you for your suggestion. i have saved my data using “write to  spreadsheet file” , read it in a  subvi, and performed  interpolation in this subvi. But I think interpolation is really a large calculation. It consumed about a minute performed  on an 12*96 array.

0 Kudos
Message 5 of 18
(3,806 Views)

Hi carrot,

 

when your algorithm takes a minute to interpolate a 12*96 array you either use the wrong algorithm or a very old computer…

🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 18
(3,787 Views)

Thank you for your reply.

 I post a picture here. The "z" is the 12*96 array  that would be read from a spreadsheet, "x""y" are unwired, method is "spline" and ntime is "3",  Do you think it's the correct way?

0 Kudos
Message 7 of 18
(3,773 Views)

Hi carrot,

 

this one:

check.png

takes <2s on my office computer…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 18
(3,768 Views)

 

   Here is the testing, the first picture the real one in my program, the second picture is a test. Why the time of the first one is so longer than the second one??Does the read from file make this difference??

Download All
0 Kudos
Message 9 of 18
(3,758 Views)

Reading that amount of data from a file should take less than a second. However, you could have some file type issues. When you save your file from Excel, do you save it as an Excel file (binary) or a text file (requires actively selecting the text file option on save)? The VI you are using to read the data is assuming a delimited text file. If you are using the default Excel format, this could easily cause the issue. If you are unsure, look at the file extension. It should be "txt" not "xls". If it is "xls", open in Excel and resave as a text file, then try your LabVIEW analysis again.

Message 10 of 18
(3,751 Views)