LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bilinear interpolation on missing intensity value of image

Solved!
Go to solution

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.

Capture.PNG

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. 

 

 

Download All
0 Kudos
Message 1 of 7
(4,854 Views)

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?

0 Kudos
Message 2 of 7
(4,842 Views)

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. 

 

 

Download All
0 Kudos
Message 3 of 7
(4,821 Views)
Solution
Accepted by topic author damagor

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.

0 Kudos
Message 4 of 7
(4,807 Views)

And here's how it would look applied to your transformed output.

 

 

0 Kudos
Message 5 of 7
(4,804 Views)

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.

 

 

0 Kudos
Message 6 of 7
(4,801 Views)

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.

 

 

0 Kudos
Message 7 of 7
(4,792 Views)