필터 지우기
필터 지우기

remove periodical like lines from the image

조회 수: 45 (최근 30일)
Dimani4
Dimani4 2022년 12월 27일
댓글: Image Analyst 2022년 12월 29일
Hi people,
I have a question to you. I have this kind of picture:
You see kind of horizontal lines through the image. I'd like to remove them. What do you think can I do?
The mat file of matrix is attached here.
Thank you very much.
  댓글 수: 2
Rik
Rik 2022년 12월 27일
What have you tried so far? A convolution might do the trick already.
Dimani4
Dimani4 2022년 12월 27일
I tried this thread:https://www.mathworks.com/matlabcentral/answers/471074-remove-periodic-noise-pattern-from-image. Unfortunately it didnt help me much. Can you please give me some example and explain why convolution?
Thank you.

댓글을 달려면 로그인하십시오.

채택된 답변

Rik
Rik 2022년 12월 27일
I actually suspect the bands are actual data and the circles are not, but without the context that is hard to tell.
S=load('matrix2see');
im=S.picture;
subplot(1,2,1)
imshow(im,[])
minmax=[min(im(:)) max(im(:))];
%create a column vector to use as a convolution kernel
kernel=ones(15,1);kernel=kernel/sum(kernel(:));
im2=conv2(im,kernel,'same');
subplot(1,2,2)
imshow(im2,minmax)
As you can see, that blurs the image a fair bit. What might perhaps work better is to subtract the mean of each row. This will only work if the bands are perfectly alligned to the grid.
figure
im3=im-mean(im,2);
imshow(im3,[])
You can fine-tune this second method by using a moving average instead of averaging the entire image.
  댓글 수: 6
Dimani4
Dimani4 2022년 12월 27일
Exactly, I want to remove the striping.
Dimani4
Dimani4 2022년 12월 27일
Just want to share the result I got from movmean(image,50,2)
im4=im-movmean(im,50,2);
Thank you for your suggestion, Rik. :)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2022년 12월 27일
We really need to know what gave rise to the lines. For example are you using a line scan camera and the lighting is flickering?
What I'd do is to take the mean of the image horizontally and divide the image by the mean. That would compensate for the case where the row of the image is good, it's just the wrong brightness.
S = load('matrix2see')
S = struct with fields:
picture: [203×256 double]
grayImage = S.picture;
% imwrite(mat2gray(grayImage), 'dimani4.png')
[rows, columns, numberOfColorChannels] = size(grayImage)
rows = 203
columns = 256
numberOfColorChannels = 1
subplot(1,2,1)
imshow(grayImage,[])
title('Original Image')
rowMeans = mean(grayImage, 2);
repairedImage = grayImage ./ repmat(rowMeans, [1, columns]);
subplot(1,2,2)
imshow(repairedImage,[])
title('Repaired Image')
It looks like the rows means are not perfect, either because the lighting changes as the scan goes across, or the presence of particles in there affects the mean, changing it from it's true value. If you could get the means from a totally blank shot, it would help, but that assumes the pattern of lines stays fixed from one shot to the next.
  댓글 수: 4
Dimani4
Dimani4 2022년 12월 29일
편집: Dimani4 2022년 12월 29일
Thank you for your answer.
No, unfortunately the lines are not appear in the same location for every image.I cannot do the scan without sample because the tip during the scan should be in contact with the sample (AFM- Atomic Force Uscope), So these lines happened because the scan was performed in noisy environment (people were chatting during the scan).
As usual with these files people using WSxM program to remove noises from the picture and analyse pictures and so on. So Subtract Line Filter in WSxm looks similar as the movmean function of Matlab to this particular picture. Look at the attached figures.
I added .stp file in .zip which can be opened in WSxm program.
Image Analyst
Image Analyst 2022년 12월 29일
If you're happy with the result, that's fine. The moving mean will blur the image more than a moving median. But maybe the blur is not important for what you need to do with the image. If it's really important you can rescan the sample and tell everyone not to talk.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by