Hello,
The main goal here is to view the concentric circles and measure the distance between them (by cross sectioning using 'improfile'). However, the noise is getting in the way and making the distance estimation very difficult. I have been trying to remove the vertical stripping noise from the image attached...but couldn't get anywhere... Any hint what kind of filter would be useful?
Depending on the result of noise removal I might need to do some object recognition to visualize the circles in a proper way...but that's for later.
Thanks in advance. Kind regards, Ahmad

 Akzeptierte Antwort

David Young
David Young am 17 Sep. 2014

2 Stimmen

You can smooth the image in the vertical direction, which reduces the amplitude of the circles but leaves the stripes. Then subtract this from the original image, to leave just the circles and the borders at the top and bottom. You can't achieve perfect separation, but this gets quite a good result.
You can do the smoothing with fspecial and convn (or conv2 if you first convert the image to grayscale). Alternatively, you can use gsmoothn from here, as in the code below:
im = imread('NO AIRGAP2.bmp');
imd = double(im);
sigma = 10; % experiment with this parameter to get best result
imcircles = imd - gsmoothn(imd, [sigma 0 0], 'Region', 'same');
% display the result, converting to grayscale to make display clearer
imshow(mean(imcircles, 3), []);
I suspect there may be a very good solution possible using morphological operations instead of linear ones, but I haven't explored that.

3 Kommentare

Ahmad Khaled
Ahmad Khaled am 18 Sep. 2014
Thanks David...
I am trying the gsmoothn function but it's returning an error for some reason...(line 121: class inputParser has no property or method named 'addParamValue'.) Anyway, I got your point and trying to make it work somehow.. Would be interesting to try implementing the morphological way also. I will try to search around about it. Thanks for your reply.
David Young
David Young am 18 Sep. 2014
Ah, it's a MATLAB version issue. Change addParamValue to addParameter and it will probably be OK.
Mandeep Kaur
Mandeep Kaur am 4 Apr. 2022
how I can use this to remove horizontal stripe noise

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Iain
Iain am 18 Sep. 2014

3 Stimmen

Here's an answer that probably hits what you need...
column_offsets = median(im);
column_offsets = column_offsets - min(column_offsets);
new_im = bsxfun(@minus,im,column_offsets);

2 Kommentare

David Young
David Young am 18 Sep. 2014
Did you try it? I just did, and it didn't seem to work very well, I think because the stripes aren't exactly along the columns. Also you need to convert the image to grayscale before you apply the process, otherwise you get an error in the second line.
Gerard
Gerard am 17 Okt. 2018
this does amazingly well for my application

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by