05-26-2017 08:00 AM
Hi I have a double arrays of intensity values and plotted it using intensity graph. However, there are some missing values as zeros. I researched and got to know that one way to rectify it is to do bilinear interpolation. I did use the 2d interpolation vi and the image shown wasn't expected.
The values of missing intensity doesn't interpolate right from the output image. Any advice or suggestion is greatly appreciated. Attached is the simple vi I try for this.
Solved! Go to Solution.
05-26-2017 08:26 AM - edited 05-26-2017 08:27 AM
You don't have most of the inputs wired.
Your data is already fully grid'ed, so all you need to do is find the array elements that are zero and replace them with the average of the neighboring elements, for example.
(Bilinear interpolation is not the right tool. You would only need that to get values that dont fall on the original grid points).
Can you attach a version of your VI that contains typical default data in the array controls?
05-26-2017 10:26 AM
Hi Altenbach,
Thanks for your clarification. Please find the version of VI with the default intensity data. The intensity data is missing while doing the geometric transformation. Appreciate if you can provide me some insight on replace zero pixels with the average of the neighboring elements.
05-26-2017 11:03 AM - edited 05-26-2017 11:25 AM
Your image does not contain any values that are zero.
But here's how you could replace any zero element with the average of the neighboring nonzero elements.
05-26-2017 11:13 AM - edited 05-26-2017 11:28 AM
05-26-2017 11:17 AM
Of course it would seem more reasonable to index into the original array using transformed fractional coordinates and use bilinear interpolation right there. Have a look at the links in this idea.
05-26-2017 11:58 AM
Hi Altenbach,
Thanks for your prompt response and help. I was trying to implement the vi and it worked perfectly. Regarding your previously reply on doing bilinear transformation, I was actually looking at your posted bilinear vi yesterday and tried to think on how to implement that during the process. I would probably try to see if I can implement this by myself. Otherwise, replacing zeros with the average of nearest neighbour is the way to go.