From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does NI offer 3D deconvolution?

The diagram looks essentially identical to mine except that I end up outputting the result to an intensity graph.  I cannot say for sure whether what I have done is totally correct either - all I know is that I followed the formula normally recommended for deconvolving images.  I think we need IMAQ Vision and deconvolution experts to look into this also.  Christian: any thoughts on this?

Sincerely,

Don
0 Kudos
Message 11 of 58
(2,035 Views)
ps. I could not open your specific images.  What type are they (they do not have an extension)?  You might need to repost those.....Don
0 Kudos
Message 12 of 58
(2,025 Views)


DonRoth a écrit:
ps. I could not open your specific images.  What type are they (they do not have an extension)?  You might need to repost those.....Don




Don, thanks for your help.
The attached files are binary U8 tables. All you need to do is to enter the corresponding file paths before running the vi.
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 13 of 58
(2,017 Views)
Yes, I ran it before I had looked at the diagram and used the browse buttons during the run instead of prior to running.

I noticed your images did not show up as pure U8 grayscale.  However, I came up with similar results to yours using recently new? LabVIEW FFT/Inverse FFT functions which will work on 2d array data (see attached).

We need a math and imaging expert to help us now.

Don
0 Kudos
Message 14 of 58
(2,005 Views)

DonRoth a écrit:... I noticed your images did not show up as pure U8 grayscale


That's just because I choosed to display the images using the binary mode (otherwise the grey levels are so faint that you can't visualize the point spreading).:)
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 15 of 58
(2,001 Views)
Later this week, I will relook at my image processing books also and see if I can find more information regarding the image deconvolution process.  In the meantime, I wish we could have some help here from other experts.

FYI, you can normalize the deconvolution result to optimize viewing for grayscale if so desired (see attached).  Now you see why I still like the intensity graph as an image container vs. picture control and vision control.  Intensity graph is more flexible and manipulable due to so many property nodes.  Viewing optimized / fully contrast enhanced gray scale is done just by autoscaling Z (and interpolating color).

Don
Message 16 of 58
(1,986 Views)
Could you repost your code for LV 8.0?  If so, I'll take a look at it.

Cheers ~ Greg

0 Kudos
Message 17 of 58
(1,955 Views)
Here is the code reposted in LabVIEW 8.0. Note that we have Vision routines in this, and when I saved for previous, I did denote that the toolkit should be version 8.0 as well.  If you cannot open the Vision routines, note that part of the code is now actually duplicated only using LabVIEW and gives close to identical results to that seen from the output of the Vision portion.  So you should be able to extract the LabVIEW only code if you need to.
 
Sincerely,
 
Don
0 Kudos
Message 18 of 58
(1,943 Views)
The code is pretty close. The main problem is that the FFT of the PSF contains zeros, therefore when you divide in the deconvolution, you're dividing by zero all over the place, and you end up just looking at the noise! This is a well known issue, so when you go looking for articles or books on deconvolution, they should cover this. The easiest solution is to add a weighting factor - essentially a very small number - to the zeroes - this process is know by the term Weiner deconvolution (because the weight is often based on a Weiner filter). The downside is that it essentially blurs the result, so you need to carefully choose this value.

I've modifed your code a bit further - mostly to simplify and demonstrate how you might do an iterative Weiner deconvolution. I've done this just with LV arrays rather than Vision modules - chiefly because it's now a simple extension to move it to 3D. The left hand side of the diagram is essentially the same (except you need to normalise the PSF to sum to 1), and then I've created an event loop so you can play with the values of alpha, and the number of iterations to perform.  The Weiner deconvolution is put in a separate VI (see the attached PNG). I've added code to iteratively deconvolve - basically this subtracts the result from the original image, and then performs a subsequent deconvolution on that "error" times the PSF, to improve the solution. The Swap Quadrants at the end just repositions the result.

Start with "alpha=0" and you'll see essentially the same result as you had. Now increase alpha slightly (0.00001 say) - notice the noise is eliminated, and the result begins to appear. If you keep increasing alpha, the noise keeps reducing, but the result gets more blurred. Now with alpha around 0.005, try increasing the number of iterations - even up to 5 or 50 - for the right values, you'll get a sharp image with perhaps a little ringing - this might be reduced if you zero-padded your arrays to eliminate wrap-around.

Hope this helps you get started - this is still the simplest deconvolution that "works" - look up Richardson-Lucy algorithms if you need something "better".
Cheers ~ Greg

Message Edited by GregS on 10-12-2006 07:16 PM

Download All
Message 19 of 58
(1,933 Views)
Hello Greg:

You have done a great service here!! 

Regarding the zero padding, I have done this for waveform signals to obtain a power-of-two length so as to make 1-d FFTs more rapid (although I do not know how necessary that is in LabVIEW anymore).   It was not clear to me that more than speed was impacted. However, I would like to experiment with this and report my results.  Should the zero padding be implemented such that each of the dimensions in the 2-d array is a power-of-two length?

Sincerely,

Don
Message 20 of 58
(1,916 Views)