Remove noise lines from image

I have 360x360 image I want to remove lines in it
half portion on it has noisy lines I am working on MATLAB
I tried median filter, bilateral filter but not working how to denoise this image and remove lines?
This has periodic lines
I used this :
CODE CREDITS : IMAGE ANALYST
figure(2);
%-----------------------------------------------------------------------------------------------------------------------------------
rgbImage = maxarray;
[rows, columns, numberOfColorChannels] = size(rgbImage);
% Display the test image full size.
subplot(2, 2, 1);
imshow(rgbImage,[]);
axis('on', 'image');
drawnow;
%hp = impixelinfo(); % Set up status line to see values when you mouse over the image.
b=max(rgbImage,[],3);
% How about you sum the image vertically to get a horizontal profile?
horizontalProfile = mean(b(:, :));
subplot(2, 2, [2, 4]);
figure(2);plot(horizontalProfile, 'b-');
grid on;
bottomEnvelope = movmin(horizontalProfile, 20);
upperEnvelope = movmax(horizontalProfile, 20);
deltaGL = mean(upperEnvelope(150:250) - bottomEnvelope(150:250))
hold on;
plot(bottomEnvelope, 'r-', 'LineWidth', 2);
plot(upperEnvelope, 'r-', 'LineWidth', 2);
midline = (bottomEnvelope + upperEnvelope) / 2;
plot(midline, 'm-', 'LineWidth', 2);
% Determine what rows are above the midline.
% Those are the columns that are 50 gray levels brighter.
columnsToDim = horizontalProfile > midline;
% Darken those columns in each color channel.
rgbImage(:, columnsToDim) = rgbImage(:, columnsToDim) - double(deltaGL);
% Reconstruct output image.
subplot(2, 2, 3);
imshow(rgbImage, []);
caption = sprintf('Corrected Image where %d was subtracted from the stripes.', deltaGL);
title(caption, 'FontSize', fontSize, 'Interpreter', 'None');
drawnow;

4 Kommentare

Image Analyst
Image Analyst am 22 Jun. 2021
  1. WHY do you need to remove the lines? What is the use case and what are you going to do with or to the image after you get the lines removed?
  2. Which lines do you want to remove (there are lots of them)?
  3. Can you improve your image capture situation, like better optics, lighting, or geometry?
Image Analyst
Image Analyst am 22 Jun. 2021
There is no way to remove the dark clutter in the left third of that image unless you can also use the reference image to help, and to take values from. The lines are not periodic like a sine wave so there is no way Fourier filtering can remove the black clutter. You'll have to do it in the spatial domain. Perhaps you can threshold and do some filtering based on location (distance from edge), shape, or orientation but it will be far from perfect. Any filtering will likely also remove shapes that should stay.
shubham kumar gupta
shubham kumar gupta am 23 Jun. 2021
I tried and cleared that image and this time I guess these lines are periodic
shubham kumar gupta
shubham kumar gupta am 2 Jul. 2021
@Image Analyst can you help?

Antworten (0)

Diese Frage ist geschlossen.

Produkte

Version

R2021a

Gefragt:

am 22 Jun. 2021

Geschlossen:

am 5 Jul. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by