Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create median and spatial filter for continuous acquistion

Hi all,

 

I am trying to do some image processing , I want to make an application which will do median filtering and spatial filtering with continous acquisition of images from a gige vision camera. I tried to use nth order vi but I couldnt understand whats the filter x and y should be . images from camera are Mono 8 with height and widht set to 1000. how should i configure the median and spatial filter to do this processing continously with acquisation. I want to have atleast 5-6 frame persec for my filter. attached is my try with median filter  if I change my filter size (x-y) to more then 10 , my labview crashes. 

Please tell me how can I configure the median and spatial filter for this image processing application.

0 Kudos
Message 1 of 5
(5,540 Views)

Hello,

 

can you post the code for previous version (2013 for example)?

 

I am guessing you did not increase the border size of the image? This is needed to establish "room" for the convolution kernel...

For example, a 5x5 convolution kernel, requires a border size of 2. For a 9x9 you need a border size of 4. I think the default border value when you create an image is 3, so 7x7 kernel is possible.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 5
(5,519 Views)

@Klemen wrote:

Hello,

 

can you post the code for previous version (2013 for example)?

 

I am guessing you did not increase the border size of the image? This is needed to establish "room" for the convolution kernel...

For example, a 5x5 convolution kernel, requires a border size of 2. For a 9x9 you need a border size of 4. I think the default border value when you create an image is 3, so 7x7 kernel is possible.

 

Best regards,

K


Hi Klemen,

 

Thank you , I saved it for 2013 version. Please take a look

0 Kudos
Message 3 of 5
(5,509 Views)

Hello,

 

to apply a median filter of n-th order, use the equation:

 

n = (kernel_size^2-1)/2

 

So, if your convolution kernel is 9x9 in size, the order should be: n = (81-1)/2 = 40. Also, do not forget to create the proper border size, in the case of 9x9, the border size should be 4.

 

Also, have you seen IMAQ convolute? The median filter is a non-linear filter, whereas the convolution is a weighted sum of pixels (linear filter).

 

The median filter is often used to reduce the speckle noise in the images.

 

What is your goal?

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 4 of 5
(5,491 Views)

@Klemen wrote:

Hello,

 

to apply a median filter of n-th order, use the equation:

 

n = (kernel_size^2-1)/2

 

So, if your convolution kernel is 9x9 in size, the order should be: n = (81-1)/2 = 40. Also, do not forget to create the proper border size, in the case of 9x9, the border size should be 4.

 

Also, have you seen IMAQ convolute? The median filter is a non-linear filter, whereas the convolution is a weighted sum of pixels (linear filter).

 

The median filter is often used to reduce the speckle noise in the images.

 

What is your goal?

 

Best regards,

K


Hi Klemen,

 

thank you, the final goal is to do the median/spatial filtering during the acquisition (with 5+ frames per sec). I have Gige vision camera which will do the continuous acquisition and the user will see the unprocessed image and a processed image( filtered, denoised image) without much lag.

basic idea is to present user a continous processed images( noise removed).

 

ankit

 

 

0 Kudos
Message 5 of 5
(5,484 Views)