ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2d (image) (array) smoothing algorithm

Hello:

I am attaching images prior to and after applying a proprietary smoothing algorithm (not in LabVIEW).  I have tried to duplicate this smoothing using a variety of algorithms including up to10x spline interpolation as well as smoothing options available in Vision (low-pass filtering, local average, guassian, median filtering [after converting to 8-bit grayscale image]) but cannot come up with nearly as good of smoothing effect as that shown here as I always still see some pixelation.  Any ideas for high quality smoothing algorithms for 2d arrays (images) using LabVIEW?

Thanks,

Don
Download All
0 Kudos
Message 1 of 9
(9,794 Views)
please standby


Message Edited by altenbach on 07-09-2008 02:35 PM
0 Kudos
Message 2 of 9
(9,746 Views)
Don
 
Do you have the raw data?
 
The pixels are highly rectangular, so it would be important to have the raw data without the repeated pixels in the x direction. (sure, I could probly add some code to extract it, but why?)
 
Each image column is already quite smooth, so what you need to do is reduce the x dimensions to a set of unique slices and then interpolate to generate the new, smooth, rows at the present scale to end up with to square pixels again.
 
Here's a quick attempt using 2D circular comvolution with a Gaussian of 0.1% width in y and 3% width in x. I am sure once you can post the raw data, things will fall into place just fine.


Message Edited by altenbach on 07-09-2008 02:55 PM
0 Kudos
Message 3 of 9
(9,738 Views)
Hello:

The third party program did have an option to export the file to .txt.  I then brought the file into excel and removed header information.  Subsequently, I attempted smoothing again in my LabVIEW program and am satisfied with 10x spline interpolation result.  It appears that there is a problem attempting the interpolation on the original .png file.  I don't know why.  When you did your smoothing that you posted, were you able to display the original .png file I had posted (test.png) in an intensity graph with proper color table?




Message Edited by DonRoth on 07-10-2008 08:56 AM
Download All
0 Kudos
Message 4 of 9
(9,712 Views)

altenbach,

Can I please see your code for doing this?  -SS



0 Kudos
Message 5 of 9
(9,705 Views)
ps. I would also be interested to see that code from Christian.  Here is the implementation of 2d spline interpolation I am using. Can't guarantee it is the best but generally works well....Don



Message Edited by DonRoth on 07-10-2008 09:55 AM
Download All
Message 6 of 9
(9,689 Views)

DonRoth,

Thanks for sharing.  Something in your code caught my interest, What is the Request Deallocation block doing?

I guess I just always assumed Labview was doing this behind the scene:)  Does this improve performance for you?  -SS 



0 Kudos
Message 7 of 9
(9,685 Views)
Most likely, it is not needed for this code and can be removed.  I tend to put it in when large multi-dimensional array information has to be manipulated in memory just in case.
 
Sincerely,
 
Don
0 Kudos
Message 8 of 9
(9,681 Views)
....Same subVI as above but cleaner front panel and with connections made....Don
Message 9 of 9
(9,663 Views)