04-19-2010 01:40 PM
I want to use the LabVIEW 1d median filter function for 2d array (image) application. Vision does not have this function (or I cannot find it [using Vision 8.5]). I am assuming I can apply the 1d median filter across the rows, then transpose the array, and apply again to the rows (really the columns but now rows because of transposition). Just like for using the 1d FFT for 2d FFT. Is this strategy correct?
Thanks,
Don
Solved! Go to Solution.
04-19-2010 02:22 PM
No.
You need to define a window (X x Y pixels) and get a 2-D sub-array, reshape to linear, get median, and update the center pixel of your selection with that value. Shift one pixel, repeat until the end of the row, shift down and repeat again until you have the full image.
It's really time-consuming.
Shane
04-19-2010 03:48 PM
It is there - IMAQ NthOrder under Image Processing:Filters.
By default, it takes the middle number of a 3x3 region around each pixel, but can be set to be the largest, smallest, or any rank in between. Also has the flexibility of defining the size of the filter, although being a non-linear filter (hence why it's not separable as you suggest) the time required increases significantly.
04-19-2010 05:54 PM
Excellent find. Further information on this fx:
"You can use this VI to apply a median filter by selecting the correct order, (f^2-1)/2, where f is the size of the convolution matrix." (A median (center-pixel) operation is advantageous because it standardizes the gray-level values without significantly modifying the form of the objects or the overall brightness in the image.).
So one only needs to specify the convolution kernel dimension, and can use the above equation to calculate order. It was hard for me to believe that Vision did not have this function. I now see that I should have searched the NI Vision for LabVIEW Help. This is something I almost always do in addition to searching for the actual functions from the block diagram. Had I done this, I would have found it.
Thanks again for looking.
Sincerely,
Don
04-20-2010 05:57 AM
Folks - as an FYI, also note that Vision implements other non-linear filters using IMAQ EdgeDetection.
Sincerely,
Don
04-20-2010 07:29 AM
I found another implementation of the image median filter. It is located at:
\Vision Assistant 8.5\CG\iva templates lv85-vision85.llb\IVA GrayFilters - NthOrder.vi
This implementation is even simpler that the Vision fx because the only input is kernel size.
Don
04-20-2010 04:31 PM
04-21-2010 08:53 AM
05-19-2017 05:35 AM
hello,
please i have problem about choosing a suitable filter for medical image processing in labview
so,can you help me by giving me a filter's name and how can i use it in labview ?
thank you
05-19-2017 07:34 AM
hello,
please i have problem about choosing a suitable filter for medical image processing in labview
so,can you help me by giving me a filter's name and how can i use it in labview ?
thank you